Page 2 of 3

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 4:37 pm
by JKM
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

Posted: Tue Aug 26, 2008 4:43 pm
by stevoo

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

Posted: Tue Aug 26, 2008 4:48 pm
by JKM
It doesn't work. And what is it to learn here, when the most simple examples from php.net won't work?

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 4:51 pm
by jayshields
Make sure you have absolutely no white space before your PHP tags too. Including line breaks.

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 4:53 pm
by Ziq
deleted

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 4:57 pm
by JKM
jayshields: No whitespaces.
What's mean? Any errors? I'm not telepath.
If any other errors than the one I've pasted some times now, I would have noticed you about it.[/quote] ;-)

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 4:59 pm
by Ziq
Ok, i don't know... attached your file this code

this file /home/xx/index.php

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 5:01 pm
by JKM
...?

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 5:06 pm
by Ziq
Upload file /home/xx/index.php in forum.

P.S. Then you click "post a reply" "Upload attachment" header

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 5:08 pm
by JKM
index.rar
(519 Bytes) Downloaded 35 times

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 5:12 pm
by Ziq
You have output information before send headers ("п»ї")

Try this

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 5:15 pm
by stevoo
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....

Re: Need help with redirecting in PHP

Posted: Tue Aug 26, 2008 5:23 pm
by JKM
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

Posted: Tue Aug 26, 2008 5:28 pm
by Ziq
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

Posted: Tue Aug 26, 2008 5:52 pm
by JKM
Okay, but which changes did you make from my version of index.php to yours?