Jump to content


  • Content count

  • Joined

  • Last visited

Everything posted by westman

  1. numRows

    My code is not working, here it is... $stmt = $conn->prepare("SELECT id FROM users WHERE email = ?"); $stmt->bind_param("s", $email); $stmt->execute(); $numRows = $stmt->num_rows; $stmt->close(); if($numRows > 0) { $error = "Your Email is already in use. Please try another."; $conn->close(); }else{ // all good $conn->close(); } any help?
  2. numRows

    could you give a link please
  3. numRows

    it is MySQLi
  4. numRows

    how do I do the count query?
  5. numRows

  6. numRows

    It will not show me the error message. There is more than one of the same email in the data base.
  7. image hide path

    Thank you so much. So so so helpful. Image security helps big time. Happy holidays
  8. image hide path

    How do I hide the image path so no user can see the name or folder that my image is in?
  9. image hide path

    lol that gave me the output of the longest url I have ever seen. Thank you. Question. Can it be decoded?
  10. image hide path

  11. edit email script

    works like a charm. Thank you so much
  12. edit email script

    hi all, This is my code. $to = $security_check_email; $from = "system@mysite.com"; $subject = "Verify email"; $message = '<html> <body bgcolor="#FFFFFF"> Dear Member, <br /><br /> Hello <br /><br /> </body> </html>'; $message = wordwrap($message,70); $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $message, $headers); It works and it sends, so whats the problem? The problem is in the attached photo. The email says it is from "system". How do I change that to my site name?
  13. simple email on php 7.1

    Found the problem. It was my subject. Goddady was blacking as spam.
  14. simple email on php 7.1

    I have been using the same script for years to send an email. However, php 7.1 on goddady is new to me, so that mite be the problem. Here is what I have. $message = wordwrap($message,70); $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $message, $headers); I am not getting emails. What is the problem here?
  15. simple email on php 7.1

    $email works fine. I can print it to the page and see the output.
  16. simple email on php 7.1

    Full code below $to = $email; $from = "system@site.com"; $subject = "hello"; $message = '<html> <body bgcolor="#FFFFFF"> Dear Member, <br /><br /> hello <br /><br /> </body> </html>'; $message = wordwrap($message,70); $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $message, $headers);
  17. mail() max loop

    I have used this code... $to = '1@gmail.com'; $to2 = '2@gmail.com'; $to3 = '3@gmail.com'; mail($to, $subject, $message, $headers); mail($to2, $subject, $message, $headers); mail($to3, $subject, $message, $headers); And it works well to send mail to many people at the same time. I have sent mail to 20 people at the same time with this code. My question is: Is there a maximum number (a limit) of emails this code method will work with?
  18. mysql_real_escape_string

    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?
  19. mysql_real_escape_string

    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?
  20. mysql_real_escape_string

    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?
  21. mysql_real_escape_string

    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?
  22. mysql_real_escape_string

    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"];
  23. mysql_real_escape_string

    like it. Thank you.
  24. mysql_real_escape_string

    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?
  25. Cron job -- linux

    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