Web Tool Bag  
Home · Articles · Downloads · Discussion Forum · Web Links · News Categories · Synonyms DatabaseNovember 24 2017 14:54:45
Navigation
Home
Articles
Downloads
Discussion Forum
Web Links
News Categories
Synonyms Database
Search
Users Online
Guests Online: 1
No Members Online

Registered Members: 856
Unactivated Members: 118
Newest Member: lakim
Forum Threads
Newest Threads
Uncaught Error: _reg...
Module build failed:...
Installation
mochi script questions
Redirect with captch...
Hottest Threads
Installation [12]
Any questions and... [5]
Captcha picture d... [4]
Integrate with Vi... [4]
Mods: Sucess/Than... [4]
 
Latest Articles
PHP Fatal error: Ca...
Mouse pointer disapp...
UBUNTU install via U...
Geany tried to acces...
How to create MySql ...
View Thread
Web Tool Bag | ZDR Scripts- development and maintenance | Captcha ZDR - Questions and answers
Author Redirect with captchaZDR
mikeyks1
Member

Posts: 7
Location: Wichita Ks
Joined: 19.10.07
Posted on 21-08-2013 14:48
How can I redirect to a new webpage after submit validation? Or is there a way to return to the top of the page after submit? I have a long form and after clicking submit i have to scroll back to the top to see the thank you message.

Edited by mikeyks1 on 22-08-2013 16:30
Author RE: Redirect with captchaZDR
admin
Super Administrator



Posts: 33
Location:
Joined: 03.11.09
Posted on 28-08-2013 11:08
You have different ways to do the redirect after submit. You can add at the top of you script redirection when the captcha and the form are valid.

For example before you send any data (HTML data or headers) to the end user you can do the following:

<?php
include("class/captchaZDR.php");
$capt = new captchaZDR;

if($capt->check_result())
{
header("Location: http://www.example.com/");
}
?>

The other way is to print in the page on valid resolved captcha JavaScript redirection code.

<?php
// $_SESSION['captcha'] contain true value from captcha image, you can make COMPARISON with string entered from user. EXAMPLE:

include("class/captchaZDR.php");
$capt = new captchaZDR;

if($capt->check_result())
{
echo 'Your Input is true! :-)';
?>
<script type="text/javascript">
<!--
function redirect(){
window.location = "http://www.example.com/"
}
redirect();
//-->
</script>
<?php
}
else
{
echo 'Your Input is wrong! :-(';
}
?></b>

I hope this will help you.
Author RE: Redirect with captchaZDR
mikeyks1
Member

Posts: 7
Location: Wichita Ks
Joined: 19.10.07
Posted on 28-08-2013 14:47
Thanks that worked for me.
You Rock
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Member Poll
Which PHP framework do you preffer?

Symfony

Zend

CodeIgniter

PHP on TRAX

eZ Components

Fusebox

PhpOpenbiz

Prado

QPHP

Seagull

You must login to vote.
Shoutbox
You must login to post a message.

Vince
03/10/2011 21:17
Hi, How to remove Register from Login screen? I don't want them to register and have full access! if you leave register then they should not have any rights until the admin assigns them

webtoolz
26/09/2011 11:28
Please describe your problem with more details. Thank you.

bimmer98
22/11/2010 20:31
Help. There was a problem with the request; error regarding feedbackzdr form program

Copyright © 2017 - www.webtoolbag.com