Question about form in PHP and MySQL
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Question about form in PHP and MySQL

From: <peter_ross@canada.com>
Date: Mon May 01 2006 - 05:34:45 CEST

Hi,

I am new to PHP and MySQL. I was writing a script to pull data from
SQL server and display the data. There's a "submit" button. When the
user clicks "submit", the form calls itself and I "expect" the submit
value is set. However, I find the $submit is never set. Is there
something wrong with my script?

Thanks,
Ross

<?php
  include("contentdb.php");
  $display = mysql_query("SELECT * FROM $table ORDER BY id",$db);

  if (!$submit) {
        echo "<form method=post action=$PHP_SELF>";

                // code to display questions

        echo "<input type='submit' value='SUBMIT' name='submit'>";
        echo "</form>";
  }

  if ($submit) {
                // calculate scores
  }
?>
Received on Mon May 1 03:08:21 2006