I am using a little jump script that redirects to a particular site based on the variable.
For example:
http://www.mydomain.com/courses/jump.php?o=golfcourse1
Would redirect to:
http://www.newdomainname.com/index.jsp? ... orreyPines
I can get this working fine. But here is where I am stuck...
I'm trying to add additional info to the URL so that it looks like: http://www.domainname.com/index.jsp?Cou ... =MyCookie2
Here is the error I am receiving on the jump page:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/golf/public_html/golf/courses/jump.php on line 4
Here is the Jump page source code associated with the error message:
<?PHP
$m = $_GET['o'];
if ($m == "") {$link = "www.domainname.com";} // Default Blank
if ($m == "golfcourse1") {$link = "http://www.domainname.com/index.jsp?pag ... emp1=<?php echo ($_COOKIE["MyCookie"]) ?>&temp2=<?php echo ($_COOKIE["MyCookie2"]) ?>";}
header("Location: $link");
exit();
?>
Thanks in advance!
PHP | Passing Variables to URL
Moderator: General Moderators
Re: PHP | Passing Variables to URL
You have two extra sets of php start and end tags in there.
Code: Select all
<?PHP
$m = $_GET['o'];
if ($m == "") {
$link = "www.domainname.com";
} // Default Blank
if ($m == "golfcourse1") {
$link = "http://www.domainname.com/index.jsp?pageName=Info&temp1=" . $_COOKIE["MyCookie"] . "&temp2=" . $_COOKIE["MyCookie2"] ;
}
header("Location: " . $link);
exit();
?>Re: PHP | Passing Variables to URL
Thanks Reviresco! That did the trick.