• Content count

  • Joined

  • Last visited

  • Days Won


westman last won the day on March 14 2013

westman had the most liked content!

Community Reputation

10 Good

About westman

  • Rank
  1. what about having 20-30 different connections with different queries on a page. starting each connection/query with $stmt = $conn->prepare("something"); Should I use $stmt->close(); after each connection/query or and the bottom of the page?
  2. I may have about 20-30 different connections with different queries on a page. Should I use $conn->close(); after each query or and the bottom of the page?
  3. But I am not using PDO I am using MySQLi. So is... $stmt = $conn->prepare("SELECT * FROM database WHERE email = ?"); $stmt->bind_param("s", $email); $stmt->execute(); $result = $stmt->get_result(); $numRows = $result->num_rows; if($numRows > 0) { while($row = $result->fetch_assoc()) { $id = $row["id"]; $name = $row["name"]; $age = $row["age"]; }} $stmt->close(); ok for MySQLi?
  4. Is this code safe, up to date, and useful? $stmt = $conn->prepare("SELECT * FROM database WHERE email = ?"); $stmt->bind_param("s", $email); $stmt->execute(); $result = $stmt->get_result(); $numRows = $result->num_rows; if($numRows > 0) { while($row = $result->fetch_assoc()) { $id[] = $row['id']; $name[] = $row['name']; $age[] = $row['age']; }} $stmt->close(); The following code instead of the above. $id = $row["id"]; $name = $row["name"]; $age = $row["age"];
  5. like it. Thank you.
  6. I see that $name = mysql_real_escape_string($name); is not needed to protect agents SQL injections when mysqli is use in a prepared statement on data INSERT. How do we protect our database with SELECT, UPDATE, and DELETE?
  7. thanks
  8. Last question for cron jobs. I have this cron job working fine... /usr/local/cpanel/bin/jailshell -q /home/my_username/public_html/folder/file.php and if I go to www.mysite.com/folder/file.php the code will run. how do I only give access to this file through cron job and not give access through www.mysite.com/folder/file.php
  9. ok. Thank you.
  10. Prepared statements look fun but I have 1,000's of lines of code in different files all using $conn1 = mysql_connect("$servername","$username","$password") or die ("could not connect to mysql"); mysql_select_db("$dbname") or die ("no database"); not $conn1 = new mysqli($servername, $username, $password, $dbname); Do I need to change all my code if I start using mysqli and how will it effect everything else?
  11. Hi all, I used to use $name = mysql_real_escape_string($name); to clean information to store in my database on php 5.4 Now I am using php 5.6 and it seams to be a problem. I was given this code to replace mysql_real_escape_string... function IsInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } The only problem is that I do not understand the code or how to use it. Is there an easier way to clean information and stop SQL injection?
  12. thank you. now working. " was the problem
  13. Hi all, I am looking for the right command to give to run a php file using a cron job. I have tried the following... /usr/local/cpanel/bin/jailshell: -c: /home/my_username/public_html/folder/file.php" /usr/local/cpanel/bin/jailshell -q /home/my_username/public_html/folder/file.php" /usr/local/bin/php -q /home/my_username/public_html/folder/file.php" /usr/bin/php -q /home/my_username/public_html/folder/file.php" and /home/my_username/public_html/folder/file.php" I get this error in an email... /usr/local/cpanel/bin/jailshell: -c: line 0: unexpected EOF while looking for matching `"' /usr/local/cpanel/bin/jailshell: -c: line 1: syntax error: unexpected end of file What command should I give to run a php file from a cron job? My linux server info: cPanel Version 64.0 (build 12) Apache Version 2.4.25 PHP Version 5.6.30
  14. I understand that. However, I am not talking about pgp for messages or email. I am talking about the pgp privet key you receive with your random .onion domain name when you open the Tor browser with the intent of hosting on the dark web. The pgp privet key and the .onion url are linked (meaning the privet key and url are bound together/created together). From my pgp privet key and my .onion url I am trying to find my pgp public key. How do I do that?
  15. Yer, Years of support from this forum I have got. Thank you.