This is a discussion on File won't refresh within the PHP Language forums, part of the PHP Programming Forums category; Hello all I'm building a suite of free php applications to create virtual worlds. My problem is i can'...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello all
I'm building a suite of free php applications to create virtual worlds. My problem is i can't get my file to refresh. I am not a programmer and i started using php this week. my only experience with php is installing personal cms systems (mambo, gallery, pn, phpbb, wordpress, etc.) The sample application contains 2 files: a)The php file (with input controls and the embedded world) b)The embedded world (text file) 1. The php file accepts input from the user 2. The user hits Submit which creates the text file for the world this works - the text file is created with changes. next the page should refresh itself and show the world based on the user's input. Right now steps 1 and 2 work perfectly in the sense that the text file for the world does get created. however the page will still show the older version of the text file. To get the page to refresh properly, i have to hit the reload button on the browser...this gives me the "this page can't be refreshed without sending..." alert...but it then refreshes and shows the changes. the code: the code for the text file is irrelevant. the code for the php file (just a snippet): <html><head> <title>SpotCoder</title> </head> <body> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p>Spot Title: <input type="text" name="SpotTitle" size="20" /></p> <p><input type="submit" /></p> </form> </body> </html> <?php //variables $spot_code = $_POST['SpotTitle']; //open $sc = fopen("myfile.3dml", "w"); // Write to 3dml text file fwrite($sc, "<TITLE NAME=" . '"'. $spot_code .'"'. " />\n"); // Close file fclose($sc); ?> <div id="Mylayer" style="position:absolute; left:25px; top:130px; width:626px; height:440px; z-index:2"> <embed TYPE="model/vnd.flatland.3dml" SRC="myfile.3dml" PLUGINSPAGE="http://www.flatland.com/download_direct.html" HEIGHT="440" WIDTH="626"> </div> thanks for any help. |
|
|||
|
sorry, I'm not really sure what to do about your problem. Only thing i
could suggest is make another php file that actually submits the data like "submitter.php" that receives the data then sends you to your page that shows it... then it would be the new version. what kind of virtual worlds? sounds interesting -IWP506 |