using meta http-equiv in php

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.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 9th, 2008, 12:37
Junior Member
Join Date: Dec 2007
Location: auckland
Age: 33
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 9th, 2008, 14:29
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 9th, 2008, 17:20
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,255
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
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.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 02:01.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42