Jump to content

[SOLVED] if , if , if else else why do you hate me


guymclaren

Recommended Posts

I used to code ASP and PHP is doing my head in. I cannot see the problem here but it must exist

<?php
$coid = $_COOKIE["affiliate"];
if ($coid == NULL) {
$myid = $_GET['aff'];
			if ($myid != NULL){
				setcookie("affiliate","$myid");
		}	else {
				setcookie("affiliate","MCL01");
			header('Location:http://webtech.co.za/website.php'); 
} 
if ($coid != NULL) {
$aff = $coid;
$name = $_GET['name'];
	if ($name != NULL) {
	  $company = $_GET['company'];
		$domain = $_GET['domain'];
		$type = $_GET['type'];
		$address = $_GET['address'];
		$postal = $_GET['postal'];
		$tel = $_GET['tel'];
		$cell = $_GET['cell'];
		$fax = $_GET['fax'];
		$email = $_GET['email'];
		$pay = $_GET['payment'];

		/* INSERT INTO DATABASE
			 SEND CONFIRMATION EMAIL TO CLIENT


		*/
		echo "Dear $name<br /><br /> Thank you for your order. Due to high levels of spam and in order to confirm your email address we have sent you a confirmation link to the email address you have given us. You will need to visit the link to finalise this transaction and receive payment details. <br /><br />Once we have received your confirmation, signed debit order and proof of payment we will reserve your domain name and install your website within 3 - 4 days.";

	}	else {		


?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Website order page</title>
</head>
<body><div align="center"><table summary="" width="770">
<tr>
<td>
<h1>Buy Now</h1>

<FORM NAME="order" METHOD=POST ACTION="order.php">
<table summary="" width="770">

<tr><td>Domain Name required</td><td><input type="text" name="domain" /></td></tr>

<tr><td colspan="2"> <input type="submit" name="Submit Order" value="Order"></td></tr>
</table>
</form>
</div>
<?php 
} /* line 98 */
?>

 

 

Parse error: syntax error, unexpected $end in /var/www/vhosts/webtech.co.za/httpdocs/order.php on line 98 is my result

Why would it need an else at the end of a script? That sounds illogical to me.

 

basically I have

if cookie aff is null then 
    check if theres an aff link
     if there is make cookie with aff link
     or else
     make cookie with house link
/* up to here it works. I know thats been tested.
         If there is a name then
                 go to database and add (still to code)
                  echo message about confirmation
           else 
                open form

 

if my logic is faulty please tell me why?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.