goTo yes.php or no.php

I like to make like the following.

(1) If the value of $myVariable is “yes”, then goTo(redirect) to “yes.php”
(2) If the value of $myVariable is not “yes”, then goTo(redirect) to “no.php”

The code below doesn’t work correctly, but it shows what I want.

<?php 
if ($myVariable=="yes")
{goTo yes.php}
else
{goTo no.php}
?>

How can I make what I want in PHP?

you can use header()

Off Topic:

Not sure if you know, but you can use the FPHP BB code tag to jump to a PHP function in the manual.

[noparse][fphp]header[/fphp][/noparse]

Might be handy, or useless. :wink:

Off Topic:

ok thanks :slight_smile:

no I didn’t know, but will try it next time when applicable.

actually, I’ll try it now

[FPHP]header[/FPHP]

Off Topic:

Ooh, that is awesome!