Hello,
I have a site ...I want someone click on Submit button then he'll redirect to another page...but I am confused about code .
Please Suggest me
Thanks
AB
Hello,
I have a site ...I want someone click on Submit button then he'll redirect to another page...but I am confused about code .
Please Suggest me
Thanks
AB
Hi,
I guess there are few ways to achieve this but it depends on how you wish to do it / how complex it is.
The simplest way is to assign the <form> (which the submit button is within) to a specified action URL.
This goes like this (HTML):
change www.example.com to desired URL.Code:<form action="http://www.example.com" method="post"> <div> <!-- ...form elements, fields, labels etc... --> <input type="submit" value="Submit" /> <input type="reset" value="Reset" /> </div> </form>
What exactly do you want the form to do?
you are going to need to provide someone the code in order to help resolve this. Does the page give off a on page confirmation when there has been a successful submission?
Reverse IP Check ಠ_ಠ Proxy Sites
<?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>
This is form page Untitled Form at the bottom of this page ..their is SUBMIT button...when someone click on that ..it'll redirect to Login
Please suggest me
You did not follow the instructions that Aziz gave you. It submits to the same form because you did not specify where it should go. action= should specify where the page needs to be directed when someone clicks on the submit button.
"It's inexcusable for scientists to torture animals; let them make their experiments on journalists and politicians." -Henrik Ibsen
Hey:
I have several "submit" buttons on a form. I want users to be able to hit the "enter" key to submit the form. The page used to "post" the information checks for specifically what form button was pushed to submit the form before executing the appropriate code. I am automatically submitting the page when the enter key is hit, but it is defaulting to the first option of executed code in the post page.
![]()
For the submit buttons you can assign a different "value" for each one and then detect it in the PHP of the web page.
Then redirect the visitor to the required page before any HTML has been sent to the browser.
For example:
So in your submit buttons you have value="action1" etc. And the form initially submits back to the same page. Then the PHP code handles the redirection.PHP Code:if (isset($_POST['action'])) {
switch ($_POST['action']) {
case 'action1':
header( 'Location: http://yoursite.com/page1.php' );
break;
case 'action2':
header( 'Location: http://yoursite.com/page2.php' );
break;
}
}
Another way is to use Javascript with onClick events for each button redirecting the browser.
Hidden Hit Counter My forum signature is under construction.
Bookmarks