Jump to content

Almo

New Members
  • Posts

    4
  • Joined

  • Last visited

Almo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks
  2. Can you please give an example ... Iam still in the beginners level. Now I can view the membersprofiles but still have the same error.
  3. thank you for answering me. I will wait to work with PDO
  4. Hi! I am a beginners and need you help I am trying to convert my script from mysql to mysqli, now i have a probem when i click on a memebers image to show his profile. I get this error. Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\www\members\membersprofile.php on line 24 Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\www\members\membersprofile.php on line 33 Warning: mysqli_error() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\www\members\membersprofile.php on line 33 Notice: Query: MySQL Error: in C:\xampp\htdocs\www\members\membersprofile.php on line 33 function SecurityCheckPoint() { //Malicious attacks protection layer if (isset($_GET['id'])) { $id = $_GET['id']; if (!is_numeric($id)) { //redirect this person back to homepage or elsewhere echo"<SCRIPT LANGUAGE=\"JavaScript\"> var URL= 'errorpage.php' window.location.href = URL; </SCRIPT>"; exit(); echo "something is worrong! Jilali"; } else { $id_raw = trim(htmlentities($_GET['id'])); $id_secure = mysqli_real_escape_string($link, $id_raw); // <--- line 24 } } $sql = "SELECT id FROM members WHERE id='$id_secure' LIMIT 1"; $result = mysqli_query($link, $sql)or trigger_error("Query: $result\n<br />MySQL Error: " . mysqli_error($link)); //<--- line 33 if (!$result || (mysqli_num_rows($result) < 1)) { echo"<SCRIPT LANGUAGE=\"JavaScript\"> var URL= 'errorpage.php' window.location.href = URL; </SCRIPT>"; return 1; //Indicates Invalid id submitted. exit(); } echo "something is worrong! "; }
×
×
  • 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.