iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old March 9th, 2008, 09:37 AM   #1
New Member
 

Join Date: Dec 2007
Location: auckland
Age: 34
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 sudhakararaog is on a distinguished road
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.
sudhakararaog is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old March 9th, 2008, 11:29 AM   #2
Reputable Member
 

Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 RohanShenoy is on a distinguished road
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 edited by RohanShenoy; March 9th, 2008 at 11:47 AM..
RohanShenoy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old March 9th, 2008, 02:20 PM   #3
Most Reputable Member
 

Join Date: Feb 2008
Location: In My Own Little World
Age: 15
Posts: 1,346
Blog Entries: 9
Thanks: 2
Thanked 45 Times in 45 Posts
Rep Altering Power: 0 CloudedVision is on a distinguished road
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.
__________________
Theron Luhn
CloudedVision is offline  
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

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 February 25th, 2008 03:07 AM
Need help with Meta tags EAndrews HTML, XHTML and CSS 10 November 2nd, 2005 06:23 PM
How to use <meta http-equiv="refresh" for my ca vishal PHP 8 March 18th, 2005 06:47 AM


Search Engine Optimization by vBSEO 3.2.0 RC8