hello i am currently coding a multi page contact form. I want all data from each page to be took through all the pages so at the end its just like one simple contact form but in different steps. This is the code i used to carry the $_POST inputs through each page to the final page:
Quote:
<?PHP
foreach ($_POST as $key => $val) {
echo "<input type='hidden' name='' . $key .
'' value='' . $val . '' />" . "\r\n";
}
?>
|
This code worked a charm up until i made my contact form use mysql database to display subjects and people you can contact i used the following code to display this data:
Quote:
<?php
$con = mysql_connect("localhost","my_user","my db password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_database", $con);
$result = mysql_query("SELECT * FROM db_table");
echo "<br /><table border='0' width='100%'>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td style='text-transform:capitalize;'><input name='toemail' type='radio' value='" . $row['feild'] . "' />" . $row['feild1] . "</td>";
echo "</tr>";
}
echo "</table><br />";
?>
|
After using this peice of php my code to carry the data through all the pages works up untill it gets to the page that you select who you would like to contact ( note: i used this same script on the index.php page of my script which is a page that displayed subjects from a mysql database and it carryied the data through pages perfect. ) Then when it gets to the sadmin.php page, it lets say stops working, It drops all data it carryied on and just keeps the email that its to send to so by the end of the pages the form only collected one peice of information the email address. Please look at my script and fix this problem so that from page index.php the data is carryied o to send_mail.php so that i can use the $_POST inputs in the email it sends me thanks for reading person who helps me will get the finished version free of charge once i have completed my project.
DOWLOAD THE SOURCE REQUIRED:
THANKS AGAIN
EMAIL ME:
MRWHOUSTON1@AOL.COM