Everything posted by mdpdesigns
-
Send opened session new data to database
Got it working... thanks for the help
-
Send opened session new data to database
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;
-
md5 login problem
WOO!! Thanks again
-
md5 login problem
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
-
md5 login problem
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
-
md5 login problem
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
-
md5 login problem
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>
-
md5 login problem
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... ???
-
md5 login problem
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.. ????
-
md5 login problem
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
-
MAMP help
Hey Thanks for the help. This is very helpful if any one has the same problems MAMP help it seems to be working now
-
MAMP help
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
-
MAMP help
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
-
Change connection speed Preview
Thanks
-
Change connection speed Preview
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?
-
Help needed
Hey so the problem is kind of sorted out. only one more thing I have had to set the bottom footer to a width of 1600px so the 2 images can line up properly but now there is a scrollbar at the bottom of the page which I don't really want there... is there anyway to get rid of it? Here is the link Link Thanks for the help Matt
-
Help needed
Hey to be honest I havn't made it easy for myself but I really wanna get it to work, here is the structure of the page I have. <header> <header1> </header1> No problems with these </header> <container1> -- has shadow bg for container <container> -- the white fabric texture behind the text <main> -- where the text and backgrounds for text are All these have a fixed width so I cannot put the footer in here as it needs to stretch the whole page Also this is where the z-index problem happens as I need the container1 and container to be behind footer but i need the main div to be in front of the footer. And I guess that because the main is nested in the container & container1 it will only be as far in front as they can be. So its all of them in front or none of them. </main> </container> </container1> <footer> -- This is what I need to be at the bottom of the page but because it is such a high image I need to use a negative margin on it. Which is where the problem happens. </footer> I have tried cutting the image up into separate parts but it will still be all in front or behind. All I need really is to be able to click through a higher z-indexed div to a lower one but I don't think that is possible. Hopefully that is kind of clear if you have any other ideas please lemme know as this is so fustrating
-
Help needed
Hey i have a big problem which I have been trying to work out for hours with no luck. I have my footer image at the bottom of my page which is around 700px height but transparent, is there anyway to click links which are behind this (I have used a negative margin to position it as this is the only way). The problem is I need the footer on the highest z-index so all the links are behind it am just wondering if there is anything I can do to get this to work. I have tried tons of differnt things but just cannot get it working. Here is a link to what I have the problem with. Link So you can see on the links you cant click the contact buttons. Please let me know if you have any ideas as I am very stuck. Thanks
-
Png problem
Have you seen the link?. The footer at the bottom with guitar etc. Im placing it over everything as if I don't it will be behind everything and the effect I want to give is that it is in front of everything on the page? Also because it has a different width to the content so I can't place them in an overall div together. Do you have any suggestions as a better way to do that?
-
Png problem
Hey, on the link. Its the footer image with the guitar etc, is a png image so the image actually covers about 700px height from the bottom of the page. Its just its transparent but I need the png image to be on the top layer but still be able to click links behind the transparent image so the contact box for example does not work under the image. Am wondering if there is any special way to save a png or to add code which could fix the problem? Any thoughts?
-
Png problem
Hey I have a problem with my png image as it is on the top layer I am not able to click through to the links behind it. I am looking to have the png image on the highest z-index but I still need to be able to click links behind. Does anyone know any ways around it? Link Here is the link I need the footer to be in front of the content whilst still being able to use the links. Any help would be greatly appreciated Thanks
-
another positioning problem
Hey am wondering if anyone can help me out I am having problems with what seems like it should be somethign simple my div containers heights are not filling the page. I have set the body and containers height to 100% but am using the inherit positioning rather than absolute because of other errors in IE. Is there any other way to check for page height, and give that value to the containers. Here is the site I am testing The stylesheet I am using Woud greatly appreciate any help Cheers Matt
-
Form Captcha Help
Hey thanks for your help that seemed to fix it
-
Problem with links :s
Problem sorted. How do you delete posts?
-
Form Captcha Help
Hi am wondering if anyone can help me I know next to nothing about php but need to make a spam proof form I have tryed to use a securimage captcha but keep getting errors. Here is my form Link Here is php & Error message Link code for formprocessl.php <?php session_start(); ?> <?php /* Variables */ $emailSubject = 'Website Message!!'; $webMaster = 'howlomogo@hotmail.com'; include_once $_SERVER['DOCUMENT_ROOT'] . 'securimage/securimage.php'; $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { // the code was incorrect // handle the error accordingly with your other error checking // or you can do something really basic like this die('The code you entered was incorrect. Go back and try again.'); } /* Gathering dta variables */ $firstnameField = $_POST['firstname']; $lastnameField = $_POST['lastname']; $address1Field = $_POST['address1']; $address2Field = $_POST['address2']; $countyField = $_POST['county']; $postcodeField = $_POST['postcode']; $telephoneField = $_POST['telephone']; $mobileField = $_POST['mobile']; $emailField = $_POST['email']; $maxrentField = $_POST['maxrent']; $descField = $_POST['desc']; $desc1Field = $_POST['desc1']; /* this EOP is what will be displayed in the email */ $body = <<<EOD <br /><br /> <h1>Landlord Enquiry</h1> Name:$firstnameField $lastnameField<br /><br /> Address:<br /> $address1Field<br /> $address2Field<br /> $countyField<br /> $postcodeField<br /><br /> Telephone:$telephoneField<br /><br /> Mobile:$mobileField<br /><br /> Email:$emailField<br /><br /> Service they want: $desc1Field EOD; if(!$spam) { $headers = "From: $emailField\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); } else { // Do somthing here to warn about spam } /*results rendered as html */ $theResults = <<<EOD <!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>ABBA,lettings,Portsmouth,Southsea,Rentals,Properties,To,Let</title> <style type="text/css"> <!-- --> </style> <link rel="stylesheet" type="text/css" href="abba_style.css" /> </head> <body> <div class="container"> <div class="header"> <div class="header-left"> </div> </div> <div class="main"> <div id="nav"> <ul> <li><a href="index.html">Home</a></li> <li><a href="property_search.html">Property Search</a></li> <li><a href="tenant_info.html">Tenant Info</a></li> <li><a href="landlord_info.html">Landlord Info</a></li> <li><a href="property_wanted.html">Property Wanted List</a></li> <li><a href="contact_us.html">Contact Us</a></li> </ul> </div> <div class="toptest"></div> <div class="landlord"> <p class="center">Thank you for your enquiry we will get back to you within 48 hours if you do not hear from us please try phoning or e-mailing us directly</p> </div> <div id="footerlinks" class="footer"> <a href="index.html">Home</a> | <a href="property_search.html">Property Search</a> | <a href="tenant_info.html">Tenant Info</a> | <a href="tenant_form.html">Tenant Form</a> | <a href="landlord_info.html">Landlord Info</a> | <a href="landlord_form.html">Landlord Form</a> | <a href="advertise.html">Advertising</a> | <a href="property_wanted.html">Property Wanted List</a> | <a href="contact_us.html">Contact Us</a> <p class="center"><a href="http://www.mdpdesigns.co.uk">Web Design</a> by MDPdesigns</p> </div> </div> </div> </body> </html> EOD; echo "$theResults"; ?> Error code Warning: include_once(/web/guide/abbaplus/public_html/securimage/securimage.php) [function.include-once]: failed to open stream: No such file or directory in /web/guide/abbaplus/public_html/abba_lettings/formprocessl.php on line 11 Warning: include_once() [function.include]: Failed opening '/web/guide/abbaplus/public_html/securimage/securimage.php' for inclusion (include_path='.:/usr/local/lib/php') in /web/guide/abbaplus/public_html/abba_lettings/formprocessl.php on line 11 Fatal error: Class 'Securimage' not found in /web/guide/abbaplus/public_html/abba_lettings/formprocessl.php on line 13 I would greatly appreciate it if anyone can have a look or help me as I am totally lost Thanks