Jump to content

White_Lily

Members
  • Posts

    531
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by White_Lily

  1. create a column in your database called "type" make this a tinyint of 1. now - normal users will be 0 and admins will 1 E.g: $query = mysql_query("SELECT type FROM users WHERE username = '$user'"); $gettype = mysql_fetch_assoc($query); if($gettype["type"] == 0{ //code for normal users }elseif($gettype["type"] == 1){ //code for admins }
  2. Try to use error reporting. create a php.ini file and inside that type: display_errors = on error_reporting = -1
  3. Dont ask - try it all out see if you can get it to work. Hint: you can't use files. You need to use a tag.
  4. hosting websites usually don't come with it, and yes php can run without php.ini - it's merely there to make life easier for the developer, and your right about the error thing - i didn't relize lol
  5. make sure you change email address variables as required as well.
  6. dont use mysql_error() create a php.ini file if there isnt one already, and enter into it: display_errors = on error_reporting = -1 That will put up every possible error in your code - PS: this probably wont work if your suppressing the errors.
  7. $message.= '<img src="images/filename.jpg" alt="name/description of image" />';
  8. 1) to keep consistency use an input type instead of a button for "continue". 2) escape some of those $_POST values. 3) don't post connection details on here 4) use error_reporting in a php.ini file. e.g: display_errors = on error_reporting = -1
  9. You could probably put all those $message variables and values inside a different file and just include there instead, make it look a bit nicer.
  10. Wait, is it those little question markes that are inside block black diamond shapes?
  11. To check if a value is present, just simply do this: if(empty($variable)){echo "The field is empty, enter a value.";}
  12. is it also set to "Primary" so that you cannot have 2 id's the same?
  13. is the id column in the database set to "Auto Increment"? if not, try some simple maths to give each user an id on registration.
  14. er... this is just a random guess since one line of code provided doesn't exactly help much; $query = mysql_query("SELECT id FROM users WHERE username = '$user'");
  15. Plus I think $_get[""] cropes up an error, suggesting you dont have any error reporting either.
  16. since you can't really have less then 0 results, try; if($variable == 0){ //failed }else{ //passed }
  17. $regPassword = sha1($regPassword); $id = uniqid(); $register = insert("members", "name, email, username, password, user_level, id, ban", "'$regName', '$email', '$regUsername', '$regPassword', 1, '$id', 0"); if($register){ $newsTitle = "New member registered!"; $cont = $regUsername." has just joined Fusion Forums!<br>"; $cont.= "Check out his/her profile:<br><br>"; $cont.= "View Profile"; $newsCont = $cont; $newMem = insert("news", "news_title, news_content, username", "'$newsTitle', '$newsCont', '$regUsername'"); if($newMem){ $to = $email; $subject = "Fusion Forums - Account Confirmation"; $message = "Hello! You have recently registered to Fusion Forum's.<br><br>"; $message.= "This is a confirmation email, below you will find your account details along with a Unique ID.<br><br>"; $message.= "In order to activate your account you must first enter the ID into the text field that follows the link at the end of this email. Your details are as follows:<br><br>"; $message.= "<table>"; $message.= "<tr>"; $message.= "<td><strong>Name:</strong></td>"; $message.= "<td></td>"; $message.= "<td>".$regName."</td>"; $message.= "<tr>"; $message.= "<tr>"; $message.= "<td><strong>Email:</strong></td>"; $message.= "<td></td>"; $message.= "<td>".$email."</td>"; $message.= "<tr>"; $message.= "<tr>"; $message.= "<td><strong>Username:</strong></td>"; $message.= "<td></td>"; $message.= "<td>".$regUsername."</td>"; $message.= "<tr>"; $message.= "<tr>"; $message.= "<td><strong>Unique ID:</strong></td>"; $message.= "<td></td>"; $message.= "<td>".$id."</td>"; $message.= "<tr>"; $message.= "</table><br><br>"; $message.= "Please follow this link in order to activate your account (opens in your default browser):<br>"; $message.= "<a href='http://www.janedealsart.co.uk/activate.php?id=".$id."'>Activate Account</a>"; $from = "noreply@janedealsart.co.uk"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers.= "From: ".$from; mail($to, $subject, $message, $headers); $done = "You have successfully registered to Fusion Fourm's.<br>"; $done.= "We have sent you an email with a confirmation code on it,"; $done.= " when you go to confirm your account you will need this code in order to be able to access the forum's."; $msg2 .= $done; }else{ $msg3 .= "Sorry, we could not register your account details, if this persists contact the webmaster. "; } }else{ $msg3 .= "Sorry, we could not register your account details, if this persists contact the webmaster. "; } That should work, it writes the users details to the database, enters some content into a news feed, then sends the user who registered an email with their details.
  18. Thank you jcbones and Christian F. That text pattern works perfectly!
  19. Okay so i managed to write a text pattern based around a few i saw, preg_match('^(?=.*\d)(?=.*\[A-Z])(?=.*\s)$', $pword) Would that work? (requires 1 digit, 1 upercase letter and no spaces).
  20. Pika was on about phrases - i assumed he meant security questions...
  21. So what your saying is have some form of security question?
  22. I am trying to get my registration form secure from a user point of view. What I want is something like a text pattern that won't let the user register unless they have at least 1 number and one capital letter within their password and their password must be at least 6 characters long and maximum of 25 characters long. I was wondering how I would go about this, and if their is a text pattern involved, how do I write them?
  23. "SELECT id, name FROM products WHERE type = 1 OR type = 2 LIMIT 2"; Try that?
  24. create a file in the main directory called "php.ini" in that file write: display_errors = on error_reporting = -1 save the file as "php.ini", upload to the server, and refresh your webpage.
  25. im guessing an insert, when the user submits the url, and a select with "LIMIT 20" on the page that the url's are displayed on.
×
×
  • 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.