Need help with redirecting in PHP
Moderator: General Moderators
Re: Need help with redirecting in PHP
Warning: Cannot modify header information - headers already sent by (output started at /home/xx/index.php:1) in /home/xx/index.php on line 2
Re: Need help with redirecting in PHP
Code: Select all
<?
if($_POST['submit'] == TRUE)
header("Location: http://google.com/");
else
echo 'not Yet!';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LOLL</title>
</head>
<body>
<form enctype="multipart/form-data" action="" method="post">
<input type="submit" name="submit" value="GO!" />
</form>
</body>As i said this works ....
now copy paste it and click GO
If it still doesnt work , then try http://www.amazon.com/PHP-5-Dummies-Jan ... 0764541668
Re: Need help with redirecting in PHP
It doesn't work. And what is it to learn here, when the most simple examples from php.net won't work?
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: Need help with redirecting in PHP
Make sure you have absolutely no white space before your PHP tags too. Including line breaks.
Re: Need help with redirecting in PHP
jayshields: No whitespaces.

If any other errors than the one I've pasted some times now, I would have noticed you about it.[/quote]What's mean? Any errors? I'm not telepath.
Re: Need help with redirecting in PHP
Ok, i don't know... attached your file this code
this file /home/xx/index.php
this file /home/xx/index.php
Re: Need help with redirecting in PHP
Upload file /home/xx/index.php in forum.
P.S. Then you click "post a reply" "Upload attachment" header
P.S. Then you click "post a reply" "Upload attachment" header
Re: Need help with redirecting in PHP
You have output information before send headers ("п»ї")
Try this
Try this
- Attachments
-
- index.rar
- (510 Bytes) Downloaded 54 times
Re: Need help with redirecting in PHP
for the below commnenct
Actually me neither i cant see a difference but i can see that there is a size differece of 8 bytes ...
what exactly did you change ?
and how come the first one was working for me....
Actually me neither i cant see a difference but i can see that there is a size differece of 8 bytes ...
what exactly did you change ?
and how come the first one was working for me....
Last edited by stevoo on Tue Aug 26, 2008 5:24 pm, edited 1 time in total.
Re: Need help with redirecting in PHP
wtf, it worked. Can you tell me exactly what you did? Because when I set the two documents next to each other - I can't see any difference. Thx alot! 
Re: Need help with redirecting in PHP
You are use UTF-8 in your file. I don't know how exactly PHP work this UTF-8 files, but better don't use it.
Re: Need help with redirecting in PHP
Okay, but which changes did you make from my version of index.php to yours?