0

What is the problem?

<?php

/*************************************************

Member Registration Script

Author: Adam Khoury

code comments appear above sections they refer to

*************************************************/

// First we check to see if the form has been submitted

if (isset($_POST['mem_firstname'])){

//Connect to the database through our include

include_once "z_connect_to_mysql.php";

// Create local varibles from the info the user supplied in the form

$firstname = $_POST['mem_firstname'];

$lastname = $_POST['mem_lastname'];

$address1 = $_POST['mem_address1'];

$address2 = $_POST['mem_address2'];

$state = $_POST['mem_state'];

$city = $_POST['mem_city'];

$zip = $_POST['mem_zip'];

$phone = $_POST['mem_phone'];

$email = $_POST['mem_email'];

$password = $_POST['mem_password'];

// Strip slashes on the vars for security reasons

$firstname = stripslashes($firstname);

$lastname = stripslashes($lastname);

$address1 = stripslashes($address1);

$address2 = stripslashes($address2);

$state = stripslashes($state);

$city = stripslashes($city);

$zip = stripslashes($zip);

$phone = stripslashes($phone);

$email = stripslashes($email);

$password = stripslashes($password);

// Check to see if the user filled all fields with

// the "Required"(*) symbol next to them in the join form

// and print out to them what they have forgotten to put in

if((!$firstname) || (!$lastname) || (!$address1) || (!$state) || (!$city) || (!$zip) || (!$phone) || (!$email) || (!$password)){

$errorMsg = "You did not submit the following required information!<br /><br />";

if(!$firstname){

$errorMsg .= "----First Name";

}

if(!$lastname){

$errorMsg .= "----Last Name";

}

if(!$address1){

$errorMsg .= "----Address Line 1";

}

if(!$state){

$errorMsg .= "----State";

}

if(!$city){

$errorMsg .= "----City";

}

if(!$zip){

$errorMsg .= "----Zip Code";

}

if(!$phone){

$errorMsg .= "----Phone Number";

}

if(!$email){

$errorMsg .= "----Email Address";

}

if(!$password){

$errorMsg .= "----Password";

}

// Here we include our join form file in its entirety and

// place our error message to display in it this time too

include_once "z_join_form.php";

// Then stop this script from executing any more further down

exit();

}

// Database Email duplication Check

$sql_email_check = mysql_query("SELECT email FROM myMembers WHERE email='$email'");

$email_check = mysql_num_rows($sql_email_check);

if ($email_check > 0){

$errorMsg = "<u>ERROR:</u><br />

Your Email address is already in use inside our system. Please use another.";

// Here we include our join form file in its entirety and

// place our error message to display in it this time too

include_once "z_join_form.php";

// Then stop this script from executing any more further down

exit();

} else {

// Add user info into the database table, claim your fields then values

$sql = mysql_query("INSERT INTO myMembers (firstname, lastname, address1, address2, state, city, zip, phone, email, password, sign_up_date)

VALUES('$firstname','$lastname','$address1','$address2','$state',

'$city','$zip','$phone','$email','$password', now())")

or die (mysql_error());

// Get the inserted ID here to use in the activation email

$id = mysql_insert_id();

// Create directory(folder) to hold each user files(pics, MP3s, etc.)

mkdir("z_memberFiles/$id", 0755);

// Start assembly of Email Member the activation link

$to = "$email";

// Change this to your site admin email

$from = "mike@ironrevolution.com";

$subject = "Complete your registration";

//Begin HTML Email Message where you need to change the activation URL inside

$message = <<<EOF

<html>

<body bgcolor="#FFFFFF">

Hi $firstname,

<br /><br />

You must complete this step to activate your account with us.

<br /><br />

Please click here to activate now &gt;&gt;<a href="http://www.ironrevolution.com/z_activation.php?id=$id&password=$password">

ACTIVATE NOW</a>

<br /><br />

Your Login Data is as follows:

<br /><br />

E-mail Address: $email <br />

Password: $password

<br /><br />

Thanks!

The Team at Somewebsite

</body>

</html>

EOF;

// end of message

$headers = "From: $from\r\n";

$headers .= "Content-type: text/html\r\n";

$to = "$to";

// Finally send the activation email to the member

mail($to, $subject, $message, $headers);

// Then print a message to the browser for the joiner

print "<br /><br /><br /><h4>OK $firstname, one last step to verify your email identity:</h4><br />

We just sent an Activation link to your email address.<br /><br />

<strong><font color=\"#990000\">Please check your email inbox in a moment</font></strong> to click on the Activation <br />

Link inside the message. After email activation you can log in.<br />

<br />You can now please close the browser down, c u later. ";

} // Close else after email duplication check

} //Close if $_POST

?>

I can't find the problem.
It is on line 133.

4
Contributors
10
Replies
11
Views
7 Years
Discussion Span
Last Post by FlashCreations
0

Unless we have all the external include files and run this locally we have no way to know what you're talking about. Give us the error message you receive or explain what's not working. Be specific when asking for help.

0

Error:
Parse error: syntax error, unexpected $end in /homepages/10/d290339220/htdocs/z_register_parse.php on line 133

0

my guess is you don't have a close php tag in your z_join_form.php

post the code from that file.

0

Assuming the file you posted is called z_register_parse.php, I would guess that the error is inside z_join_form.php. It's probably a missing PHP end tag ?> , but it could also be a missing bracket or other non-terminated statement. Post your code for this file and we can tell you the exact problem.

0
echo "Assuming the file you posted is called z_register_parse.php, I would guess that the error is inside z_join_form.php. It's probably a missing PHP end tag ?> , but it could also be a missing bracket or other non-terminated statement. Post your code for this file and we can tell you the exact problem.";

Now there is...sorry about that!

0

I couldn't resist. :D
Now that I think about it, that was a pretty nerdy PHP joke, but oh well. :)

Edited by FlashCreations: n/a

0

I was thinking along the same lines when I posted it. it was even funnier that you did it too

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.