RE: [PHP-WIN] im so stupid
| From: | Shrock, Court | Date: | Mon, 11 Feb 2002 23:33:41 +0000 |
| Subject: | RE: [PHP-WIN] im so stupid | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-12005@lists.php.net to get a copy of this message | ||
> registrer.html ->
>
> <html>
> <head></head>
> <body><form method="post" action="registrer.php">
> Fornavn: <input type="text" name="fornavn"><br>
> Etternavn: <input type="text" name="etternavn"><br>
> <input type="Submit" name="submit"
> value="Registrer"><br> </form>
I do not think that an input of type 'submit' will be submitted in the post
to the next page...you could verify this by doing a phpinfo at the top of
registrer.php....the only name/value pairs submitted in the above form
should be "fornavn" and "etternavn".
> </body>
> </html>
>
> registrer.php ->
>
> <?
> IF (isset($submit))
...and therefore, the above statement would fail because the $submit
variable is not set and therefore the intended code below would not be
executed....
> {
> $hostname = "dbname";
> $username = "chris";
> $password = "*****";
> $dbname = "chris";
> MSSQL_CONNECT($hostname,$username,$password);
> mssql_select_db($dbname);
> $sql = "insert into studenter(fornavn, etternavn) values
> ('$fornavn','$etternavn')";
> $result = mssql_query($sql);
> $studentnummer = mssql_insert_id();
> Print("Studenten er lagt inn!");
> }
> ?>