White_Lily
Members-
Posts
531 -
Joined
-
Last visited
-
Days Won
1
Everything posted by White_Lily
-
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 }
- 23 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
Try to use error reporting. create a php.ini file and inside that type: display_errors = on error_reporting = -1
-
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.
-
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
-
make sure you change email address variables as required as well.
-
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.
-
$message.= '<img src="images/filename.jpg" alt="name/description of image" />';
-
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
-
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.
-
Wait, is it those little question markes that are inside block black diamond shapes?
-
To check if a value is present, just simply do this: if(empty($variable)){echo "The field is empty, enter a value.";}
-
is it also set to "Primary" so that you cannot have 2 id's the same?
-
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.
-
Plus I think $_get[""] cropes up an error, suggesting you dont have any error reporting either.
-
since you can't really have less then 0 results, try; if($variable == 0){ //failed }else{ //passed }
-
$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.
-
Thank you jcbones and Christian F. That text pattern works perfectly!
-
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).
-
Pika was on about phrases - i assumed he meant security questions...
-
So what your saying is have some form of security question?
-
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?
-
"SELECT id, name FROM products WHERE type = 1 OR type = 2 LIMIT 2"; Try that?
-
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.
-
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.