Jump to content

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"]); ?>");
}?>
Link to comment
https://forums.phpfreaks.com/topic/7094-redirect-code/
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
Link to comment
https://forums.phpfreaks.com/topic/7094-redirect-code/#findComment-25755
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]
Link to comment
https://forums.phpfreaks.com/topic/7094-redirect-code/#findComment-25767
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]
Link to comment
https://forums.phpfreaks.com/topic/7094-redirect-code/#findComment-26104
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.