Re: Problem of varibles between webpages
| From: | Matthew Sims | Date: | Fri, 24 Dec 2004 03:19:14 +0000 |
| Subject: | Re: Problem of varibles between webpages | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-205112@lists.php.net to get a copy of this message | ||
> Hello,
>
> For table form format ( sample ),
>
> <form method="" action="">
> <table>
> <tr><td>Your Name : </td><td><input name="name" size=30
> maxlength="60"></td></tr>
> <tr><td>Address¡G</td><td><input name="address" size=30
> maxlength="60"></td></tr>
> </table>
> </form>
>
> "name" and "address" is varible, so how can we pass these two varible
> without register_globals function ( actually it is disable ) to another
> webpage ?
>
> Many thank for your help !
>
> Edward.
Your method and action are blank.
<form method="post" action="whatever_page.php">
You need a submit button.
<input type="submit" name="add" value="Submit">
Submit will pass the vars to whichever page action is set to. The vars
will be in the $_POST array, basically $_POST['name'] and
$_POST['address'].
Whatever page action calls, you can have php check that the submit button
was executed like:
<?php
if (isset($_POST['add')):
// whatever you want to do with $_POST['name'] and $_POST['address']
endif;
?>
--
--Matthew Sims
--<http://killermookie.org>