Hi. I'm new to PHP and am trying to use it to handle a form request on a test website I'm building. The address of the HTML form is http://swweb.frih.net/request.html and the php to handle it is below. Basically, I want the details specified in the form to be e-mailed to the supplied e-mail address. However, I'm getting a parse error on the line elseif (empty($email) || empty($tel)) || empty($rdate)) || empty($rtime)) || empty($contactname)) || empty($cusref)) {. Anyone know why? I can't see the problem, although, as I have said, I'm new to PHP so have probably done something stupid
Many thanks in advance
| Code: |
|
<? $cusref = $_REQUEST['cusref'] ; $contactname = $_REQUEST['contactname'] ; $tel = $_REQUEST['tel'] ; $email = $_REQUEST['email'] ; $rdate = $_REQUEST['rdate'] ; $rtime = $_REQUEST['rtime'] ; if (!isset($_REQUEST['email'])) { header( "Location: request.html" ); } elseif (empty($email) || empty($tel)) || empty($rdate)) || empty($rtime)) || empty($contactname)) || empty($cusref)) { ?> <html> <head><title>Error</title></head> <body> <h1>Error</h1> <p> Not all field have been filled in. Please try again. </p> </body> </html> <? } else { mail( "$email", "Collection order confirmation", "From: Phones 4 Charity" ), "Customer Reference: $cusref", "Contact Name: $contactname", "Telephone: $tel", "Requested Date: $rdate", "Requested Time: $rtime" ; header( "Location: thanks.html" ); } ?> |
Many thanks in advance
