Jump to content

Archived

This topic is now archived and is closed to further replies.

ifyrlucky

redirect code

Recommended Posts

when a customer goes to a specific page I want them redirected to their own page. I have set up the redirect code and created a database that has a URL address for each client. What I'm having a problem with is pulling the specific client URL from within the php redirect code. I keep on getting an error message on the page. The Code I'm using is below. How can I pull up the clients URL address under location without getting an error message?

if($HTTP_HOST=="www.napoleonp.org/ikaika/redirect.php" or $HTTP_HOST == "napoleonp.org/ikaika/redirect.php"){
header("Location: <?php echo($row_rsCWGetCustomerData["cst_weburl"]); ?>");
}?>

Share this post


Link to post
Share on other sites
this is php code already you some <? ?> you dont need that may be you problem try this

[code]
<?
if($HTTP_HOST=="www.napoleonp.org/ikaika/redirect.php" or $HTTP_HOST == "napoleonp.org/ikaika/redirect.php"){
header("Location:  echo($row_rsCWGetCustomerData[cst_weburl]); ");
}?>
[/code]
that should work

Share this post


Link to post
Share on other sites
I tried the new code without the <? ?>. I now get a Parse error: parse error, unexpected $ in /htdocs/www/ikaika/redirect.php on line 7
using

<?php require_once("application.php");?>
<?php include("CWIncLoginForm.php");?>
<?php if (isset($_SESSION["customerID"]) && $_SESSION["customerID"] != "0") { ?>
<?php
if($HTTP_HOST=="www.napoleonp.org/ikaika/redirect.php" or $HTTP_HOST == "napoleonp.org/ikaika/redirect.php"){
header("Location: echo($row_rsCWGetCustomerData[cst_weburl]); ");
}?>

Any Ideas why I'm getting this error?


[!--quoteo(post=363560:date=Apr 11 2006, 12:32 AM:name=shortj75)--][div class=\'quotetop\']QUOTE(shortj75 @ Apr 11 2006, 12:32 AM) [snapback]363560[/snapback][/div][div class=\'quotemain\'][!--quotec--]
this is php code already you some <? ?> you dont need that may be you problem try this

[code]
<?
if($HTTP_HOST=="www.napoleonp.org/ikaika/redirect.php" or $HTTP_HOST == "napoleonp.org/ikaika/redirect.php"){
header("Location:  echo($row_rsCWGetCustomerData[cst_weburl]); ");
}?>
[/code]
that should work
[/quote]

Share this post


Link to post
Share on other sites
try this [code]
header("Location: echo($row_rsCWGetCustomerData[cst_weburl])");[/code]
i see i forgot the ") at the end

Share this post


Link to post
Share on other sites
Umm, you dont need to use echo when getting value from variable to be used in a funtion. The following should work:
[code]header("Location: $row_rsCWGetCustomerData['cst_weburl']");[/code]

Share this post


Link to post
Share on other sites
I tried the new code and got the following error.

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /htdocs/www/ikaika/redirect.php on line 6

again the code used was:

<?php require_once("application.php");?>
<?php include("CWIncLoginForm.php");?>
<?php if (isset($_SESSION["customerID"]) && $_SESSION["customerID"] != "0") { ?>
<?
if($HTTP_HOST=="www.napoleonp.org/ikaika/redirect.php" or $HTTP_HOST == "napoleonp.org/ikaika/redirect.php"){
header("Location: $row_rsCWGetCustomerData['cst_weburl']");
}?>

sorry for all the problems.

quote name='wildteen88' date='Apr 11 2006, 01:43 AM' post='363577']
Umm, you dont need to use echo when getting value from variable to be used in a funtion. The following should work:
[code]header("Location: $row_rsCWGetCustomerData['cst_weburl']");[/code]
[/quote]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.