Forum Moderators: coopster
$_POST[FirstName] from apage1.php to apage2.php and now I do some edits to that page and submit that to apage3.php but the variable doesn't come across to the next page...how come? Example:
db query to get firstname in a form then using the post method I submit that to another page. Then add some features ( not changing the firstname variable at all ) and submit that form ( 2 total forms now ) using the post method as well. So we've got 2 forms with a total of 3 php files. I've tried using hidden values on the 2nd php page to the 3rd php page 2nd form but that doesn't work ( unless I'm doing it wrong ). Any Ideas?
test2.php
<?
$db = mysql_connect ("localhost","dbuser","dbpword") or die(mysql_error());
$link = mysql_select_db ("cashflow_misc", $db) or die(mysql_error());
$query = "select website FROM websites";
$result = mysql_query($query);
$website = mysql_result ($result, 0);
?>
<form method="post" name="website" action="<? echo $_SERVER['PHP_SELF'];?>">
Database query complete press submit to see your website below:
<input type="hidden" name="website" value="<? echo "$website";?>" />
<input type="submit" name="add_website" value="submit" />
</form>
<br />
<br />
<form method="post" name="test" action="test3.php">
This is your website: <? echo $_POST['website'];?>
<br />
<br /><input type="text" name="test" maxlength="18" value="blah test" />
<input type="submit" name="test2" value="submit" />
</form>
Here is the code for test3.php:
<?
echo "$website";?> this should be your website <br />
<? echo "$test";?> Hope that helps anyone understand my problem(s).
[edited by: coopster at 8:16 pm (utc) on July 13, 2006]
[edit reason]
[1][edit reason] removed url per TOS [webmasterworld.com] [/edit] [/edit][/1]