Passing variables through multiple pages then DB insert
Posted: Sun Feb 23, 2003 5:55 pm
OK as a pHp novice, I ask for your patience. I realize I may be simplistic in my approach, but you have to start somewhere.
Ok, what I'm trying to do is present a form that a user will fill out. Then pass that data into a second form for verification. Then send that second form data to a query for insertion into a mysql DB.
I'll only reference a single input for time's sake.
Page 1
------------------
echo "<form action=\"admin.php?action=addaction\" method=\"post\" name=\"add\" id=\"add\">";
echo "<input type=\"text\" name=\"mnamei\" size=\"50\" maxlength=\"100\">";
echo "<input type=\"submit\" name=\"Submit\" value=\"Submit\">";
echo "<input type=\"reset\" name=\"Reset\" value=\"Reset\">";
echo "</form>";
------------------
Page 2
------------------
$mnameval = $_POST['mnamei'];
echo "<form action=\"admin.php?action=addaction2a\" method=\"post\" name=\"add\" id=\"add\">";
echo "<input type=\"text\" name=\"mname\" size=\"50\" maxlength=\"100\" value=\"$mnameval\">";
echo "<input type=\"submit\" name=\"Submit\" value=\"Submit\">";
echo "<input type=\"reset\" name=\"Reset\" value=\"Reset\">";
echo "</form>";
------------------
Page 3
------------------
$mnamevalf = $_POST['mname'];
echo = $mnamevalf;
-----------------
So my question is why doesn't this work? I need to solve this flow problem before I can address the insert.
Any ideas?
Ok, what I'm trying to do is present a form that a user will fill out. Then pass that data into a second form for verification. Then send that second form data to a query for insertion into a mysql DB.
I'll only reference a single input for time's sake.
Page 1
------------------
echo "<form action=\"admin.php?action=addaction\" method=\"post\" name=\"add\" id=\"add\">";
echo "<input type=\"text\" name=\"mnamei\" size=\"50\" maxlength=\"100\">";
echo "<input type=\"submit\" name=\"Submit\" value=\"Submit\">";
echo "<input type=\"reset\" name=\"Reset\" value=\"Reset\">";
echo "</form>";
------------------
Page 2
------------------
$mnameval = $_POST['mnamei'];
echo "<form action=\"admin.php?action=addaction2a\" method=\"post\" name=\"add\" id=\"add\">";
echo "<input type=\"text\" name=\"mname\" size=\"50\" maxlength=\"100\" value=\"$mnameval\">";
echo "<input type=\"submit\" name=\"Submit\" value=\"Submit\">";
echo "<input type=\"reset\" name=\"Reset\" value=\"Reset\">";
echo "</form>";
------------------
Page 3
------------------
$mnamevalf = $_POST['mname'];
echo = $mnamevalf;
-----------------
So my question is why doesn't this work? I need to solve this flow problem before I can address the insert.
Any ideas?