Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

http headers

Posted on 2000-03-28
4
238 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

856 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