It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

Submit Button

Submit Button

Postby jberry on Fri Apr 06, 2007 7:01 pm

I have a form on my page and you can enter info and then hit submit and it goes into my database. But the question is how can I make the button do 2 things I want it also to go back to the homepage after the button is pressed. So it submits the data and returns to hompepage here is the site. if anyone has an ideas the would be great.
http://www.snscasinotours.com/contact2.php
jberry
100+ Club
 
Posts: 144
Joined: Mon Mar 19, 2007 4:40 pm
Location: Atlantic City, NJ

Postby webmaster on Fri Apr 06, 2007 8:40 pm

There are 3 ways that I can think of now.

1. Set the action="" in the form to the frontpage, add the database-intert in the top of the code on your index.

2. On the page that does the database-insert. Use a PHP redirect (you can not print out any HTML info before you run this script):
Code: Select all
$to = "index.php";
header("Location: $to");
exit;


3. On the page that does the database-insert. Use a meta-redirect. Just put this in the <head></head> (the number is the amound of seconds before redirecting):
Code: Select all
<meta http-equiv="refresh" content="2;url=index.php">


Good luck!
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby jberry on Fri Apr 06, 2007 8:47 pm

in the 3 one can the number be replace with something like when button pushed I don't know the syntax but insted of a time on a command
jberry
100+ Club
 
Posts: 144
Joined: Mon Mar 19, 2007 4:40 pm
Location: Atlantic City, NJ


Who is online

Users browsing this forum: No registered users and 2 guests