Jump to content

Redirection


b2k

Recommended Posts

Hi everybody,

 

Now, I`m creating an script, but i`m using a captcha, so my problem is that if the captcha is true, so we redirect to a secure web form, see it.

 

if ( ($_REQUEST["txtCaptcha"] == $_SESSION["security_code"]) && 
    (!empty($_REQUEST["txtCaptcha"]) && !empty($_SESSION["security_code"])) ) {
  echo "<h1>Test successful!</h1>";
} else {
  echo "<h1>Error!</h1>";

 

I want redirect if the captcha is true to the form.....

 

How can i do that

Link to comment
https://forums.phpfreaks.com/topic/62751-redirection/
Share on other sites

if ( ($_REQUEST["txtCaptcha"] == $_SESSION["security_code"]) && 
    (!empty($_REQUEST["txtCaptcha"]) && !empty($_SESSION["security_code"])) ) {
  echo "<h1>Test successful!</h1>";
$time = 0;   // however long you want it to take to refresh in seconds...
function redirect($time, $link)  {

echo "<meta http-equiv=\"refresh\" content=\"{$time}; url={$link}\" /> ";

}


redirect(0, "YOUR URL GOES HERE");

} else {
  echo "<h1>Error!</h1>";
}

Link to comment
https://forums.phpfreaks.com/topic/62751-redirection/#findComment-312352
Share on other sites

Ah,  So maybe you should use a database.

 

If when a user succesfully logs in, there sesion id is added to a database.  The on every page you check the users session id against the database. If its not in there then they canot see the page.

 

Then as you increase the security, you can check it agains the users name, stored in a cookie, or in the session.

Link to comment
https://forums.phpfreaks.com/topic/62751-redirection/#findComment-312369
Share on other sites

Ah,  So maybe you should use a database.

 

If when a user succesfully logs in, there sesion id is added to a database.  The on every page you check the users session id against the database. If its not in there then they canot see the page.

 

Then as you increase the security, you can check it agains the users name, stored in a cookie, or in the session.

 

Thanks, that`s was for i looking for, but i not have any idea....maybe....the problem is that i dont have idea...

Link to comment
https://forums.phpfreaks.com/topic/62751-redirection/#findComment-312372
Share on other sites

Archived

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

×
×
  • 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.