Solved

http headers

Posted on 2000-03-28
4
235 Views
Last Modified: 2008-03-06
hi...
this code will raise an error:

<?
echo ("hellow");
header("location:http://www.cnn.com")
?>

because information was already sent to browser.
how can i solved this problem (except of delete the echo "hellow")...
im used to ASP and there i can insert the :
response.buffer=true
i can control the output...
is there something like this in php?

elad
0
Comment
Question by:eladr
4 Comments
 
LVL 2

Expert Comment

by:gravity
ID: 2665218
Wait until PHP version four is released properly, as opposed to a beta version.

Currently there is *no* way of implementing what you're after.
0
 
LVL 8

Expert Comment

by:us111
ID: 2668142
Answered........

but if you have no code (php or html) behind
the header function you could include a file.
Replace header("location:http://www.cnn.com")
by
include("http://www.cnn.com")

In that case, you can write some text before
0
 

Expert Comment

by:mrvithan
ID: 2668699
Well... If i were you, I would used Javascript to do. Try to use 'window.open("www.cnn.com","_self");'
It get a some effect. But it mightn't what you want!!! :-)

0
 
LVL 2

Accepted Solution

by:
maxkir earned 2 total points
ID: 2672804
mrvithan is close to solution, IMO.
My two cents to your two points ;-) :

<?
echo "aaa";
?>
<SCRIPT language="Javascript">
document.location.href='http://www.cnn.com';
</SCRIPT>
<?
exit;
?>
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
designing in object programming 12 76
write screen output to text file 21 47
How can I make this form submit to itself? 10 27
PHP not parsing ' character 12 39
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question