Jump to content

ianhaney

Members
  • Posts

    330
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ianhaney

  1. Hi I have got a login page and after I log in, it takes me to a page I set in the coding which is great but I want to display some text or have a popup box saying I have successfully logged in, is that possible and if so how do I do it or can someone point me in the right direction please Thank you in advance Ian
  2. Hi Scootstah That's works perfect, it will do as does what I need it to do Thank you so much and thank you everyone for helping out
  3. Sorry am not very good at explaining things I need a HTML link that when a user clicks on the link it will show all the records that are in my database table that is called managers see below <a href="linkname">Show all records</a> I know it won't look like that as will prob be different in PHP but using a HTML link would be better Sorry not sure how else to explain it
  4. Hi trq Thank you for the reply I need something like the following they click on a link and that link then displays all the records in the database table that I have in mysql database
  5. Hi I have manged to get the results displayed based on the users input but now I need a link to display all records using either a html or php link and am bit stuck on how to do it Can anyone point me in the right direction please Thank you Ian
  6. Thank you I am going to have to look again at this as not 100% on getting the results displayed from the user input
  7. Could it be to do with my form <form action="viewall.php"> Town <input type="text"> <input type="submit" name="search" value="Search"> </form>
  8. I looked at the where link you gave and put this in my coding WHERE town LIKE 'B%' That returns all the town's beginning with B but still not sure on how to get the results displayed from what the user types in
  9. Hmm gonna be tricky this as not sure on how to use the input to create a where clause in the sql query are there any good tutorials I could look at regarding the where clause
  10. I have got the 0 displaying now How do I get results to display what the users chooses for example I have a input text field and typed a town in but is still displaying all the records from the database The coding I have is below <html> <head><title>Page Results</title></head> <body> <?php $database=""; mysql_connect ("", "", ""); @mysql_select_db($database) or die( "Unable to select database"); $result = mysql_query( "SELECT * FROM managers" ) or die("SELECT Error: ".mysql_error()); $num_rows = mysql_num_rows($result); print "There are $num_rows records.<P>"; print "<table width=400 border=1>\n"; while ($get_info = mysql_fetch_row($result)){ print "<tr>\n"; foreach ($get_info as $field) print "\t<td><font face=arial size=1/>$field</font></td>\n"; print "</tr>\n"; } print "</table>\n"; ?> <form action="viewall.php"> Town <input type="text"> <input type="submit" name="send" value="Search"> </form> </body> </html>
  11. I have so far managed to get results displayed from the database but the phone number has a 0 at the start in the database but in the php page it is missing the 0 Any ideas
  12. Yeah that's it easier said than done I think, Yeah I am based in the UK
  13. That looks close to what I need but just unsure how to convert it to what I need but will have a go
  14. It is a big job but think your postal code way could work as your saying it finds results in that postal area
  15. I do have a php script for a estate agent website that returns results dependent on town, how many rooms etc Could I use that somehow and obviously do away with the number of rooms etc and just leave in town and add a column in the database called name
  16. Ahh ok got ya now Muddy sorry Hmm gonna be difficult to do isn't it?
  17. Hi Drewdan Yeah that sounds like what I need Trouble is not 100% on how to do it, would you be able to give me a head start and see if I can work it out Sorry to ask
  18. not sure yet really maybe in the database I could have another column called town and then when a user enters their town, the town matching that of the user puts in will be displayed or the closest to the town that of the user puts in
  19. Hi Muddy_Funster thank you for the reply I think it will be more the PHP that has me stuck as entering the data should be fairly easy to do, am I right in doing something like the following in the mysql database name contactnumber the page I want to display the results will look like the following Area Manager: name or manager Contact Number: contact phone number
  20. Hi I am bit stuck, I want to return results from a mysql database when a user enters their town or postcode in for example below they enter in their town or post code and a list of area managers is displayed closest to their town or postcode along with their contact number Is that possible Thank you Ian
  21. Hi Jessica Thank you for the reply Where do I put the nl2br() Does it go in a php file or the database
  22. Hi on my website I have products and in the product description I am getting \n\r showing after each line where as it should be hiding it for example see below 16 ml in each bottle\r\nLuxury Style Bottles\r\nAvailable in White, Clear, Peach, Purple, Red, Pink and Black it should be like below 16 ml in each bottle Luxury Style Bottles Available in White, Clear, Peach, Purple, Red, Pink and Black Any ideas as not sure if it is the php file or the database causing the issue To see the issue go here - http://www.worldofco...products_id=169 Thank you in advance Ian
  23. That is all the coding, I copied it from Dreamweaver
  24. I can post the coding below, one sec and will post the coding below is the coding the checks the login form <?php session_start(); $_SESSION['user'] = $_POST['user']; //connect to db //insert validation of credentials here //then, store user_id in session session_start(); ob_start(); $host=""; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name=""; // Database name $tbl_name=""; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $userid = mysql_query("SELECT userid FROM users WHERE username='$_POST[username]'"); $_SESSION['userid']=$userid; // Define $myusername and $mypassword $username=$_POST['username']; $password=$_POST['password']; // To protect MySQL injection (more detail about MySQL injection) $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("username"); session_register("password"); header("location:loginsuccess.html"); } else { echo "Wrong Username or Password"; } ob_end_flush(); ?> below is the coding that checks the registration form <?php session_start(); //=============Configuring Server and Database======= $host = ''; $user = ''; $password = ''; //=============Data Base Information================= $database = ''; $conn = mysql_connect($host,$user,$password) or die('Server Information is not Correct'); //Establish Connection with Server mysql_select_db($database,$conn) or die('Database Information is not correct'); //===============End Server Configuration============ //=============Starting Registration Script========== $email = $_POST['email']; $username = $_POST['txtUser']; $password = $_POST['txtPassword']; //=============To Encrypt Password=================== $password = md5($salt.$password); //============New Variable of Password is Now with an Encrypted Value======== if(isset($_POST['btnRegister'])) //===When I will Set the Button to 1 or Press Button to register { $query = "insert into users(email,username,password)values('$email','$username','$password')"; $res = mysql_query($query); header('location:registersuccess.html'); } ?> <?php $to = "$email"; $subject = "Registration Details"; $message = "Email: $email \n Username: $username \n Password: $password"; $from = "ianhaney@irhwebsites.co.uk"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?>
  25. I am not 100% sure on how to fix it, hence need the help I have tried using sessions but am not 100% sure on php so am prob doing it wrong somewhere
×
×
  • 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.