Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

mdpdesigns

Members
  • Joined

  • Last visited

  1. Got it working... thanks for the help
  2. Hey I am wondering if anyone knows how you can add session information into a database. So far I have a session started when a user logs in and from there I have a page set up so they can add additional information such as their real name / email etc... What I want to happen is when a user fills in these boxes the info is sent to the same row? where their username / password is. like this... userid|Username|Password|NAME|EMAIL | 1 |matt123 | passkey |matt |matt@.com| <------ all the session data to be added and stored in a table on the same line. So far i have an input form but it sends the info to the next userid. my userinput code so far is. <?php //check to see if user is logged in session_start(); //Connecting to MySQL $con = mysql_connect("localhost","root","root"); if(!$con){ echo "Error connecting to MySQL"; } //Connecting to Database $db = mysql_select_db("search_site",$con); if(!$db){ echo "Error connecting to Database"; } if(!isset($_SESSION['user'])) { echo "please log in to see this page"; } else{ echo $_SESSION['user'] . " is logged in<br />"; echo '<form action="userinfo.php" method="post"> Name: <input type="text" name="realname"><br /> E-mail: <input type="text" name="email"><br /> <input type="submit" value="send"> </form>'; } $input = true; if ( ($_POST["realname"] == "") || ($_POST["email"] == "") ) { $input = false; } $realname = $_POST["realname"]; $email = $_POST["email"]; if (!$input) { echo('You need to put a Username and Password'); } else { mysql_query("INSERT INTO user (name, email) VALUES ('$realname', '$email')"); echo "Welcome " . $realname; } ?> I would greatly appreciate any help Thanks Matt Also here is some info where i defined the session data earlier this works ok: $username = $_POST["username"]; $_SESSION['user']= $username;
  3. WOO!! Thanks again
  4. Thanks I will check that out. I have stumbled across another problem. I am trying to add to the code so you need to type somethign in both the username and password input boxes for it to send i currently have thisscript... $username = $_POST["username"]; $password = md5($_POST["password"]); //Adding the username and password to the database if($username == "" || $password == ""){ echo "You need to input something"; } else{ mysql_query("INSERT INTO user (username, password) VALUES ('$username', '$password')"); } The problem here is there is always a password as I am using md5 and even if the user has put nothing in the box the $password still has a value. Am wondering if there is anyway around this? Thanks again
  5. Hey, I have got it working now I was being stupid and had a limit of 30 chars in the sql database for password DUH!!! Sorry about that but thanks a lot for the help
  6. Is still not working still coming up with this. 0 user not found Your name is admin Your password is 21232f297a57a5a743894a0e4a801fc3 I have just SELECTED the stored admin username and md5 password in the database and it seems to be 2 chararacters shorter than when the variable is echoed in the login and signup .phps?? Any other ideas im so lost !!! Thanks for he help by the way admin 21232f297a57a5a743894a0e4a801f
  7. Also here is my code for my login and signup form... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Untitled Document</title> </head> <body> <form action="login.php" method="post"> <h1>Login Form</h1> Username:<input type="text" name="username" /><br /> Password:<input type="password" name="password" /><br /> <input type="submit" /> </form> <form action="signin.php" method="post"> <h1>Signin Form</h1> Username:<input type="text" name="username" /><br /> Password:<input type="password" name="password" /><br /> <input type="submit" /> </form> <br /> <br /> <a href="list_username.php">Click to see a list of all usernames and passwords</a> </body> </html>
  8. LOGIN: SELECT * FROM users WHERE username='admin' AND password='21232f297a57a5a743894a0e4a801fc3' Wrong username and password Your name is admin Your password is 21232f297a57a5a743894a0e4a801fc3 SIGNUP: Hasn't got a $sql... but when i echo for $new_password and $new_name Welcome admin You password is 21232f297a57a5a743894a0e4a801fc3 It has the same and when I SELECT the username and passwords FROM my database they are all the same that why im so confused... ???
  9. Well its coming up with wrong username and password, when I want it to say "Thank you for logging in". It worked fine without the md5 part but i want the password to be encrypted so I need it there, when I echo the variable $new_password it has the md5(password in it which seems right) however it still says "Wrong username and password". Am not sure what is wrong but as I am new to all this I can't figure it out.. ????
  10. Hi I am having trouble trying to create a log in and sign up form, the problem is happening when I try to use md5 to encrypt the code. HERE IS MY LOGIN CODE: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Login</title> </head> <body> <?php $new_user = $_POST["username"]; $new_password = md5($_POST["password"]); $con = mysql_connect("localhost","root","root"); if(!$con) { die('Cannot connect to Database' . mysql_error()); } mysql_select_db("login",$con); $sql = "SELECT * FROM users WHERE username='$new_user' AND password='$new_password'"; $result= mysql_query($sql,$con); $numrows = mysql_num_rows($result); $row = mysql_fetch_row($result); if($numrows ==0) { echo "Wrong username and password <br />"; }else { if($numrows ==1) { echo "Thank you for logging in <br />"; }else { echo "Not working <br />"; } } echo "Your name is " . $new_user . "<br />"; echo "Your password is " . $new_password . "<br />"; ?> <form action="login.php" method="post"> <h2> Please enter some notes </h2> <textarea name="notes"></textarea> <input type="submit" /> </form> <?php echo $_POST["notes"]; ?> </body> </html> HERE IS MY SIGN UP CODE: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Login</title> </head> <body> <?php $new_name = $_POST["username"]; $new_password = md5($_POST["password"]); $con = mysql_connect("localhost","root","root"); if(!$con) { die('Cannot connect to Database' . mysql_error()); } mysql_select_db("login", $con); mysql_query("INSERT INTO users (username, password) VALUES ('$new_name', '$new_password')"); mysql_close($con); ?> Welcome <?php echo $new_name;?><br /> You password is <?php echo $new_password;?> </body> </html> When I echo the password on both the log in script and sign up script it comes up with exactly the same md5 code and is also the same in PHPMYADMIN when I look under users password, so I am not sure what i am doing wrong if anyone has any ideas I would be very thankful Cheers
  11. mdpdesigns replied to mdpdesigns's topic in Server Side
    Hey Thanks for the help. This is very helpful if any one has the same problems MAMP help it seems to be working now
  12. mdpdesigns replied to mdpdesigns's topic in Server Side
    Hey, I tryed that and it still comes up with the same error message. Im not sure weather this has anythign to do with it but I downloaded my sql from their website a while back from here link would this have anythign to do with it not working or do I need that to run anyway? . Am really not sure what I am doing and I cant find any tutorials which show how to set up in Dreamweaver etc Any other ideas whats wrong with it or any info you could give me to help me understand it a bit better? Thank Matt
  13. mdpdesigns posted a topic in Server Side
    Hi I am trying to set up MAMP so I can play around with php but when I test the files in Firefox I keep getting an error box saying the url is not valid cannot be loaded???. I have looked online and set my Apache Port to 80 and MySQL Port to 3306. My Document Root is Users/Matt/Sites. Am not really sure what is wrong? Anyone have any ideas? Cheers Matt
  14. Hey I am wondering if anyone knows of an option in Dreamweaver which allows you to change the connection speed when you preview your page to check how fast it loads etc. I know you can do this in Flash so I guess you can do it in Dreamweaver also?

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.