Page does not refresh

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jcwmtl@hotmail.com

    Page does not refresh

    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. Can this be done with
    javascript?
    I would like to have the display and the form be on a single
    page..unless this can be done with frames.

    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>SpotCode r</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.3 dml", "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.3d ml" SRC="myfile.3dm l"
    PLUGINSPAGE="ht tp://www.flatland.co m/download_direct .html" HEIGHT="440"
    WIDTH="626">
    </div>

  • Janwillem Borleffs

    #2
    Re: Page does not refresh

    jcwmtl@hotmail. com wrote:[color=blue]
    > 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.
    >[/color]

    Try something like:

    <embed TYPE="model/vnd.flatland.3d ml"
    SRC="myfile.3dm l?<?php print time() ?>"

    Appending the output from the time() function will make the value of the SRC
    attribute unique each time the page is reloaded and should force your
    browser to retrieve a fresh copy from the server.

    JW



    Comment

    Working...