Web Tool Bag  
Home · Articles · Downloads · Discussion Forum · Web Links · News Categories · Synonyms DatabaseMarch 19 2024 06:56:42
Navigation
Home
Articles
Downloads
Discussion Forum
Web Links
News Categories
Synonyms Database
Search
Users Online
Guests Online: 2
No Members Online

Registered Members: 856
Unactivated Members: 118
Newest Member: lakim
Forum Threads
Newest Threads
Error: Cannot find m...
Uncaught Error: _reg...
Module build failed:...
Installation
mochi script questions
Hottest Threads
Installation [12]
Any questions and... [5]
Captcha picture d... [4]
Integrate with Vi... [4]
Mods: Sucess/Than... [4]
 
Latest Articles
Ubuntu: the vpn conn...
Howto Install HP Pri...
ReactJS progress met...
react-show-more-text
react-collapsible-co...
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 11: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 13:30
Author RE: Redirect with captchaZDR
admin
Super Administrator



Posts: 33
Location:
Joined: 03.11.09
Posted on 28-08-2013 08: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 11: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 18: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 08:28
Please describe your problem with more details. Thank you.

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

Custom web software development by Devzone Tech
Copyright © 2024 - www.webtoolbag.com