Forum Moderators: coopster

Message Too Old, No Replies

Help with https - urgent!

         

a_angova

12:32 pm on Nov 12, 2005 (gmt 0)

10+ Year Member



Hello,

I need help with redirect from http to https when I user click on register.php and abter he completes the form I want to redirect back to http.

Can someone help me, it is an urgent case?

Best Regards, Ani

a_angova

12:42 pm on Nov 12, 2005 (gmt 0)

10+ Year Member



I use this:

$_SERVER['HTTPS']='on';
function IsLinkSecure()
{
return isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == "on");
}

if( IsLinkSecure() )
{
header("location: [mysite.com...]
}

This does the redirection :
header("location: [mysite.com...]
but when I use:
header("location: [mysite.com...]
the redirection fails :((((

a_angova

2:23 pm on Nov 12, 2005 (gmt 0)

10+ Year Member



Hello again,

I implemented this in the ssl.php file:

function secure_page()
{
if (!isset($_SERVER['HTTPS']) ¦¦ strtolower($_SERVER['HTTPS'])!= 'on' )
{
header ('Location: ['.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);...]
exit();
}
}

function insecure_page()
{
header ('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
exit();
}

the secure_page function is working fine, but when I call the insecure_page funtion to go back to http the redirection fails :(((

Anyone?

[edited by: encyclo at 2:32 pm (utc) on Nov. 12, 2005]
[edit reason] delinked url [/edit]

jatar_k

3:04 pm on Nov 12, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



what do you mean by fails?
404?

echo out your url first and see if it is getting passed/constructed properly