This is a discussion on "using meta http-equiv in php" within the PHP Forum section. This forum, and the thread "using meta http-equiv in php are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
using meta http-equiv in php
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
using meta http-equiv in php
i have a registration page which is a self submitting form <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="POST"
id="test2" name="registrationform"> where in a user fill a form, after the data has been inserted to a database i would like to redirect the user to a different page. i am not able to use header(Location: filename.html) as i have echo statements before and i get a message that headers have already been sent. so due to this i am using echo (" <meta http-equiv='refresh' content='0;url=thankyou.php?firstname=$firstname'> "); this works perfectly fine. however if a user disables meta refresh which is a very small possibility the above meta tag would not execute to avoid such a situation i would like to use echo statements to create a new page which would have html tags and display a similar page to thankyou.php in my case the php code is placed in the middle of the page which displays messages that a user did not enter in the form. the page is so structured that there is some information written using html tags followed by the registration questions where the php code is present to validate. i have used echo (" <meta http-equiv='refresh' content='0;url=thankyou.php?fname=$fname'> "); redirectingthepage(); exit; i have used the above code so that even if the echo (" <meta http-equiv='refresh' content='0;url=thankyou.php?fname=$fname'> "); is not executed the redirectingthepage() function will be executed. my question is due to the structure of the page whatever text is present before the form that text is appearing again followed by the text i have inside redirectingthepage() function, i do not want this to happen. i would like what is written in redirectingthepage() function only to appear. i have defined redirectingthepage() function in a separate file and i am calling the file which has redirectingthepage() function by using include statement in the registration page. please advice how i can display what is defined in redirectingthepage() function ONLY if the refresh is disabled by the user thanks. |
|
|
|
|||
|
Re: using meta http-equiv in php
Use output buffering so that you can redirect the visitor with header("Location: filename.php");.
have a look at http://in.php.net/ob_start . Also see the "See also" list on that page.
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Last edited by RohanShenoy; Mar 9th, 2008 at 14:47. |
|
||||
|
Re: using meta http-equiv in php
Or you can put something saying: "If you are not redirected, click here." I've seen that quite a lot.
__________________
echo "Take it easy, ".$CloudedVision; .links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; } <quote>"I think it's wrong that only one company makes the game Monopoly" - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Meta Tags | Lchad | Search Engine Optimization (SEO) | 18 | Feb 25th, 2008 07:07 |
| Need help with Meta tags | EAndrews | Web Page Design | 10 | Nov 2nd, 2005 22:23 |
| How to use <meta http-equiv="refresh" for my ca | vishal | PHP Forum | 8 | Mar 18th, 2005 10:47 |