Forums

PHP

This topic is locked

Page redirection...

Posted 20 Dec 2006 14:07:33
1
has voted
20 Dec 2006 14:07:33 dan mit posted:
Ok so I have this problem for ages and I gave up trying to mess around making this site I making for a while, but decided to give it another go..
I’m using dreamweaver to generate the code because I don’t really no much about it and I just really want to play around with it. I get the error when I generate a form that offers a page redirect option.
So the initial problem is that I get this error:

Warning: Cannot modify header information - headers already sent by (output started at W:\www\test_add.php:1) in W:\www\test_add.php on line 51

I know that a lot of people just say look for an empty character space before and after the <?php and ?> but there is nothing I have gone over it hundreds of times, recreated the page and tried again and there’s nothing.

So the area of code it refers to is:


$insertGoTo = "/test.php ";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

and the first line is:

<?php virtual('/Connections/test_01.php'); ?>

So what I need is a fix for this of some other method of making it redirect. I read someone using javascript but I couldn't make what they said to do work.
If anyone can help it would be fantastic.

Cheers Dan

Replies

Replied 21 Dec 2006 11:42:41
21 Dec 2006 11:42:41 Roddy Dairion replied:
Send your php file over to my email address all the ones related to it.

Reply to this topic