Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

http headers

Posted on 2000-03-28
4
Medium Priority
?
262 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 8 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

824 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