hey all - quick question, im sure a stupid one, but could use a hand nonetheless
Page process
Form > Post to submit page that posts to db > redirects user to 3rd page
Looking to take the variables sent submit page and put them into the link going to 3rd page. currently, it looks like this
<?
require_once("config.php");
require_once("mail.php");
$data = $_POST;
$data['dob'] = "$data[dobYYYY]-$data[dobMM]-$data[dobDD]";
$t = "registration";
$q = " INSERT INTO $t (`id`,`prefix`,`suffix`,`fname`,`lname`,`gender`,`dob`,
`address1`,`address2`,`city`,`state`,`email`,`areacode`,
`regtime`,`ipaddress`,`offer`,`affiliate`,`subaffiliate`)
VALUE ( null,[prefix],[suffix],[fname],[lname],[gender],[dob],
[address1],[address2],[city],[state],[email],
[areacode],NOW(),[ipaddress],[offer],[affiliate],[subaffiliate])";
foreach ($data as $key => $value)
{
$value = "'".mysql_real_escape_string($value)."'";
$q = str_replace("[$key]",$value,$q );
}
mysql_query($q);
send_mail($data);
?>
Submit data and redirecting...
<script>document.location="<?=$forward_url?>"</script>
... so how would we be able to put specific values into the forwarded url location
Replacing "<?=$forward_url?>" with example
"page3.php?fname=Variable1&lname=Variable2"
so would i need to include that in the <?php> tag? and how do i break up the URL i am forwarding to?
and how would i insert variables from the above code, would it be simply [fieldname] or would i need to do .$_POST[fieldname]. or do i need to put single quotes around it? like ..
"http://ww.page.com/page.php?field1=" '.$_POST[fname].' "&field2=" '.$_POST[lname].' "
and am i doing that right?
god i feel silly askign these