McPhersonline
Members-
Posts
15 -
Joined
-
Last visited
Never
Contact Methods
-
Website URL
http://www.mcphersonline.com
Profile Information
-
Gender
Male
-
Location
New York, NY
McPhersonline's Achievements
Newbie (1/5)
0
Reputation
-
Hi, very new to PHP and I'm trying to get email activation down. I'm trying to set the activation field in phpMyAdmin as a BOOL, so 1=activated, 0=inactive. But I'm getting... #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(1) NOT NULL DEFAULT '0'' at line 1 Before this message, I acquired a problem. On my register page, http://mcphersonline.com/aoc/register.php At some point...the users I registered to test the form stopped getting logged by the database; a successful registration would bring up the message, "You have registered successfully," but I'd check the database and that user was not registered. I'll post my register page's code, not including the form html at the bottom, of course. <?php echo "<h1>Register</h1>"; $submit = $_POST['submit']; //form data $firstname = strip_tags($_POST['firstname']); $lastname = strip_tags($_POST['lastname']); $username = strtolower(strip_tags($_POST['username'])); $password = strip_tags($_POST['password']); $repeatpassword = strip_tags($_POST['repeatpassword']); $date = date("Y-m-d"); $email = $_POST['email']; if ($submit) { $connect = mysql_connect("localhost", "p24fpt9i_boss", "mypassword"); mysql_select_db("p24fpt9i_phorum"); //select database $namecheck = mysql_query("SELECT username FROM users WHERE username='$username'"); $count = mysql_num_rows($namecheck); if ($count!=0) { die ("That username already exists. Please select a different one."); } //check for existence if ($firstname&&$lastname&&$username&&md5($password)&&repeatpassword) { //check to see if password and repeat password match if ($password==$repeatpassword) { //check char length of username and fullname if (strlen($username)>25||strlen($firstname)>25||strlen($lastname)>25) { echo "Maximum length for username is 25 characters. This rule also applies to first and last name."; } else { //check password length if (strlen($password)>25||strlen($password)<6) { echo "Password must be between 6 and 25 characters"; } else { //register the user! //encrypt password $password = md5($password); $repeatpassword = md5($repeatpassword); //generate random number for activation process $random = rand(23456789,98765432); $queryreg = mysql_query(" INSERT INTO users VALUES ('','$firstname','$lastname','$username','$password','$email','$date','$random','0',) "); echo $lastid = mysql_insert_id(); die(); //SEND ACTIVATION EMAIL $to = $email; $subject = "Activate your account!"; $headers = "From: admin@aoc"; $server = "mail.mcphersonline.com"; $body = " Hello $fullname, You need to activate yoru account with the link below: http://www.mcphersonline.com/aoc/activate.php?id=$id "; //function to send email mail($to, $subject, $body, $headers); die("You have been successfully registered! <a href='username.php'>Return to login page[/url]"); } } } else echo "Your passwords do not match!"; } else echo "Please fill in all fields!"; //close if submit } ?> Also, here is my activation page, though I doubt the problem lies here. Knowing me though, I'm probably 100% incorrect. <?php $connect = mysql_connect("localhost", "p24fpt9i_boss", "my password") or die("Couldn't connect!"); mysql_select_db("p24fpt9i_phorum") or die("Couldn't find db"); $id = $_GET['id']; $code = $_GET['code']; if ($id&&$code) { $check = mysql_query("SELECT * FROM users WHERE ID='$id' AND random='$code'"); $checknum = mysql_num_rows($check); if ($checknum==1) { //run a query to activate the account $acti = mysql_query("UPDATE users SET activated='1' WHERE id='$id'"); die("Your account is activated. You may now log in."); } else die("Invalid id or activation code."); } else die("Data missing!"); ?> I've been stuck here for a while. Please help, and thank you so much in advance.
-
I figured it out. thanks again my friend.
-
Thanks for your help, but neither of those worked.
-
Hey guys. http://mcphersonline.com/pages/extras/Photos.html So, I can't get rid of the blue lines. Here's the html: <a href=#ages1 rel=facebox > <img src='/images/photos/ages1.jpg' height='50px' width='80px' border='0'> </a> <a href=#ages2 rel=facebox> <img src='/images/photos/ages2.jpg' height='50px' width='80px' border='0'> </a> etc, same for the rest of the images. The Css is: .imglink { text-decoration: none; } .imglink a:link{ text-decoration: none; } .imglink a:active{ text-decoration: none; } .imglink a:visited{ text-decoration: none; } Anyone know what's going on?
-
I want the popup to be 565px wide. I want the scrollbox to be...say...150 px wide. In IE, the width isn't changing.
-
My commentbox works in ff but not ie http://www.mcphersonline.com/pages/bio.html <div id=bio> <img src="http://www.mcphersonline.com/images/biopics/mcpherson.png" align=left> <style> .scroller { display:block; padding:5px; margin-top:5px; height: 285px; width:1000px; overflow:scroll } </style> <div class=scroller>
-
[SOLVED] Image Border | Not so simple
McPhersonline replied to McPhersonline's topic in PHP Coding Help
Alright, the problem is fixed. Thank you for everything dude. -
[SOLVED] Image Border | Not so simple
McPhersonline replied to McPhersonline's topic in PHP Coding Help
What does 'validate it through w3' mean? -
[SOLVED] Image Border | Not so simple
McPhersonline replied to McPhersonline's topic in PHP Coding Help
I see them in your screenshots. I would post screenshots, but they'd look exactly like yours. Yes, the little hyphens at the bottom. -
[SOLVED] Image Border | Not so simple
McPhersonline replied to McPhersonline's topic in PHP Coding Help
They're not big. They're like...hyphen-sized. -
[SOLVED] Image Border | Not so simple
McPhersonline replied to McPhersonline's topic in PHP Coding Help
You don't see them in any browser? -
[SOLVED] Image Border | Not so simple
McPhersonline replied to McPhersonline's topic in PHP Coding Help
Thanks for the note. ...But yeah, the lines are still there. (In FF and IE, at least. I don't have Chrome, so I don't know 'bout that one) -
[SOLVED] Image Border | Not so simple
McPhersonline replied to McPhersonline's topic in PHP Coding Help
I made the adjustment, but it didn't fix the problem Thanks for pointing out that error though. -
[SOLVED] Image Border | Not so simple
McPhersonline replied to McPhersonline's topic in PHP Coding Help
Thanks for your help, but neither of those fixed the problem. -
My image links don't necessarily have "borders." It's more of a tiny blue line just benath/just to the right of the image. http://www.mcphersonline.com/pages/bio.html If you look at the tiny gray bar with the youtube, twitter, and facebook icons, you'll see the tiny little blue or purple lines. Either that, or they appear on image links you've already clicked. So click one, then hit back and you should see what I'm talking about. I've tried border=0