php newbie - if/then/else issue

[font=Trebuchet MS]I have a simple mail script that should direct the user to different pages on exit determined by one option chosen on the form.

$payby value can be either “PayPal” or “onarrival”

if the value is “PayPal” it should direct to “paypal.html”
if the value is “onarrival” it should direct to “thanks.html”

currently it goes to “paypal.html” regardless of which option is chosen.

(code follows)<?php

$number = $_REQUEST[‘number’] ;

$firstname = $_REQUEST[‘firstname’] ;

$lastname = $_REQUEST[‘lastname’] ;

$spousefirst = $_REQUEST[‘spousefirst’] ;

$email = $_REQUEST[‘email’] ;

$phone = $_REQUEST[‘phone’] ;

$payby = $_REQUEST[‘payby’] ;

mail( "[email protected]", “Conference Registration”,

"$firstname $lastname\n $spousefirst\n $phone - $email\n registered as $number\n intend to pay: $payby", "From: <$email>" );

if ($payby = PayPal){

header( “Location: paypal.html” );
} else {

header( “Location: thanks.html” );


ok, nevermind… got it fixed…

this is the correct line…

[font=Lucida Grande][size=13px]if ($payby == “PayPal”){[/size][/font]

Sponsor our Newsletter | Privacy Policy | Terms of Service