473,395 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Page Redirection

41
Hello

I am working on a search page. When you type the person's
name insted of displaying a listing I want to be redirectd to
the user information.

I am getting a warninig:
Warning: cannot modify header information - headers already
sent( at start of D:\search.php: 108) in d:\search_play.php on line 242

How can suggest a way I redirect or be automatically sent to a nother
page without using header()?


[Html]

//search.php is the html form
<form action="<php echo $SERVER['PHP_SELF'];?>" method = "post"> <!--line 108-->

[/html]


[php]
<?
//search_play.php process and display results
header("Location:../user_info.php"); //line 242

?>
[/php]
Dec 3 '06 #1
3 1163
you can use ob_start(); at the beginning of the code

theres probably a cleaner way to do this thojugh
Dec 3 '06 #2
Its seems that you have a form the proceeds to another page with the information. From that you then trying to reroute to the correct page. If that is correct then no text/html should be displayed on the intermediate page. If there is any before the header(location) then it will error. Check on that. That would be the correct way to do so.

If you need a quick fix for the time being, just insert a javascript code.
[php]
echo "<script>document.location='" . $location . "';</script>";
[/PHP]
Dec 4 '06 #3
To be very clear: you cannot output anything (HTML,CSS,JavaScript) before redirection.

Therefore, move any processing of the page (error_checking, database transactions) above/before ANY output.

Use some variables and leave the output for later.

Hope that makes it clearer.
Sean
Dec 4 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Matt Adams | last post by:
A web page which exists for a couple of years under a certain address (e.g. http://www.aaa.com/bbb/ccc.html) is (should be) moved to another location (e.g....
0
by: itsharkopath | last post by:
Hi, Imagine a user in a hotspot, when he comes to the hotspot and tries to load a webpage (on the internet), he would automatically redirected to login page. I believe the following is to be...
0
by: James Wallace | last post by:
Is it possible to use forms authentication in the web.config file and FormsAuthentication.RedirectFromLoginPage with an asp page so that when the asp page is set to startup page on the project that...
4
by: Tim Marsden | last post by:
Hi, If I navigate from Page1 to Page2 then to Page3, using the response.redirect. When the user press the Back button, I what then to go to Page 1 and start again, not Page2. I dont want the...
6
by: MooreSmnith | last post by:
When I navigate to the next page using Response.Rediect("MyNextPage.aspx") current page Page_Load event is called. What I may wrongly understood is that post back will happen whenever there is any...
12
by: ACaunter | last post by:
Hi all, I was wondering how i could write some code which would automatically open the Login Page once the session has expired? -- AdamPC@hotmail.com
1
by: craigkenisston | last post by:
Hi, I recently read a lot about a topic called page hijacking. It seems that you can steal page rank from search engines while doing a redirect. I reminded I had a code in some pages, where...
2
by: Dr. Paul Caesar - CoullByte (UK) Limited | last post by:
Hi, I have created a Logout ASP.NET application using Forms Authentication. When a user logs out they get a confirmation page confirming logout and a button to click to return to the homepage....
10
by: Eric Lindsay | last post by:
This may be too far off topic, however I was looking at this page http://www.hixie.ch/advocacy/xhtml about XHTML problems by Ian Hickson. It is served as text/plain, according to Firefox...
6
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, We have two sites hosted on different servers and we have many pages on domain A which has many links(asp programs) to domain B. My question is if domain B server is in trouble, what is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.