Jump to content

poetichotline

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

poetichotline's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thank you. I actually just took out the errors and did it manually (for each error check I simply changed it to echo) It works now! thanks For knowledge sake... do you know why it appended to the array instead of defining it?
  2. I'm still getting the strange error message of Array. It simply says Sorry. there was the following errors: Array. Note: thats not a mysql error. It's the error message generated by the code.
  3. That isn't what's giving the error. I think it does have to do with the headers not being executed in the begining... but I'm not sure how to fix that and still keep the forum working. Any ideas? or would you recommend creating an entirely different login script with different syntax?
  4. any easy way to do that? The problem I'm having currently is the cookie submission data is only in response to a correct forum filled out... so not sure how to put that first.
  5. Here is the code for my signin part of my website <? include('layout.inc'); ?> <div style="position:absolute; top:110; left:252; width:500; height:300; z-index:1;"> <?php //session_start(); ob_start(); $username = $_POST['username']; $password = $_POST['password']; $errors[] = array(); if(!$username){ $errors[] = "You did not supply a username!"; } if(!$username){ $errors[] = "You did not supply a password!"; } if(count($errors) >= 1){ echo "The following error(s) occured:<br>\n"; foreach($errors AS $error){ echo $error . "<br>\n"; } }else { $sql = "SELECT * FROM `userinfo` WHERE `username`='".$username."'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 0){ echo "The username you supplied does not exist!"; }else { $sql2 = "SELECT * FROM `userinfo` WHERE `username`='".$username."' AND `password`='".md5($password)."'"; $res2 = mysql_query($sql2) or die(mysql_error()); if(mysql_num_rows($res2) == 0){ echo "Username and password combination incorrect!"; }else { $row = mysql_fetch_assoc($res2); // we're going to set the user id // for cookies setcookie('id',$row['uid'],time()+86400); // for sessions $_SESSION['uid'] = $row['id']; header("Location: my_account.php"); } } } ob_end_flush(); ?> When I run it, I get a very unusual error. It simply displays error: message array and that's it. Any ideas what is not working? Thanks in advance for all your help.
  6. Thank you very much.... I can't believe I missed that. Guess that's why you shouldn't try to code at 2:00 am in the morning uh? lol On a side note: for some reason the }else{ statement does not carry through. There is no error message, but when I execute the page it displays the message "Thank you for registering" whether or not everything is filled in correctly, and it dosn't add the database. any idea?
  7. I made those changes as stated, and it "appeared" to work. However I am still having one minor error. The error message comes up "passwords do not match" even when they do. any ideas?
  8. I've created the following sign up script for my website. It, however, is giving me an error equal to Parse error: syntax error, unexpected T_STRING in /home/poetgos7/public_html/signupck.php on line 32. I've tried to fix it, and nothing I seem to do works. Any ideas? <?php include('layout.inc'); ?> <div style="position:absolute; top:110; left:252; width:500; height:300; z-index:1;"> <p> <? $servername= localhost; $dbusername = poetgos7_poetic; $dbpassword = poetic; $dbname = poetgos7_users; $connection = mysql_connect($servername, $dbusername, $dbpassword); $db = mysql_select_db($dbname, $connection); $name = $_POST[username]; $password = $_POST[password]; $password2 = $_POST[password2]; $email = $_POST[email]; $ip = $_POST[ip]; //if else (else if) if($name == false || $password == false || $password2 == false || $email == false){ echo "You did not fill out all the required fields. Please hit the back button and try again!"; } if ($password != password2){ echo "The passwords did not match! Please hit the back button and try again!"; }else{ $connection = mysql_connect($servername, $dbusername, $dbpassword); $db = mysql_select_db($dbname, $connection); $sql = "INSET INTO members (username, password, email, ip) VALUES ($username, $password, $email, $ip); $result = mysql_query($sql); echo "Thank you for your registration to poetichotline.org!"; } ?> </div>
×
×
  • 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.