Hi there!

I have this script I just made based on a tutorial I found online and was
wondering if there was a better way to do this or not. Everything works
great so far except for a couple little things. Once the $submit is clicked
and runs the INSERT data into the table... I am looking to be able to have
the page auto refresh and display the new entry as well as the form again.
Here's my current code: (I have this built into the main review page via an
include. The entire page can be viewed here:


Feel free to post a dummy message, nothing is live yet, all in test mode :)

you'll notice once the entry is submitted also, if you try to refresh the
page it wants to readd the data again. any help or guidance appreciated, I
am a self professed "still learning this stuff"! kinda guy.


  if ($submit) {

  // Process Form

  $DBconn = mysql_connect("localhost", "user", "pass");
  mysql_select_db("databasename", $DBconn);
  if (!$DBconn) {
    echo( "<p>Unable to connect to the " .
       "database server at this time.</p>" );

    $sql = "INSERT INTO talkback (band_id, album_id,
talkback_name,talkback_email,talkback_comments) VALUES
    $result = mysql_query($sql);
    echo "Thank you! Information entered.\n";
  } else {

  // display form


  <form method="post" action="<?php echo "$PHP_SELF" . "?band=$band" .
  <div align="center"><b>Name/Nickname:</b><br>
    <input type="Text" name="talkback_name"><br>
    <b>Email (optional):</b><br>
    <input type="Text" name="talkback_email"><br>
    <textarea name="talkback_comments" cols="50" rows="5"></textarea>
    <input type="Submit" name="submit" value="Speak Your Metal!">


} // end if



PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to