Rother2005 Posted January 1, 2007 Share Posted January 1, 2007 can someone point me in the right direction with allowing users to recall there info from a database, edit it and resave itive sat down and begun to get it on paper, so far have it as duin a search based on user input (say username password), an if statement that checkes the 2 var made by the user (the username and password that was input) so if vars == username / password in databasethen show dataelse no match is that on the right lines Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 1, 2007 Author Share Posted January 1, 2007 help anyone? Quote Link to comment Share on other sites More sharing options...
dcro2 Posted January 1, 2007 Share Posted January 1, 2007 That should be right, start some code and we'll help you if you can't get something. Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 1, 2007 Author Share Posted January 1, 2007 rite ive got this so far<?php // Connects to your Database mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("booze") or die(mysql_error()); $data = mysql_query("SELECT * FROM member WHERE Username ='what user inputs lol $input'") or die(mysql_error()); Print "<table border cellpadding=3>"; while($info = mysql_fetch_array( $data )) { Print "<tr>"; Print "<th>Username:</th> <td>".$info['Username'] . "</td> "; Print "<th>Password:</th> <td>".$info['Password'] . " </td></tr>"; } Print "</table>"; ?> now it prints the data to a table (which doesnt allow any change to the data so is there another way of outputing the data?)also how do i get it to allow for input? something like:<?php if(!$_POST['register']){echo'<p align="center"><strong>Member Registration</strong></p><form name="form1" method="POST" action=""><p align="center">Username: <input type="text" name="username"></p><p align="center">Password: <input type="text" name="password"></p><p align="center"><input type="submit" name="register" value="Enter Details"></p></form>';} else{$username=$_POST['username'];$password=$_POST['password'];?>then paste$data = mysql_query("SELECT * FROM member WHERE Username ='$username'") or die(mysql_error()); Print "<table border cellpadding=3>"; while($info = mysql_fetch_array( $data )) { Print "<tr>"; Print "<th>Username:</th> <td>".$info['Username'] . "</td> "; Print "<th>Password:</th> <td>".$info['Password'] . " </td></tr>"; } Print "</table>"; ?> thats as far as ive got (also dont buy any 'for dummies' books they are poo) Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 2, 2007 Share Posted January 2, 2007 Are you meaning you want their username to be displayed in the username input?<p align="center">Username: <input type="text" name="username" value="'.$info['Username'].'"></p> Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 2, 2007 Author Share Posted January 2, 2007 what im basically after is allowing the user to input username and then the code retreives the data for that username (e.g its password,addy.telno), and outputs it in a format that will allow them to change the details, and save them back into the database...so not expecting much really lol :D Quote Link to comment Share on other sites More sharing options...
dcro2 Posted January 2, 2007 Share Posted January 2, 2007 This should give you an idea. You might need to edit the cookie name and the MySQL field names as well.[code]<?php// Connects to your Databasemysql_connect("localhost", "root", "") or die(mysql_error());mysql_select_db("booze") or die(mysql_error());if(!$_POST['submit']) { $data = mysql_query("SELECT * FROM member WHERE Username ='".$_COOKIE['ID']."'") or die(mysql_error()); $info = mysql_fetch_array( $data ); echo "<form name=\"form1\" method=\"POST\" action=\"\"><p align=\"center\">Username: <input type=\"text\" name=\"username\" value=\"{$info['Username']}\"></p><p align=\"center\">Password: <input type=\"text\" name=\"password\"></p><p align=\"center\">First Name: <input type=\"text\" name=\"firstname\" value=\"{$info['FirstName']}\"></p><p align=\"center\">Surname: <input type=\"text\" name=\"surname\" value=\"{$info['Surname']}\"></p><p align=\"center\">Address 1:<input type=\"text\" name=\"address1\" value=\"{$info['Address1']}\"></p><p align=\"center\">Address 2:<input type=\"text\" name=\"address2\" value=\"{$info['Address2']}\"></p><p align=\"center\">Town: <input type=\"text\" name=\"town\" value=\"{$info['Town']}\"></p><p align=\"center\">County: <input type=\"text\" name=\"county\" value=\"{$info['County']}\"></p><p align=\"center\">Postcode: <input type=\"text\" name=\"postcode\" value=\"{$info['Postcode']}\"></p><p align=\"center\">Tel No: <input type=\"text\" name=\"telno\" value=\"{$info['TelNo']}\"></p><p align=\"center\">Mobile: <input type=\"text\" name=\"mobile\" value=\"{$info['Mobile']}\"></p><p align=\"center\">Email: <input type=\"text\" name=\"email\" value=\"{$info['Email']}\"></p><p align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Edit Details\"></p></form>";} else { $username=$_POST['username']; $password=$_POST['password']; $firstname=$_POST['firstname']; $surname=$_POST['surname']; $address1=$_POST['address1']; $address2=$_POST['address2']; $town=$_POST['town']; $county=$_POST['county']; $postcode=$_POST['postcode']; $telno=$_POST['telno']; $mobile=$_POST['mobile']; $email=$_POST['email']; $sql = "UPDATE memberSET Username='$username', Password='$password', Firstname='$firstname', Surname='$surname', Address1='$address1', Address2='$address2', Town='$town', County='$county', $Postcode='$postcode', TelNo='$telno', Mobile='$mobile', Email='$email' WHERE Username = '".$_COOKIE['ID']."'"; mysql_query($sql) or die(mysql_error()); echo "Your info has been updated";}?> [/code]A little note, you don't need a while() loop for mysql_fetch_array() if you're only going to process one row.Off topic: Also, I'm 14, that's why I wasn't out getting "wrecked" as you posted yesterday. ;) Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 2, 2007 Author Share Posted January 2, 2007 rite ive put the code in and this came upYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '='', TelNo='', Mobile='', Email='' WHERE Username = ''' at line 2so its just a case of me checking thru the code thanks for the help tho much appreciated Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 2, 2007 Author Share Posted January 2, 2007 rite seemed to have sorted a little bit out, on the set line there was a few $ missingbut now the error i get is You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '='', ='', ='', ='' WHERE =''' at line 2kinda dnt get whats it trying to say here :S Quote Link to comment Share on other sites More sharing options...
dcro2 Posted January 2, 2007 Share Posted January 2, 2007 Well, uh, it's trying to set them all to a blank value, check all the variable name and field names. Quote Link to comment Share on other sites More sharing options...
forumnz Posted January 2, 2007 Share Posted January 2, 2007 A question... is there a form that links to this script? Quote Link to comment Share on other sites More sharing options...
forumnz Posted January 2, 2007 Share Posted January 2, 2007 anyone? Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 2, 2007 Author Share Posted January 2, 2007 yea i asked for help on a reg form to http://www.phpfreaks.com/forums/index.php/topic,120519.0.html Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 2, 2007 Author Share Posted January 2, 2007 rite it allows input and puts the data into the database but if you place a piece of data into the form that exists in the database it give the error 'Duplicate entry 'a' for key 1', as the function i need it for is to update information they may need to repeat info that is the same e.g. change password but keep all other details to sameorchange address but keep everything else the same [code]<?php// Connects to your Databasemysql_connect("localhost", "root", "") or die(mysql_error());mysql_select_db("booze") or die(mysql_error());if(!$_POST['submit']) { $data = mysql_query("SELECT * FROM member WHERE Username ='".$_COOKIE['ID']."'") or die(mysql_error()); $info = mysql_fetch_array( $data ); echo "<form name=\"form1\" method=\"POST\" action=\"\"><p align=\"center\">Username: <input type=\"text\" name=\"username\" value=\"{$info['username']}\"></p><p align=\"center\">Password: <input type=\"text\" name=\"password\"></p><p align=\"center\">First Name: <input type=\"text\" name=\"firstname\" value=\"{$info['firstName']}\"></p><p align=\"center\">Surname: <input type=\"text\" name=\"surname\" value=\"{$info['surname']}\"></p><p align=\"center\">Address 1: <input type=\"text\" name=\"address1\" value=\"{$info['address1']}\"></p><p align=\"center\">Address 2: <input type=\"text\" name=\"address2\" value=\"{$info['address2']}\"></p><p align=\"center\">Town: <input type=\"text\" name=\"town\" value=\"{$info['town']}\"></p><p align=\"center\">County: <input type=\"text\" name=\"county\" value=\"{$info['county']}\"></p><p align=\"center\">Postcode: <input type=\"text\" name=\"postcode\" value=\"{$info['postcode']}\"></p><p align=\"center\">Tel No: <input type=\"text\" name=\"telno\" value=\"{$info['telno']}\"></p><p align=\"center\">Mobile: <input type=\"text\" name=\"mobile\" value=\"{$info['mobile']}\"></p><p align=\"center\">Email: <input type=\"text\" name=\"email\" value=\"{$info['email']}\"></p><p align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Edit Details\"></p></form>";} else { $username=$_POST['username']; $password=$_POST['password']; $firstname=$_POST['firstname']; $surname=$_POST['surname']; $address1=$_POST['address1']; $address2=$_POST['address2']; $town=$_POST['town']; $county=$_POST['county']; $postcode=$_POST['postcode']; $telno=$_POST['telno']; $mobile=$_POST['mobile']; $email=$_POST['email']; $sql = "UPDATE memberSET Username='$username', Password='$password', Firstname='$firstname', Surname='$surname', Address1='$address1', Address2='$address2', Town='$town', County='$county', Postcode='$postcode', TelNo='$telno', Mobile='$mobile', Email='$email' WHERE Username='".$_COOKIE['ID']."'"; mysql_query($sql) or die(mysql_error()); echo "Your info has been updated";}?> [/code] Quote Link to comment Share on other sites More sharing options...
trq Posted January 2, 2007 Share Posted January 2, 2007 What field is your primary key? Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 2, 2007 Author Share Posted January 2, 2007 i dnt have one to b honest Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 6, 2007 Author Share Posted January 6, 2007 do i need one for it to work?? Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted January 7, 2007 Share Posted January 7, 2007 one thing i am noticing is no password validation to start. this is what i use for my site, well sort of, i also have an encrpyter/decrypter as well as inlcuded funtions and such, but you'll get this jist:[code]<?php session_start();$user = $_POST['username'];$pass = $_POST['password'];mysql_connect ("localhost","root","") ;mysql_select_db("booze") or die(mysql_error());//set up the query$query = "SELECT * from member WHERE username='$user' and password='$pass'";//run the query and get the number of affected rows$result = mysql_query($query) or die('error making query');$row = mysql_fetch_array($result, MYSQL_ASSOC);$affected_rows = mysql_num_rows($result);if($affected_rows == 1 ) {$_SESSION['user_name'] = $user;$_SESSION['password'] = $pass;$_SESSION['logged_in'] = true;echo "<script>location.href='index.php?nav=home';</script>";} ?>[/code]on your original page, have it check to see if session['logged_in'] == true..if not the user is not a valid user that logged in..i have ip checking as well as other validation techniques and encrpytion for my site, but if your are trying to be simple this is fine..just be sure that u are checking that password and user match and are in exactly one row..your code for the next page in real simple form could be:[code]<?php$user = $_SESSION['username'];$pass = $_SESSION['password'];if($_SESSION['logged_in'] == true) {...code goes here for your printoutsyou'll want to just do a query based on the user themselfso$query = "SELECT * from member where `username` = '$user'";fetch an array, use a foreach($result as $row) { ..your results} and you should be good to go[/code] Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 7, 2007 Author Share Posted January 7, 2007 so change it from:[code]<?php// Connects to your Databasemysql_connect("localhost", "root", "") or die(mysql_error());mysql_select_db("booze") or die(mysql_error());if(!$_POST['submit']) { $data = mysql_query("SELECT * FROM member WHERE Username ='".$_COOKIE['ID_my_site']."'") or die(mysql_error()); $info = mysql_fetch_array( $data ); echo "<form name=\"form1\" method=\"POST\" action=\"\"><p align=\"center\">Username: <input type=\"text\" name=\"username\" value=\"{$info['username']}\"></p><p align=\"center\">Password: <input type=\"text\" name=\"password\"> </p><p align=\"center\">First Name: <input type=\"text\" name=\"firstname\" value=\"{$info['firstname']}\"></p><p align=\"center\">Surname: <input type=\"text\" name=\"surname\" value=\"{$info['surname']}\"></p><p align=\"center\">Address 1: <input type=\"text\" name=\"address1\" value=\"{$info['address1']}\"></p><p align=\"center\">Address 2: <input type=\"text\" name=\"address2\" value=\"{$info['address2']}\"></p><p align=\"center\">Town: <input type=\"text\" name=\"town\" value=\"{$info['town']}\"></p><p align=\"center\">County: <input type=\"text\" name=\"county\" value=\"{$info['county']}\"></p><p align=\"center\">Postcode: <input type=\"text\" name=\"postcode\" value=\"{$info['postcode']}\"></p><p align=\"center\">Tel No: <input type=\"text\" name=\"telno\" value=\"{$info['telno']}\"></p><p align=\"center\">Mobile: <input type=\"text\" name=\"mobile\" value=\"{$info['mobile']}\"></p><p align=\"center\">Email: <input type=\"text\" name=\"email\" value=\"{$info['email']}\"></p><p align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Edit Details\"></p></form>";} else { $username=$_POST['username']; $password=$_POST['password']; $firstname=$_POST['firstname']; $surname=$_POST['surname']; $address1=$_POST['address1']; $address2=$_POST['address2']; $town=$_POST['town']; $county=$_POST['county']; $postcode=$_POST['postcode']; $telno=$_POST['telno']; $mobile=$_POST['mobile']; $email=$_POST['email']; $sql = "UPDATE member SET Username='$username', Password='$password', Firstname='$firstname', Surname='$surname', Address1='$address1', Address2='$address2', Town='$town', County='$county', Postcode='$postcode', TelNo='$telno', Mobile='$mobile', Email='$email' WHERE Username='".$_COOKIE['ID']."'"; mysql_query($sql) or die(mysql_error()); echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=members.php\"/> Your info has been updated");}?> [/code]to [code]<?php// Connects to your Databasemysql_connect("localhost", "root", "") or die(mysql_error());mysql_select_db("booze") or die(mysql_error());<?php$user = $_SESSION['username'];$pass = $_SESSION['password'];if($_SESSION['logged_in'] == true) {$query = "SELECT * from member where `username` = '$user'"; $info = mysql_fetch_array( $data ); echo "<form name=\"form1\" method=\"POST\" action=\"\"><p align=\"center\">Username: <input type=\"text\" name=\"username\" value=\"{$info['username']}\"></p><p align=\"center\">Password: <input type=\"text\" name=\"password\"> </p><p align=\"center\">First Name: <input type=\"text\" name=\"firstname\" value=\"{$info['firstname']}\"></p><p align=\"center\">Surname: <input type=\"text\" name=\"surname\" value=\"{$info['surname']}\"></p><p align=\"center\">Address 1: <input type=\"text\" name=\"address1\" value=\"{$info['address1']}\"></p><p align=\"center\">Address 2: <input type=\"text\" name=\"address2\" value=\"{$info['address2']}\"></p><p align=\"center\">Town: <input type=\"text\" name=\"town\" value=\"{$info['town']}\"></p><p align=\"center\">County: <input type=\"text\" name=\"county\" value=\"{$info['county']}\"></p><p align=\"center\">Postcode: <input type=\"text\" name=\"postcode\" value=\"{$info['postcode']}\"></p><p align=\"center\">Tel No: <input type=\"text\" name=\"telno\" value=\"{$info['telno']}\"></p><p align=\"center\">Mobile: <input type=\"text\" name=\"mobile\" value=\"{$info['mobile']}\"></p><p align=\"center\">Email: <input type=\"text\" name=\"email\" value=\"{$info['email']}\"></p><p align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Edit Details\"></p></form>";} else { $username=$_POST['username']; $password=$_POST['password']; $firstname=$_POST['firstname']; $surname=$_POST['surname']; $address1=$_POST['address1']; $address2=$_POST['address2']; $town=$_POST['town']; $county=$_POST['county']; $postcode=$_POST['postcode']; $telno=$_POST['telno']; $mobile=$_POST['mobile']; $email=$_POST['email']; $sql = "UPDATE member SET Username='$username', Password='$password', Firstname='$firstname', Surname='$surname', Address1='$address1', Address2='$address2', Town='$town', County='$county', Postcode='$postcode', TelNo='$telno', Mobile='$mobile', Email='$email' WHERE Username='".$_COOKIE['ID']."'"; mysql_query($sql) or die(mysql_error()); echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=members.php\"/> Your info has been updated");}?> [/code]??? Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted January 7, 2007 Share Posted January 7, 2007 [quote]so change it from:Code:<?php// Connects to your Databasemysql_connect("localhost", "root", "") or die(mysql_error());mysql_select_db("booze") or die(mysql_error());if(!$_POST['submit']) { $data = mysql_query("SELECT * FROM member WHERE Username ='".$_COOKIE['ID_my_site']."'") or die(mysql_error()); $info = mysql_fetch_array( $data ); echo "<form name=\"form1\" method=\"POST\" action=\"\"><p align=\"center\">Username: <input type=\"text\" name=\"username\" value=\"{$info['username']}\"></p><p align=\"center\">Password: <input type=\"text\" name=\"password\"> </p><p align=\"center\">First Name: <input type=\"text\" name=\"firstname\" value=\"{$info['firstname']}\"></p><p align=\"center\">Surname: <input type=\"text\" name=\"surname\" value=\"{$info['surname']}\"></p><p align=\"center\">Address 1: <input type=\"text\" name=\"address1\" value=\"{$info['address1']}\"></p><p align=\"center\">Address 2: <input type=\"text\" name=\"address2\" value=\"{$info['address2']}\"></p><p align=\"center\">Town: <input type=\"text\" name=\"town\" value=\"{$info['town']}\"></p><p align=\"center\">County: <input type=\"text\" name=\"county\" value=\"{$info['county']}\"></p><p align=\"center\">Postcode: <input type=\"text\" name=\"postcode\" value=\"{$info['postcode']}\"></p><p align=\"center\">Tel No: <input type=\"text\" name=\"telno\" value=\"{$info['telno']}\"></p><p align=\"center\">Mobile: <input type=\"text\" name=\"mobile\" value=\"{$info['mobile']}\"></p><p align=\"center\">Email: <input type=\"text\" name=\"email\" value=\"{$info['email']}\"></p><p align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Edit Details\"></p></form>";} else { $username=$_POST['username']; $password=$_POST['password']; $firstname=$_POST['firstname']; $surname=$_POST['surname']; $address1=$_POST['address1']; $address2=$_POST['address2']; $town=$_POST['town']; $county=$_POST['county']; $postcode=$_POST['postcode']; $telno=$_POST['telno']; $mobile=$_POST['mobile']; $email=$_POST['email']; $sql = "UPDATE member SET Username='$username', Password='$password', Firstname='$firstname', Surname='$surname', Address1='$address1', Address2='$address2', Town='$town', County='$county', Postcode='$postcode', TelNo='$telno', Mobile='$mobile', Email='$email' WHERE Username='".$_COOKIE['ID']."'"; mysql_query($sql) or die(mysql_error()); echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=members.php\"/> Your info has been updated");}?> toCode:<?php// Connects to your Databasemysql_connect("localhost", "root", "") or die(mysql_error());mysql_select_db("booze") or die(mysql_error());<?php$user = $_SESSION['username'];$pass = $_SESSION['password'];if($_SESSION['logged_in'] == true) {$query = "SELECT * from member where `username` = '$user'"; $info = mysql_fetch_array( $data ); echo "<form name=\"form1\" method=\"POST\" action=\"\"><p align=\"center\">Username: <input type=\"text\" name=\"username\" value=\"{$info['username']}\"></p><p align=\"center\">Password: <input type=\"text\" name=\"password\"> </p><p align=\"center\">First Name: <input type=\"text\" name=\"firstname\" value=\"{$info['firstname']}\"></p><p align=\"center\">Surname: <input type=\"text\" name=\"surname\" value=\"{$info['surname']}\"></p><p align=\"center\">Address 1: <input type=\"text\" name=\"address1\" value=\"{$info['address1']}\"></p><p align=\"center\">Address 2: <input type=\"text\" name=\"address2\" value=\"{$info['address2']}\"></p><p align=\"center\">Town: <input type=\"text\" name=\"town\" value=\"{$info['town']}\"></p><p align=\"center\">County: <input type=\"text\" name=\"county\" value=\"{$info['county']}\"></p><p align=\"center\">Postcode: <input type=\"text\" name=\"postcode\" value=\"{$info['postcode']}\"></p><p align=\"center\">Tel No: <input type=\"text\" name=\"telno\" value=\"{$info['telno']}\"></p><p align=\"center\">Mobile: <input type=\"text\" name=\"mobile\" value=\"{$info['mobile']}\"></p><p align=\"center\">Email: <input type=\"text\" name=\"email\" value=\"{$info['email']}\"></p><p align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Edit Details\"></p></form>";} else { $username=$_POST['username']; $password=$_POST['password']; $firstname=$_POST['firstname']; $surname=$_POST['surname']; $address1=$_POST['address1']; $address2=$_POST['address2']; $town=$_POST['town']; $county=$_POST['county']; $postcode=$_POST['postcode']; $telno=$_POST['telno']; $mobile=$_POST['mobile']; $email=$_POST['email']; $sql = "UPDATE member SET Username='$username', Password='$password', Firstname='$firstname', Surname='$surname', Address1='$address1', Address2='$address2', Town='$town', County='$county', Postcode='$postcode', TelNo='$telno', Mobile='$mobile', Email='$email' WHERE Username='".$_COOKIE['ID']."'"; mysql_query($sql) or die(mysql_error()); echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=members.php\"/> Your info has been updated");}?> Huh[/quote]one thing is that in your code you're still going need an original login form that goes to the validate script i mentioned then comes back to this new code if user and pass have been verified together. also, you'll need something more like :[code]<?php// Connects to your Databasemysql_connect("localhost", "root", "") or die(mysql_error());mysql_select_db("booze") or die(mysql_error());<?php$user = $_SESSION['username'];$pass = $_SESSION['password'];if($_SESSION['logged_in'] == true) {$query = "SELECT * from member where `username` = '$user'"; $info = mysql_fetch_array( $data ); echo "<form name=\"form1\" method=\"POST\" action=\"\"><p align=\"center\">Username: <input type=\"text\" name=\"username\" value=\"{$info['username']}\"></p><p align=\"center\">Password: <input type=\"text\" name=\"password\"> </p><p align=\"center\">First Name: <input type=\"text\" name=\"firstname\" value=\"{$info['firstname']}\"></p><p align=\"center\">Surname: <input type=\"text\" name=\"surname\" value=\"{$info['surname']}\"></p><p align=\"center\">Address 1: <input type=\"text\" name=\"address1\" value=\"{$info['address1']}\"></p><p align=\"center\">Address 2: <input type=\"text\" name=\"address2\" value=\"{$info['address2']}\"></p><p align=\"center\">Town: <input type=\"text\" name=\"town\" value=\"{$info['town']}\"></p><p align=\"center\">County: <input type=\"text\" name=\"county\" value=\"{$info['county']}\"></p><p align=\"center\">Postcode: <input type=\"text\" name=\"postcode\" value=\"{$info['postcode']}\"></p><p align=\"center\">Tel No: <input type=\"text\" name=\"telno\" value=\"{$info['telno']}\"></p><p align=\"center\">Mobile: <input type=\"text\" name=\"mobile\" value=\"{$info['mobile']}\"></p><p align=\"center\">Email: <input type=\"text\" name=\"email\" value=\"{$info['email']}\"></p><p align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Edit Details\"></p></form>"; \* do me a favor and move this into a new .php script that the above form calls $sql = "UPDATE member SET Username='$username', Password='$password', Firstname='$firstname', Surname='$surname', Address1='$address1', Address2='$address2', Town='$town', County='$county', Postcode='$postcode', TelNo='$telno', Mobile='$mobile', Email='$email' WHERE Username='".$_COOKIE['ID']."'"; mysql_query($sql) or die(mysql_error()); echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=members.php\"/> Your info has been updated");*\}\\if not logged inelse {echo"Not logged in";}?> [/code] Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted January 7, 2007 Share Posted January 7, 2007 if this has worked for your answer, please add this as solved.. Quote Link to comment Share on other sites More sharing options...
Rother2005 Posted January 7, 2007 Author Share Posted January 7, 2007 thats seems to work fine but my cookies dont work so im going to scrap the cookie thing for now, i just want to get it working to change details 1st then come back to the cookiecheers for you help Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted January 7, 2007 Share Posted January 7, 2007 no prob...good luck mate Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.