Jump to content

tebrown

Members
  • Posts

    114
  • Joined

  • Last visited

Everything posted by tebrown

  1. Ah ok then thanks for that. I pretty much just need a form that i will be able to select multiple players from a list then send them a sms. Dont really need the account balance etc...
  2. Ah ok then, its just that ive never really used API's before and not sure how to go about installing them into my own php etc...
  3. I dont think where im from (New Zealand) has it... So i would have to go with a gateway. Would the gateway be like an API that i would add to my site or something?
  4. The project that i am working on will allow the manager to send messages to his squad members (15 or so players) from some kind of form. If this is the case will i have to use a gateway?
  5. Hey guys im looking at doing a project that involves sending SMS(Text Message) from an online website. Im just wondering how hard it is to setup using php? For example: If i have registered user (manager) and i want to send a SMS to my team mates from the website itself, how hard would this be?
  6. Sweet, yup i ended up getting it to work. Just had to play around with a few things. Cheers
  7. Hmm ok... Where would the error message code "You are not activated yet" go?
  8. What about the user level activation that i mentioned above ^ Cheers.
  9. Ok i've given it another go. Although this code below still doesn't work properly. When i log in and enter a correct email and password, it still shows "You have successfully logged in", it should be saying the error message: "You have not been activated yet!". I must be nearly there.... <?php session_start(); include"database.php"; ?> <html> <head> <title>Login</title> </head> <body> <h1>Manager Login</h1> <form action="login.php" method="post"> <TABLE BORDER="0"> <TR> <TD>Email:</TD> <TD> <input type="text" name="email" size="20"> </TD> </TR> <TR> <TD>Password:</TD> <TD><INPUT TYPE="password" NAME="password" SIZE="20"></TD> </TR> </table> <P> <input type="submit" name="login" value="Login" /> </form> <?php if (isset($_POST['login'])) { if (empty($_POST['email']) || empty($_POST['password'])) { echo "Please fill out all fields."; } else { $email=mysql_real_escape_string($_POST['email']); $password=mysql_real_escape_string($_POST['password']); $sql="SELECT * FROM users WHERE email='$email' and password='".md5($password)."'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if ($count['level'] == '0'){ echo "You have not been activated yet!"; } if($count==1){ //session_register("email"); //session_register("password"); echo "You have successfully logged in!"; } else { echo "Wrong Email or Password"; } } } ?>
  10. Hey Guys, Im trying to work on my login script after successfully doing my register script. The problem im having trouble is that when i login with false details, it still prompts me with 'You have logged in". Also if the user is not activated it should say "Account has not been activated." Could someone help me out. Thanks. <?php include"database.php";?> <html> <head> <title>Login</title> </head> <body> <h1>Manager Login</h1> <form action="login.php" method="post"> <TABLE BORDER="0"> <TR> <TD>Email:</TD> <TD> <input type="text" name="email" size="20"> </TD> </TR> <TR> <TD>Password:</TD> <TD><INPUT TYPE="password" NAME="password" SIZE="20"></TD> </TR> </table> <P> <input type="submit" name="login" value="Login" /> </form> <?php session_start(); if (isset($_POST['login'])) { if (empty($_POST['email']) || empty($_POST['password'])) { $errors[] = "Please fill out all fields."; } $email = $_POST['email']; $password = $_POST['password']; $level = 'level'; $check = mysql_query("SELECT * FROM users WHERE email='".$email."' AND password='".$password."'"); if (mysql_num_rows($check)>=1) { $errors[] = "Wrong Details. Try Again."; } $check = mysql_query("SELECT * FROM users WHERE level='".$level."'"); if (mysql_num_rows($check)>=1) { if ($level == '0') { $errors[] = "Account has not been activated."; }} if (empty($errors)) { echo "You have logged in!"; } else { foreach($errors as $nErrors){ echo $nErrors . "<br>"; } } } ?>
  11. Thankyou, that works fine.!!
  12. Thanks for the reply. Ok i did that, although how do i make it so that the dropdown first value is default.... (so its like a field with nothing in it and they must pick a option for it to be active) ?? The attachment below shows that when i press submit with everything not touched its shows these two errors:
  13. Sorry about the above code. Here it is: <?php include"database.php";?> <html> <head> <title>Register</title> </head> <body> <h1>Register</h1> <form name="register" action="register.php" method="post"> Email: <input type="text" name="email"><br> Password: <input type="password" name="password"><br> Club: <select name="club"> <option value="">Select...</option> <option value="npob">Old Boys</option> <option value="tukupa">Tukupa</option> <option value="coastal">Coastal</option> <option value="inglewood">Inglewood</option> <option value="clifton">Clifton</option> <option value="stratford">Stratford</option> <option value="hawera">Hawera</option> </select><br> <input type='submit' name='submit' value='Submit'> </form> <?php if (isset($_POST['submit'])) { if (empty($_POST['email']) && empty($_POST['password']) && empty($_POST['club'])) { $errors[] = "Please fill out all fields."; } $email = addslashes(strip_tags($_POST['email'])); $password = addslashes(strip_tags($_POST['password'])); $club = addslashes(strip_tags($_POST['club'])); if (!empty($email)) { if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $errors[] = "This email address is not valid."; } } if (!empty($password)){ if (strlen($password)>25 || strlen($password)<6) { $errors[] = "Password must be betwen 6 and 25 characters.<br>"; } } if (!empty($club)){ $errors[] = "Please select a Club.<br>"; } $check = mysql_query("SELECT * FROM users WHERE email='".$email."'"); if (mysql_num_rows($check)>=1) { $errors[] = "Email is already taken!"; } $check = mysql_query("SELECT * FROM users WHERE club='".$club."'"); if (mysql_num_rows($check)>=1) { $errors[] = "Sorry this club has already been registered with the NZRU."; } if (empty($errors)) { $register = mysql_query("INSERT INTO users (email, password, club, level) VALUES ('".$email."', '".md5($password)."', '".$club."', '')"); echo "You have succesfully registered!"; } else { foreach($errors as $nErrors){ echo $nErrors . "<br>"; } } } ?>
  14. Ok so im working on this register script and trying to implement a select value field along with a email field and password field. At the moment i have given it my best shot and typed in most of the code, although im still not satisfied with the outcome. For example: When i type in a correct email with a legit password, and i DONT select one of the drop down options, i want it to say the error: "Please type in all fields.". This would be vise versa for each other field also! If the user again types in a legit email and password, and selects a value from the dropdown menu, but is already registered in the database, i would want another error message saying: "This club has already been registered to the database". I given it my best shot but simply not getting the above result. <?php include"database.php";?> <html> <head> <title>Register</title> </head> <body> <h1>Register</h1> <form name="register" action="register.php" method="post"> Email: <input type="text" name="email"><br> Password: <input type="password" name="password"><br> Club: <select name="club"> <option value="">Select...</option> <option value="npob">Old Boys</option> <option value="tukupa">Tukupa</option> <option value="coastal">Coastal</option> <option value="inglewood">Inglewood</option> <option value="clifton">Clifton</option> <option value="stratford">Stratford</option> <option value="hawera">Hawera</option> </select><br> <input type='submit' name='submit' value='Submit'> </form> <?php if (isset($_POST['submit'])) { if (empty($_POST['email']) && empty($_POST['password']) && empty($_POST['club'])) { $errors[] = "Please fill out all fields."; } $email = addslashes(strip_tags($_POST['email'])); $password = addslashes(strip_tags($_POST['password'])); $club = addslashes(strip_tags($_POST['club'])); if (!empty($email)) { if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $errors[] = "This email address is not valid."; } } if (!empty($password)){ if (strlen($password)>25 || strlen($password)<6) { $errors[] = "Password must be betwen 6 and 25 characters.<br>"; } } if (!empty($club)){ $errors[] = "Please select a Club.<br>"; } $check = mysql_query("SELECT * FROM users WHERE email='".$email."'"); if (mysql_num_rows($check)>=1) { $errors[] = "Email is already taken!"; } $check = mysql_query("SELECT * FROM users WHERE club='".$club."'"); if (mysql_num_rows($check)>=1) { $errors[] = "Sorry this club has already been registered with the NZRU."; } if (empty($errors)) { $register = mysql_query("INSERT INTO users (email, password, club, level) VALUES ('".$email."', '".md5($password)."', '".$club."', '')"); echo "You have succesfully registered!"; } else { foreach($errors as $nErrors){ echo $nErrors . "<br>"; } } } ?> Thankyou.
×
×
  • 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.