Jump to content

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

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.