Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

newbie: making html data in one form available in others

Codes here !

Moderators: macek, egami, gesf

newbie: making html data in one form available in others

Postby dee » Wed Jun 25, 2003 8:08 am

im using 4 PAGES of html forms for user input. need to get all the user inputs before saving to mysql database.

how do i transfer input data from form 1 to form 3 - HTTP_POST_VARS only works for form 1 to form 2. i have four different pages!!

can i use arrays? how?
dee
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Jun 25, 2003 7:53 am

Postby liquedus » Wed Jun 25, 2003 8:26 am

use session var's?

or use a temp file...
liquedus
php-forum Active User
php-forum Active User
 
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada

Postby Flood » Wed Jun 25, 2003 8:30 am

Hi!

Just a couple of ideas coming to my mind:
- saving information in cookies/sessions
- hiding information in hidden items (cf. <input type="hidden" ... />)
- saving information in a file on the server side

I guess that is not really good ideas, but what an idea to have 4 different forms! ;-)

/Flood
Flood
New php-forum User
New php-forum User
 
Posts: 23
Joined: Tue Jun 24, 2003 4:49 am

Postby dee » Tue Jul 01, 2003 11:23 am

yeah. i'm trying to use hidden fields but can't get it to work:


<tr>
<td> Email </td>
<td> <input type="text" size="40" name="App_Name"/></td>
</tr>

<tr>
<td> Work/daytime phone </td>
<td> <input type="text" size="20" name="App_Phone"/><br /></td>
</tr>


<input type='hidden' name='var2' value='".$HTTP_POST_VARS['App_Name']."'>
<input type='hidden' name='var2' value='".$HTTP_POST_VARS['App_Phone']."'>


<tr>
<td><br /><input type="submit" name="next" value="Next"></td>
</tr>


Help!!!

(PHP version installed is 4.0.3 hence using HTTP_POST_VARS[])
dee
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Jun 25, 2003 7:53 am

Postby Joan Garnet » Tue Jul 01, 2003 4:09 pm

These two vars have the same name:
Code: Select all
<input type='hidden' name='var2' value='".$HTTP_POST_VARS['App_Name']."'>
<input type='hidden' name='var2' value='".$HTTP_POST_VARS['App_Phone']."'>


this way you will have two vars:
Code: Select all
<input type='hidden' name='var1' value='".$_POST['App_Name']."'>
<input type='hidden' name='var2' value='".$_POST['App_Phone']."'>
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Postby dee » Wed Jul 02, 2003 2:51 am

thanks Joan but still no luck! when i do

<?
echo $var1;
?>

on a subsequent form i get

\".$_POST[

as output.
dee
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Jun 25, 2003 7:53 am

Postby Joan Garnet » Wed Jul 02, 2003 3:36 am

I suppose you hare sending those form variables using the POST method.
if you get thiese variables
Code: Select all
<input type='hidden' name='var1' value='".$_POST['App_Name']."'>
<input type='hidden' name='var2' value='".$_POST['App_Phone']."'>

Then when you send the form you have to call them like this in the next page:

Code: Select all
$_POST['var1']
$_POST['var2']
.....
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars


Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.