Image

Imagekhaleesi wrote in Imagephp 😊hopeful

Help with Timestamps

I need a timestamp when someone hits the "Submit" button and it shows up on another page. But when someone doesn't fill out the form and just goes to see the responses, the timestamp shows up blank. And then everytime you go to the response page or refresh it, it makes a huge blank space with a timestamp on it. How do I change that?

Here's the form:
http://twilight-angel.net/vikings/picks.php

And here's the results:
http://twilight-angel.net/vikings/form_process.php

See what I mean? Here's the codes I am using:
<form action="form_process.php" method="post">
<?php
mysql_connect("host", "username", "pw") or die("Error: ".mysql_error());
mysql_select_db("eric") or die("Error: ".mysql_error());
extract($_POST); 
$query = "
INSERT INTO 
   `zones`
(name, email, game_one, game_two, game_three, game_four, game_five, game_six, game_seven, game_eight, game_nine, game_ten, game_eleven, game_twelve, game_thirteen, game_fourteen, game_fifteen, game_sixteen, comments)
    VALUES
('$name', '$email', '$game_one', '$game_two', '$game_three', '$game_four', '$game_five', '$game_six', '$game_seven', '$game_eight', '$game_nine', '$game_ten', '$game_eleven', '$game_twelve', '$game_thirteen', '$game_fourteen', '$game_fifteen', '$game_sixteen', '$comments')";
 
$insert = mysql_query($query) or die(mysql_error());
?>
<?php
mysql_connect("host", "username", "pw") or die("Error: ".mysql_error());
mysql_select_db("eric") or die("Error: ".mysql_error()); 
$query = "SELECT * FROM `zones`";
$result = mysql_query($query);
while($__row = mysql_fetch_assoc($result)){
    
    echo $__row['name']."<br />";
    echo $__row['email']."<br />";    
    echo $__row['game_one']."<br />";
    echo $__row['game_two']."<br />";
    echo $__row['game_three']."<br />";
    echo $__row['game_four']."<br />";
    echo $__row['game_five']."<br />";
    echo $__row['game_six']."<br />";
    echo $__row['game_seven']."<br />";
    echo $__row['game_eight']."<br />";
    echo $__row['game_nine']."<br />";
    echo $__row['game_ten']."<br />";
    echo $__row['game_eleven']."<br />";
    echo $__row['game_twelve']."<br />";
    echo $__row['game_thirteen']."<br />";
    echo $__row['game_fourteen']."<br />";
    echo $__row['game_fifteen']."<br />";
    echo $__row['game_sixteen']."<br />";
    echo $__row['comments']."<br />";
    echo $__row['time']."<p />";
    
}
?>
</form>


Any help is appreciated. Thank you.