|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, I have a form like this in php on list.php
PHP Code:
in sites.php I have PHP Code:
The problem is that all I see is the numbers 1 through 10 in sites.php. My question is how can I echo the variables passed by list.php? Thanks in advance |
|
#2
|
|||
|
|||
|
First of all, this:
PHP Code:
should be this: PHP Code:
field should not have a dollar sign in front of it or else PHP will think it's a variable and try to retreive the value it stores. Second, you are sending your form via post. Is register_globals on (which, I should add, isn't good for security: http://forums.devshed.com/t20525/s.html). If not, you'll have to access the variables from the $_POST array. |
|
#3
|
|||
|
|||
|
In list.php you should treat the textboxes as an array. If you want them to be named field but give multiple values, name the textboxes field[]. This will turn it into an array and when the data is passed to sites.php, you can find all your values located in the array $_POST['field'].
Remember, it is an array so you have to iterate it to get all the values. Below is both scripts modified to do just that: Enjoy: list.php PHP Code:
sites.php PHP Code:
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > How to echo form values |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|