go to URL

Hi all,

I am new to php but realy loving it . I would like my code to tell the
browser to load a new page at a given URL. In java you could create a
variable of type URL.

It should work something like this.

if (correct)
getURL(http://www.youarecorrect.com); //I want this line, if executed, to
open the given web page.
else
echo "Incorrect";

How could I do this in php?

Thanks
(had to dump java because pop up blockers in ie complains about it)
Java Buai [ So, 18 Juni 2006 06:58 ] [ ID #1360139 ]

Re: go to URL

Java Buai wrote:

As this has nothing to do with SQL, I added alt.php as newsgroup and set
follow-up to alt.php too.


> I am new to php but realy loving it . I would like my code to tell the
> browser to load a new page at a given URL. In java you could create a
> variable of type URL.
>
> It should work something like this.
>
> if (correct)
> getURL(http://www.youarecorrect.com); //I want this line, if executed, to
> open the given web page.
> else
> echo "Incorrect";
>
> How could I do this in php?

<?PHP
if($correct) {
header("Location: http://www.example.com/");
exit;
}
/* put what you want to do if not correct under here */
?>


> (had to dump java because pop up blockers in ie complains about it)

I suggest you dump it too and get a proper browser.



//Aho
Shion [ So, 18 Juni 2006 11:54 ] [ ID #1360141 ]
PHP » alt.php.sql » go to URL

Vorheriges Thema: want rows in 2nd (joined) table listed as columns with 1st
Nächstes Thema: Damage Control: When 1 of 2+ Interdependent mySQL Queries Fail...