Welcome visitor
* Login
* Register
It is currently January 18th, 2019, 10:00 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 3 posts ] 
Author Message
  form action question
PostPosted: September 8th, 2009, 8:37 pm 

Posts: 19
hi, i have a question regarding the "action" of a form. I do already have a php file but i would like to redirect to the hompage instead. Can I send the form data to the php file but redirect to the homepage of my site?


Top
 Profile  
 
  Re: form action question
PostPosted: September 8th, 2009, 11:50 pm 
User avatar

Posts: 29
You can have your PHP code process the submission of your form and, at the end (once it is done processing the info), have it redirect the browser to your home page.

You can do that by using the meta refresh tag in HTML. Example:

<meta http-equiv="refresh" content="0;url=http://www.yoursite.com">


Or the header redirect function in PHP:

<?php
header( 'Location: http://www.yoursite.com/' );
?>


Whichever approach you choose, remember to do it at the end of your "processing"code, otherwise the page will be redirected before the form is processed.

REGARDS :D

_________________
Ooh, I love your magazine. Especially the 'Enrich Your Wordpower' section. I think it's really...really... really...good.
- Homer Simpson


Top
 Profile  
 
  Re: form action question
PostPosted: September 9th, 2009, 3:32 am 
User avatar

Posts: 52
What you can do is to build your homepage in such a way that it reads the form if any was sent. So when the action is loaded, your homepage will retrieve the data from the form.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron