Jump to content

frank_solo

Members
  • Posts

    109
  • Joined

  • Last visited

Everything posted by frank_solo

  1. Got it: <?php include "config.php"; $id = mysql_real_escape_string((int)$_GET['id']); $sql = "SELECT id FROM places WHERE id='$id' AND unit='Residential' AND county='New Jersey'"; $result = mysql_query($sql); if(mysql_num_rows($result) >0){ //found }else{ //not found header("location: http://www.mydomian.co"); } $query = "UPDATE `units` SET `views` = `views` + 1 WHERE `id` = $id"; $res = mysql_query($query, $bd); $query = "SELECT * FROM `places` WHERE `id` = $id"; $res = mysql_query($query, $bd); $result = mysql_fetch_assoc($res); $lat = $result['lat']; $contact = $result['contact']; $phone = $result['phone']; $long = $result['lng']; ?>
  2. This worked <?php session_start(); include 'config.php'; $url_id = mysql_real_escape_string($_GET['id']); $sql = "SELECT id FROM places WHERE id='$url_id' AND unit='Residential' AND county='New Jersey'"; $result = mysql_query($sql); if(mysql_num_rows($result) >0){ //found $query="UPDATE `places` SET `views` = `views` + 1 WHERE `id` = $url_id"; }else{ //not found header("location: http://www.mydomain.co"); } ?> But now this won't work $query="UPDATE `units` SET `views` = `views` + 1 WHERE `id` = $url_id"; Can someone show me how to make that statement work or should I start a different thread? Thanks
  3. Well I've done this so far but this helps only if index.php?id=(blank) if (!isset($_GET['id']) || empty($_GET['id'])) { header('location: http://www.mydomain.co') ; } What I would like as well is to query the table and check if the id exist if not to redirect.
  4. I have a question I have page like so: index.php?id=100 but let's say that id=101 is blank Is there a way to redirect the user if that page is empty. Redirect them to homepage. Is this possible and how? Thanks
  5. Ok so I need to first add the variable from the xml file onto to the map: var id = markers[i].getAttribute("id"); Then like kicken said I had the html to include the tag like so: var html = "<b>" + name + "</a></b> <br/>" + address +"<br /><a href='apt.php?id=" + id +"'>View Listing</a><br /><b></b>" ; Thanks for the guidance.
  6. Does anyone know how to make link? let's say one clicks on on a pin and an info window pops up. I would like the the title in the window to become a link to the listing itself. In other words to <a href="apt.php?=<? echo "" . $row['id'] . "";>echo "" . $row['title'] . ""</a> This is what I have: The XML file: <?php require("../config.php"); function parseToXML($htmlStr) { $xmlStr=str_replace('<','<',$htmlStr); $xmlStr=str_replace('>','>',$xmlStr); $xmlStr=str_replace('"','"',$xmlStr); $xmlStr=str_replace("'",''',$xmlStr); $xmlStr=str_replace("&",'&',$xmlStr); return $xmlStr; } // Opens a connection to a mySQL server $connection=mysql_connect (DB_HOST, DB_USER, DB_PASSWORD); if (!$connection) { die('Not connected : ' . mysql_error()); } // Set the active mySQL database $db_selected = mysql_select_db(DB_NAME, $connection); if (!$db_selected) { die ('Can\'t use db : ' . mysql_error()); } // Select all the rows in the markers table $query = "SELECT * FROM places WHERE unit='Residential' AND county='New Jersey'"; $result = mysql_query($query); if (!$result) { die('Invalid query: ' . mysql_error()); } header("Content-type: text/xml"); // Start XML file, echo parent node echo '<markers>'; // Iterate through the rows, printing XML nodes for each while ($row = @mysql_fetch_assoc($result)){ // ADD TO XML DOCUMENT NODE echo '<marker '; echo 'title="' . $row['title'] . '" '; echo 'id="' . $row['id'] . '" '; echo 'lat="' . $row['lat'] . '" '; echo 'lng="' . $row['lng'] . '" '; echo 'space="' . $row['space'] . '" '; echo 'amount="$' . $row['amount'] . '" '; echo '/>'; } // End XML file echo '</markers>'; ?> The Map: <script type="text/javascript"> //<![CDATA[ var customIcons = { "House": { icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png', shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png' }, }; function load() { var map = new google.maps.Map(document.getElementById("map2"), { center: new google.maps.LatLng(40.9167, -74.1722), zoom: 11, mapTypeId: 'roadmap' }); var infoWindow = new google.maps.InfoWindow; // Change this depending on the name of your PHP file downloadUrl("commphpsqlajax_genxml.php", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("title"); var address = markers[i].getAttribute("amount"); var type = markers[i].getAttribute("space"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customIcons[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, icon: icon.icon, shadow: icon.shadow }); bindInfoWindow(marker, map, infoWindow, html); } }); } function bindInfoWindow(marker, map, infoWindow, html) { google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html); infoWindow.open(map, marker); }); } function downloadUrl(url, callback) { var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest; request.onreadystatechange = function() { if (request.readyState == 4) { request.onreadystatechange = doNothing; callback(request, request.status); } }; request.open('GET', url, true); request.send(null); } function doNothing() {} //]]> </script>
  7. I'm already using number_format() it shows the commas but for a number like 1500.53 the 1500 becomes 1,500 but the .53 disappears. Is there a better way?
  8. How do I print isset on this form? Thanks <?php $var = $result['email']; if (!empty($var)) { if (isset($_POST['submit'])) { if(isset($_POST['answer']) && $_POST['answer'] == '2'){ $to = "$var"; // change to your email address $name = htmlspecialchars ($_POST['name']); $email = htmlspecialchars ($_POST['email']); $phone = htmlspecialchars ($_POST['phone']); $msg = htmlspecialchars ($_POST['msg']); $d = date('l dS \of F Y h:i:s A'); $sub = "My Domain RE:".$result['title'].""; $headers = "From: $name <$email>\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $mes = "phone: ".$phone."\n"; $mes .= "Message: ".$msg."\n"; $mes .= "Name: ".$name."\n"; $mes .= 'Email: '.$email."\n"; $mes .= 'Date & Time: '.$d; mail($to, $sub, $mes, $headers); echo "<div align='center'<span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #F00;'>Email Has Been Sent</span></div>"; } else { echo "<div align='center'<span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #F00;'>ANSWER does not match! </span></div>"; } } echo "<div align='center'><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #00F;'>Email: ".$result['contact']."</span></div> <form method='post' action='apt.php?id=$id' name='contact' onSubmit='return Blank_TextField_Validator()'> <input name='name' type='text' size='40' placeholder='Name' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['name'])."'/><br> <input name='email' type='text' size='40' placeholder='Email' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['email'])."'/><br> <input name='phone' type='text' size='40' placeholder='Phone' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['phone'])."'/><br> <textarea name='msg' cols='29' rows='4' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['msg'])."' id='msg'></textarea><br> <div align='left'><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 12px; color: #000;'>What is 2 + 2? </span><br><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 12px; color: #000;'>Answer: </span><input name='answer' type='text' id='answer' size='3' maxlength='3' /><input type='submit' class='button4' value='Send' name='submit' /></div> </form><br><br><br>";}?>
  9. Ok so instead of using captcha code I will be using a question instead. It works but now how can I use print isset on this: <?php $var = $result['email']; if (!empty($var)) { if (isset($_POST['submit'])) { if(isset($_POST['answer']) && $_POST['answer'] == '2'){ $to = "$var"; // change to your email address $name = htmlspecialchars ($_POST['name']); $email = htmlspecialchars ($_POST['email']); $phone = htmlspecialchars ($_POST['phone']); $msg = htmlspecialchars ($_POST['msg']); $d = date('l dS \of F Y h:i:s A'); $sub = "My Domain RE:".$result['title'].""; $headers = "From: $name <$email>\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $mes = "phone: ".$phone."\n"; $mes .= "Message: ".$msg."\n"; $mes .= "Name: ".$name."\n"; $mes .= 'Email: '.$email."\n"; $mes .= 'Date & Time: '.$d; mail($to, $sub, $mes, $headers); echo "<div align='center'<span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #F00;'>Email Has Been Sent</span></div>"; } else { echo "<div align='center'<span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #F00;'>ANSWER does not match! </span></div>"; } } echo "<div align='center'><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #00F;'>Email: ".$result['contact']."</span></div> <form method='post' action='apt.php?id=$id' name='contact' onSubmit='return Blank_TextField_Validator()'> <input name='name' type='text' size='40' placeholder='Name' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['name'])."'/><br> <input name='email' type='text' size='40' placeholder='Email' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['email'])."'/><br> <input name='phone' type='text' size='40' placeholder='Phone' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['phone'])."'/><br> <textarea name='msg' cols='29' rows='4' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['msg'])."' id='msg'></textarea><br> <div align='left'><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 12px; color: #000;'>What is 2 + 2? </span><br><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 12px; color: #000;'>Answer: </span><input name='answer' type='text' id='answer' size='3' maxlength='3' /><input type='submit' class='button4' value='Send' name='submit' /></div> </form><br><br><br>";}?>
  10. I'm having a problem with captcha code. I keep getting the echo message "CAPTCHA CODE does not match!" everytime I send it . What am I not seeing? Please open my eyes to the error. Thanks in advance. <?php session_start(); include "config.php"; $id = (int)$_GET['id']; $res = mysql_query($query, $bd); $id = (int)$_GET['id']; $id = substr($id, 0,5); if($id < 1 || $id > 99999) exit; $query = "SELECT * FROM `units` WHERE `id` = $id"; $res = mysql_query($query, $bd); $result = mysql_fetch_assoc($res); $contact = $result['contact']; $phone = $result['phone']; $var = $result['email']; if (!empty($var)) { if (isset($_POST['submit'])) { if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) { $to = "$var"; // change to your email address $name = htmlentities ($_POST['name']); $email = htmlentities ($_POST['email']); $phone = htmlentities ($_POST['phone']); $msg = htmlentities ($_POST['msg']); $d = date('l dS \of F Y h:i:s A'); $sub = "My Domain RE:".$result['title'].""; $headers = "From: $name <$email>\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $mes = "phone: ".$phone."\n"; $mes .= "Message: ".$msg."\n"; $mes .= "Name: ".$name."\n"; $mes .= 'Email: '.$email."\n"; $mes .= 'Date & Time: '.$d; mail($to, $sub, $mes, $headers); echo "<div align='left'<span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #F00;'>Email Has Been Sent</span></div>"; } else { echo "<div align='left'<span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #F00;'>CAPTCHA CODE does not match! </span></div>"; } } echo "<div align='left'><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #00F;'>Email: ".$result['contact']."</span></div> <form method='post' action='apt.php?id=$id' name='contact''> <input name='name' type='text' size='40' placeholder='Name'/><br> <input name='email' type='text' size='40' placeholder='Email'/><br> <input name='phone' type='text' size='40' placeholder='Phone'/><br> <textarea name='msg' cols='29' rows='4'></textarea><br> <div align='left'><img src='http://www.mydomain.co/CaptchaSecurityImages.php?width=100&height=40& characters=5' alt='captcha' width='75px'/><br><input name='security_code' type='text' id='security_code' /><input type='submit' value='Send' class='button' name='submit' /></div> </form><br><br><br>";}?>
  11. Thanks DaveyK that was the problem don't know why I was doing that. $profile = trim($result['profilepic']);
  12. Trim does not work on this. Am I doing it wrong? Thanks <?php $profile = trim("".$result['profilepic'].""); $pic = !empty($profile) ? "<img src='http://www.mydomain.co/user/".$result['profilepic']." width='100'>" : "<img src=\"http://www.mydomain.co/images/avatar.jpg\" width='100'>";?> <? echo $pic; ?>
  13. I'm having a problem with captcha code. I keep getting the echo message "CAPTCHA CODE does not match!" everytime I send it . What am I not seeing? Please open my eyes to the error. Thanks in advance. <?php session_start(); include "config.php"; $id = (int)$_GET['id']; $res = mysql_query($query, $bd); $id = (int)$_GET['id']; $id = substr($id, 0,5); if($id < 1 || $id > 99999) exit; $query = "SELECT * FROM `units` WHERE `id` = $id"; $res = mysql_query($query, $bd); $result = mysql_fetch_assoc($res); $contact = $result['contact']; $phone = $result['phone']; $var = $result['email']; if (!empty($var)) { if (isset($_POST['submit'])) { if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) { $to = "$var"; // change to your email address $name = htmlentities ($_POST['name']); $email = htmlentities ($_POST['email']); $phone = htmlentities ($_POST['phone']); $msg = htmlentities ($_POST['msg']); $d = date('l dS \of F Y h:i:s A'); $sub = "My Domain RE:".$result['title'].""; $headers = "From: $name <$email>\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $mes = "phone: ".$phone."\n"; $mes .= "Message: ".$msg."\n"; $mes .= "Name: ".$name."\n"; $mes .= 'Email: '.$email."\n"; $mes .= 'Date & Time: '.$d; mail($to, $sub, $mes, $headers); echo "<div align='left'<span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #F00;'>Email Has Been Sent</span></div>"; } else { echo "<div align='left'<span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #F00;'>CAPTCHA CODE does not match! </span></div>"; } } echo "<div align='left'><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #00F;'>Email: ".$result['contact']."</span></div> <form method='post' action='apt.php?id=$id' name='contact''> <input name='name' type='text' size='40' placeholder='Name'/><br> <input name='email' type='text' size='40' placeholder='Email'/><br> <input name='phone' type='text' size='40' placeholder='Phone'/><br> <textarea name='msg' cols='29' rows='4'></textarea><br> <div align='left'><img src='http://www.mydomain.co/CaptchaSecurityImages.php?width=100&height=40& characters=5' alt='captcha' width='75px'/><br><input name='security_code' type='text' id='security_code' /><input type='submit' value='Send' class='button' name='submit' /></div> </form><br><br><br>";} ?>
  14. I just used it and although it has the same function as the php but that ugly box still appears. Thanks CPD. It is just an eye sore.
  15. Is there a javascript equivalent to this php script? I have these ugly boxes that apear after a user deletes his or her images in a edit form. It appears in IE I have no clue why they appear even using this in php. Maybe a client script can work? Thanks guys <?PHP $image04 = !empty($rows['image04']) ? "<img src=\"http://www.mydomain.co/user/{$rows['image04']}\" width='100'>" : "<img src=\"http://www.mydomain.co/user/images/classified/no-image.png\" width='100'>";?>
  16. Nevermind the fields were named differenttly. DOH!
  17. No errors just dosen't do what it is suppose to do.
  18. I have a few fields in which I just want the user to input numbers. I thought I wrote the srcipt correctly but it seems not be working. Can anyone please tell me what I am doing wrong. I very new to this. Thanks <script Language="JavaScript"> <!-- function Number_Validator() { var valid = true; if(isNaN(refine_table.min_sq.value)) { alert("Only numbers are allowed in the Square Footage fields."); refine_table.min_sq.focus(); return (false); } if (!valid) alert(msg); if(isNaN(refine_table.max_sq.value)) { alert("Only numbers are allowed in the Square Footage fields."); refine_table.max_sq.focus(); return (false); } if (!valid) alert(msg); if(isNaN(refine_table.min_price.value)) { alert("Only numbers are allowed in the Amount fields."); refine_table.min_price.focus(); return (false); } if (!valid) alert(msg); if(isNaN(refine_table.max_price.value)) { alert("Only numbers are allowed in the Amount fields."); refine_table.max_price.focus(); return (false); } if (!valid) alert(msg); return valid; } --> </script>
  19. Ok Thanks guys but I have done both changes and it still selects $a = "http://user.mydomain.co/apteditform.php?id=".$rows['id'].""; These are the changes <?php error_reporting(E_ALL); ini_set('display.errors', 1); include('config.php'); $db_name=""; // Database name $tbl_name=""; // Table name // Connect to server and select database. mysql_select_db("$db_name")or die("cannot select DB"); // get value of id that sent from address bar $id=$_GET['id']; // Retrieve data from database $sql="SELECT * FROM $tbl_name WHERE id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); $a = "http://user.mydomain.co/apteditform.php?id=".$rows['id'].""; $b = "http://user.mydomain.co/commeditform.php?id=".$rows['id'].""; $unit = "".$rows['unit'].""; if ( "$unit == 'Apartment'" ) { header ("Location: $a"); } elseif ( "$unit == 'Commercial'" ) { header ("Location: $b"); } ?>
  20. What I would like it to do is if the column equals to "Apartments" then to direct the user to apteditform.php or if the Column equals to "Commercial" then direct the user to commeditform.php I added error reporting and this is what it reads: "Notice: A session had already been started - ignoring session_start() in /home/content/84/10858584/html/user/timeout.php on line 2 Warning: Cannot modify header information - headers already sent by (output started at /home/content/84/10857784/html/user/timeout.php:2) in /home/content/84/10858584/html/user/timeout.php on line 9 Warning: Cannot modify header information - headers already sent by (output started at /home/content/84/10857784/html/user/timeout.php:2) in /home/content/84/10858584/html/user/redirectedit.php on line 33"
  21. Alright so I'm trying to create a redirect script where it determines where to direct the user based on what the column equals to. Can anyone please "direct" me in how to accomplish this? This what I have so far: <? include('config.php'); include('lock.php'); include('timeout.php'); $db_name=""; // Database name $tbl_name=""; // Table name // Connect to server and select database. mysql_select_db("$db_name")or die("cannot select DB"); // get value of id that sent from address bar $id=$_GET['id']; // Retrieve data from database $sql="SELECT * FROM $tbl_name WHERE id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); $a = "apteditform.php?id=".$rows['id'].""; $b = "commeditform.php?id=".$rows['id'].""; $unit = "".$rows['unit'].""; if ( "$unit == 'Apartment'" ) { header ("Location: $a"); } elseif ( "$unit == 'Commercial'" ) { header ("Location: $b"); } ?> Thanks
  22. HA! Its late here in NY. Need to go to sleep, but I changed and it still does not delete. This is what I have now: <?php include('config.php'); if($_SERVER["REQUEST_METHOD"] == "POST") { // Username from link $username=htmlentities($_GET['username']); $confirm_code=htmlentities($_GET['confirm_code']); $tbl_name1="forgetpass"; // Retrieve data from table where row that match this passkey $sql1="SELECT * FROM $tbl_name1 WHERE confirm_code ='".$confirm_code."'"; $result1=mysql_query($sql1); // If successfully queried if($result1){ // Count how many row has this passkey $count=mysql_num_rows($result1); // if found this passkey in our database, retrieve data from table "temp_members_db" if($count==1){ ; $rows=mysql_fetch_array($result1); $username=$rows['username']; }else{ $password=mysql_real_escape_string($_POST['password1']); if(!$_POST["password1"] || !$_POST["password2"]){ $error="Please fill the required fields"; }else if(empty($username)){ $error="No Confirmation Link Sent"; }else if($_POST["password1"] != $_POST["password2"]){ $error="PASSWORDS do not match!"; //validate password length }else if(strlen($_POST["password1"]) < 6){ $error="PASSWORD is too short! Must be 6 characters long"; }else{ $password=$_POST['password1']; // it is acceptable, so hash it $encrypt_password="Some Hashing"); // Insert data into database $sql2="UPDATE user SET password = '$encrypt_password' WHERE username = '$username'"; $result2=mysql_query($sql2); // if suceesfully inserted data into database, send confirmation link to email if($result2){ $status="Your Password Has Been Reset"; // Delete information of this user from table "temp_members_db" that has this passkey $sql3="DELETE FROM $tbl_name1 WHERE confirm_code = '".$confirm_code."'"; $result3=mysql_query($sql3); } } } } } ?>
  23. After the script moves the info into the new database it does not delete the row. <?php include('config.php'); if($_SERVER["REQUEST_METHOD"] == "POST") { // Username from link $username=htmlentities($_GET['username']); $confirm_code=htmlentities($_GET['confirm_code']); $tbl_name1="forgetpass"; // Retrieve data from table where row that match this passkey $sql1="SELECT * FROM $tbl_name1 WHERE confirm_code ='$passkey'"; $result1=mysql_query($sql1); // If successfully queried if($result1){ // Count how many row has this passkey $count=mysql_num_rows($result1); // if found this passkey in our database, retrieve data from table "temp_members_db" if($count==1){ ; $rows=mysql_fetch_array($result1); $username=$rows['username']; }else{ $password=mysql_real_escape_string($_POST['password1']); if(!$_POST["password1"] || !$_POST["password2"]){ $error="Please fill the required fields"; }else if(empty($username)){ $error="No Confirmation Link Sent"; }else if($_POST["password1"] != $_POST["password2"]){ $error="PASSWORDS do not match!"; //validate password length }else if(strlen($_POST["password1"]) < 6){ $error="PASSWORD is too short! Must be 6 characters long"; }else{ $password=$_POST['password1']; // it is acceptable, so hash it $encrypt_password="Some Hashing"; // Insert data into database $sql2="UPDATE user SET password = '$encrypt_password' WHERE username = '$username'"; $result2=mysql_query($sql2); // if suceesfully inserted data into database, send confirmation link to email if($result2){ $status="Your Password Has Been Reset"; // Delete information of this user from table "temp_members_db" that has this passkey $sql3="DELETE FROM $tbl_name1 WHERE confirm_code = '$confirm_code'"; $result3=mysql_query($sql3); } } } } } ?>
  24. How can I implement failed attempts with "x" amount of times into the login script below. Solely locking on a IP/username basis. I set up a separate DB like this failed_logins: IP/uusername/failed_attempts The login script: <?php include("config.php"); session_start(); if($_SERVER["REQUEST_METHOD"] == "POST") // username and password sent from Form $myusername=mysql_real_escape_string($_POST['username']); $mypassword=mysql_real_escape_string($_POST['password']); $passcode="Some Hashing Done Here"; // Encrypted Password if (($strUser != "$myusername")&&($strPassword != "$passcode")){ $sql="SELECT id FROM user WHERE username='".$myusername."' and password='".$passcode."'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ $_SESSION['myusername']; $_SESSION['login_user']=$myusername; header("location: index.php"); } else{ $error="Your Login Name or Password is invalid"; } } ?>
×
×
  • 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.