Forum Moderators: coopster

Message Too Old, No Replies

Redirection dependant on select variable

then change the name varible before sending.

         

5x54u

9:20 pm on Jun 24, 2005 (gmt 0)

10+ Year Member



I am trying to pass form variables that redirect to a new site but the differing sites have different name variables and I want to reconfigure depending upon location selected and then change the name varible before sending.

Here is what I have so far but it is not working. Thank you in advance.


<?
$ID = $_POST['UserID'] ;
$password = $_POST['UserPswd'] ;
$location = $_POST['select'] ;

if ( isset ($_POST['select']) && $_POST['select'] == 'https://www.XXXXXXXX.com/webApp/TEScreener3/700credit/index.jsp' )
header( "Location: $location?client=infocredit&user=$ID&password=$password" );

elseif ( isset ($_POST['select']) && $_POST['select'] == 'https://www.XXXX.com' )
header( "Location: $location?ACCOUNT=$ID&PSSWD=$password" );

elseif ( isset ($_POST['select']) && $_POST['select'] == 'https://www.XX.com' )
header( "Location: $location?UserID=$ID&UserPswd=$password" );

elseif ( isset ($_POST['select']) && $_POST['select'] == 'https://www.X.com' )
header( "Location: $location?user=$ID&password=$password" );

elseif ( isset ($_POST['select']) && $_POST['select'] == 'https://www.xs.com/screeningone/default.asp' )
header( "Location: $location?UserID=$ID&UserPswd=$password" );

?>

Burner

2:14 am on Jun 25, 2005 (gmt 0)

10+ Year Member



Part of your headache may be passing a url as a variable. Without knowing more about your code, would it be possible to pass a location id and then forward to your new url?

ie


if (( isset ($_POST['select'])) && ($_POST['select'] == '<YOUR_LOCATION_ID>' )) {
header( "Location: [XXXXXXXX.com...] );
die();}

Burner

5x54u

5:03 am on Jun 25, 2005 (gmt 0)

10+ Year Member



This did it:


<?
$ID = $_POST['UserID'] ;
$password = $_POST['UserPswd'] ;
$location = $_POST['select'] ;

if ($location == "https://www.#*$!x.com/webApp/TEScreener3/700credit/index.jsp")
header( "Location: $location?client=infocredit&user=$ID&password=$password" );

elseif ($location == "https://www.x.com")
header( "Location: $location?ACCOUNT=$ID&PSSWD=$password" );

elseif ($location == "https://www.xxxxx.com")
header( "Location: $location?UserID=$ID&UserPswd=$password" );

elseif ($location == "https://www.xx.com")
header( "Location: $location?user=$ID&password=$password" );

elseif ($location == "https://www.xx.com/screeningone/default.asp")
header( "Location: $location?UserID=$ID&UserPswd=$password" );

?>