I was wondering if there was anything wrong w/ my script... I can't seem to find it... help?
<?
#####################################
# Copyright (c) 2003 Crosspoint #
# All rights reserved... #
# Written by Jonathan #
# webmaster@crosspoint.org #
#####################################
include 'connect.php';
if ((empty($fname)) || (empty($lname)) || (empty($phone)) || (empty($city)) || (empty($state)) || (empty($zip)) || (empty($email)) || (empty($password)) || (empty($password2)) || (empty($username))){
echo "Please enter all of the information";
include 'signup.html';
exit();
}
# Passwords
if ($password != $password2){
echo "Your passwords do not match.";
include 'signup.html';
exit();
}
# Usernames
if (ereg("([a-z,A-Z])"), $username){
echo "Please enter a valid username (all text, not letters / misc. symbols)";
include 'signup.html';
exit();
}
# First/Last Names
if ((strlen($fname) < 2) || (strlen($lname) < 2)){
echo "Please enter your full name";
include 'signup.html';
exit();
}
Thank your for signing up for our Crosspoint Youth Affiliates website. We hope you will find whatever it is that you are looking for. If you would like to see something added to the site please contact the webmaster at webmaster@crosspoint.org. In order to log in you must complete this registration. To complete the registration please click below:
(This is an automated response, if you did not sign up for this then please ignore this email.)";
if(@mail($email,$subject,$message, "From: The Crosspoint Webmaster<webmaster@crosspoint.org>"){
echo "An e-mail has been sent to the e-mail specified. Please follow instructions on how to complete your registration.";
} else {
echo "An error has occured...";
}
##########################################################
##########################################################
} else {
echo "There was an error in creating your account... Such as the same e-mail is in our database, or the same username is in our database.";
include 'signup.html';
exit();
}
?>
Nevermore
11-27-2003, 08:21 AM
What's the problem - an error, or just doesn't work? Be specific.
Jonathan
11-27-2003, 09:09 AM
Sorry...
The script never finishes... When I run it it doesn't complete it at all... you can see a working thing here:
Just flicking through, you need to get rid of the double quotes within the message variable because it was declared with them. Try that, if it doesn't work I'll try it out and debug it in more detail.
Jonathan
11-27-2003, 01:53 PM
oh my goodness... I didn't even notice that... lol... thanks. (I will test it soon, but first... TURKEY DAY! :) )
Jonathan
11-29-2003, 10:18 AM
nope.. it doesn't work...
Jonathan
11-29-2003, 10:35 AM
I have updated it... here:
<?
#####################################
# Copyright (c) 2003 Crosspoint #
# All rights reserved... #
# Written by Jonathan #
# webmaster@crosspoint.org #
#####################################
include 'connect.php';
Thank your for signing up for our Crosspoint Youth Affiliates website. We hope you will find whatever it is that you are looking for. If you would like to see something added to the site please contact the webmaster at webmaster@crosspoint.org. In order to log in you must complete this registration. To complete the registration please click below:
(This is an automated response, if you did not sign up for this then please ignore this email.)";
if(@mail($email,$subject,$message, "From: The Crosspoint Webmaster<webmaster@crosspoint.org>"){
echo "An e-mail has been sent to the e-mail specified. Please follow instructions on how to complete your registration.";
} else {
echo "An error has occured... " . mysql_error();
}
##########################################################
##########################################################
} else {
echo "There was an error in creating your account... Such as the same e-mail is in our database, or the same username is in our database.";
include 'signup.html';
exit();
}
?>
Nevermore
11-29-2003, 02:17 PM
How much of the script executes? Does it give any clues as to what is causing it to stop?
Jonathan
11-29-2003, 03:02 PM
no... I have tried everything, even just for it to show an error... it just comes up blank
dreamcatcher
11-29-2003, 07:41 PM
Hi Jonathan,
I assume this code is what is on your enter_info.php page?
The form action part of your script is missing. ie:
if ($_POST['submit']) { code here }
Try the following:
<?
#####################################
# Copyright (c) 2003 Crosspoint #
# All rights reserved... #
# Written by Jonathan #
# webmaster@crosspoint.org #
#####################################
include 'connect.php';
if ((empty($fname)) || (empty($lname)) || (empty($phone)) || (empty($city)) || (empty($state)) || (empty($zip)) || (empty($email)) || (empty($password)) || (empty($password2)) || (empty($username))){
echo "Please enter all of the information";
include 'signup.html';
exit();
}
# Passwords
if ($password != $password2){
echo "Your passwords do not match.";
include 'signup.html';
exit();
}
# Usernames
if (ereg("([a-z,A-Z])"), $username){
echo "Please enter a valid username (all text, not letters / misc. symbols)";
include 'signup.html';
exit();
}
# First/Last Names
if ((strlen($fname) < 2) || (strlen($lname) < 2)){
echo "Please enter your full name";
include 'signup.html';
exit();
}
Thank your for signing up for our Crosspoint Youth Affiliates website. We hope you will find whatever it is that you are looking for. If you would like to see something added to the site please contact the webmaster at webmaster@crosspoint.org. In order to log in you must complete this registration. To complete the registration please click below:
(This is an automated response, if you did not sign up for this then please ignore this email.)";
if(@mail($email,$subject,$message, "From: The Crosspoint Webmaster<webmaster@crosspoint.org>"){
echo "An e-mail has been sent to the e-mail specified. Please follow instructions on how to complete your registration.";
} else {
echo "An error has occured...";
}
##########################################################
##########################################################
} else {
echo "There was an error in creating your account... Such as the same e-mail is in our database, or the same username is in our database.";
include 'signup.html';
exit();
}
}
?>
Jonathan
11-29-2003, 07:48 PM
It still isn't working... the current code:<?
#####################################
# Copyright (c) 2003 Crosspoint #
# All rights reserved... #
# Written by Jonathan #
# webmaster@crosspoint.org #
#####################################
include 'connect.php';
if ((empty($fname)) || (empty($lname)) || (empty($phone)) || (empty($city)) || (empty($state)) || (empty($zip)) || (empty($email)) || (empty($password)) || (empty($password2)) || (empty($username))){
echo "Please enter all of the information";
include 'signup.html';
exit();
}
# Passwords
if ($password != $password2){
echo "Your passwords do not match.";
include 'signup.html';
exit();
}
# Usernames
if (ereg("([a-z,A-Z])"), $username){
echo "Please enter a valid username (all text, not letters / misc. symbols)";
include 'signup.html';
exit();
}
# First/Last Names
if ((strlen($fname) < 2) || (strlen($lname) < 2)){
echo "Please enter your full name";
include 'signup.html';
exit();
}
Thank your for signing up for our Crosspoint Youth Affiliates website. We hope you will find whatever it is that you are looking for. If you would like to see something added to the site please contact the webmaster at webmaster@crosspoint.org. In order to log in you must complete this registration. To complete the registration please click below:
(This is an automated response, if you did not sign up for this then please ignore this email.)";
if(@mail($email,$subject,$message, "From: The Crosspoint Webmaster<webmaster@crosspoint.org>"){
echo "An e-mail has been sent to the e-mail specified. Please follow instructions on how to complete your registration.";
} else {
echo "An error has occured...";
}
##########################################################
##########################################################
} else {
echo "There was an error in creating your account... Such as the same e-mail is in our database, or the same username is in our database.";
include 'signup.html';
exit();
}
ptell you were a help... I didn't know of all of that stuff
Nevermore
11-30-2003, 02:53 AM
Doesnone of it work, or does it fail somewhere specific?
dreamcatcher
11-30-2003, 04:03 AM
Ok, a new day, new ideas! :)
There isn`t much error checking in your .php file, so it may be something to do with part of the syntax. So, do the following:
Underneath the <? at the top of your file add:
error_reporting (E_ALL ^ E_NOTICE);
Then, change your mysql queries to:
$check_user_text = mysql_query("select * from $table_name where username='$username'") or die(mysql_error());
$check_user_in_db = mysql_num_rows($check_user_text);
$check_email_text = mysql_query("select * from $table_name where email='$email'") or die(mysql_error());
$check_email_in_db = mysql_num_rows($check_email_text);
Then access your enter_info.php in your browser and see if you see any error messages. I`m just wondering about the variables for the table name.
Jonathan
01-07-2004, 08:13 PM
Thanks for all of your help. I finally have the script running. :) I found I accidentally missed a "}" in another file :P Sorry for the long response
webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved.