...

View Full Version : Help getting vars into redirect



chornbeck
03-14-2008, 04:38 PM
The query below is successful and the first round of "echoes" works fine and displays the proper data. The second echo (of $GOwnerID) and the variables I used in the header() command are not showing... Any suggestions?


$results= mssql_query($sqlquery);


$row = mssql_fetch_array($results);

echo $row['OwnerID'];
echo $row['Code'];
echo $row['FirstName'];
echo $row['LastName'];
echo $row['EmailAddress'];
echo $row['Password'];
echo $row['PhoneNumber'];
echo $row['HomeResort'];
echo $row['PointsBank'];

echo $row['OwnerID'] = $GOwnerID;
echo $row['Code'] = $GCode;
echo $row['FirstName'] = $GFirstName;
echo $row['LastName'] = $GLastName;
echo $row['EmailAddress'] = $GEmailAddress;
echo $row['Password'] = $GPassword;
echo $row['PhoneNumber'] = $GPhoneNumber;
echo $row['HomeResort'] = $GHomeResort;
echo $row['PointsBank'] = $GPointsBank;

echo $GOwnerID;

$num_rows = mssql_num_rows($results);


/*
if ($num_rows > 0) {

header( 'Location: http://www.mysite.com/os_redlogin_sesspro.php?OwnerID='.$GOwnerID.'&Code='.$GCode.'&FirstName='.$GFirstName.'&LastName='.$GLastName.'&EmailAddress='.$GEmailAddress.'&Password='.$GPassword.'&PhoneNumber='.$GPhoneNumber.'&HomeResort='.$GHomeResort.'&PointsBank='.$GPointsBank.'' ) ;

forpals
03-14-2008, 04:56 PM
Not exactly sure what you're trying to do, but why do you need to echo each variables?

Try replacing this:


echo $row['OwnerID'];
echo $row['Code'];
echo $row['FirstName'];
echo $row['LastName'];
echo $row['EmailAddress'];
echo $row['Password'];
echo $row['PhoneNumber'];
echo $row['HomeResort'];
echo $row['PointsBank'];

echo $row['OwnerID'] = $GOwnerID;
echo $row['Code'] = $GCode;
echo $row['FirstName'] = $GFirstName;
echo $row['LastName'] = $GLastName;
echo $row['EmailAddress'] = $GEmailAddress;
echo $row['Password'] = $GPassword;
echo $row['PhoneNumber'] = $GPhoneNumber;
echo $row['HomeResort'] = $GHomeResort;
echo $row['PointsBank'] = $GPointsBank;


With this:


$GOwnerID = $row['OwnerID'];
$GCode = $row['Code'];
$GFirstName = $row['FirstName'];
$GLastName = $row['LastName'];
$GEmailAddress = $row['EmailAddress'];
$GPassword = $row['Password'];
$GPhoneNumber = $row['PhoneNumber'];
$GHomeResort = $row['HomeResort'];
$GPointsBank $row['PointsBank'];


Then from this point on, you can echo any of the defined variables...
i.e.
echo $GFirstName;

Your redirect should now work with this (at quick glance)... Hopefully this is what you're looking for.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum