Jump to content

aysiu

Members
  • Posts

    33
  • Joined

  • Last visited

aysiu's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. No, it's definitely something with the blob text. If I send a regular HTML email in the message body not referencing the blob, the HTML turns out just fine (bold, italics, hyperlinks). If I send the blob, the text is all weird without spaces. Anyone else have ideas for things to try or test?
  2. Actually, that doesn't solve the problem, but that may point me in the right direction. Thanks. The source appears to be just plain text... no HTML whatsoever. Even though I've done HTML emails in the past with no problem, there's something about this blob of text that's negating the HTML piece.
  3. This is rather odd, but I'm pulling text out of a blob from a database most people have never heard of (4D), using PDO. When I pull the data out and display it on a webpage using PHP, it shows up just fine. When I pull the same data out and email it using the PHP mail function, it shows up weirdly spaced (see the attached screenshot to see the difference--weird spacing on top, proper spacing below). In the regular webpage display, I'm using the variable PDO pulled out: echo $row['EMAIL_BLB']; For email, I'm using that same variable to be the message: $message=$row['EMAIL_BLB'] For the headers, I've tried using $headers .='Content-type: text/html; charset=iso-8859-1' . "\r\n"; or $headers .='Content-type: text/html; charset=utf-8' . "\r\n"; or even no charset specified at all. Same result, regardless of charset. Has anyone ever since this behavior before? Is there a PHP function that would fix this before outputting to a message? Thanks in advance. P.S. Unfortunately, it's not an option to originally store the data as regular text instead of a blob. It's a blob of text, which displays fine on a webpage... just not in an email.
  4. Use prepared statements, and use mysqli or PDO instead of mysql.
  5. Another way to do it may be something like this: echo '<td>' . date("d-m-Y", strtotime($row['etd'])) . '</td>';
  6. I'm going to say it's not a very good idea to post up login credentials to a public website so that anyone can modify your code! What I'd recommend instead is you tell us what you've tried, what hasn't worked, and where you're stuck, and then folks can help you tweak things.
  7. Are you the one submitting this information, or can any random person on the internet submit the information? If it can be just anyone, you may want to avoid SQL injection attacks by using prepared statements.
  8. This question is a bit broad. Yes, this can be done, but there are several smaller pieces you have to put together. What you're asking in this one thread is a bit like me saying "I don't speak a word of French, but I want to write this best-selling French novel. How do I do that?" Obviously, learn French. Learn the vocabulary, learn the syntax. Learn how to write a novel. For you, it'll be a bit simpler than writing a novel, but there are several pieces you need: 1. Learn how to do basic PHP - using variables, validating input, printing stuff back to the web browser 2. Learn how to create a connection string to a MySQL database 3. Learn a few basic MySQL queries 4. Learn PDO or mysqli_ (not mysql_) so you can connect your PHP knowledge with your MySQL knowledge 5. Finally, logic out the submission of a form and how that queries the database and returns data
  9. That's not why you're getting an error. You're getting an error because your query failed. The hash thing is a separate but very real problem. It looks as if you're storing your passwords in plain text instead of hashing them.
  10. It means this query failed: $sql = "SELECT * FROM users WHERE email = '".$email."' AND password = '".$password."' LIMIT 1 "; $res = mysql_query ($sql); P.S. The mysql extension is deprecated: http://www.php.net/manual/en/intro.mysql.php P.P.S. You should hash your passwords: http://us2.php.net/manual/en/function.password-hash.php
  11. Maybe I'm silly, but I kind of like putting in the backticks for all of them, as well as the quotation marks for consistency. Does that hamper the performance of the query? Just curious.
  12. Does your insert query now look like this? mysqli_query($con,"INSERT INTO `battery` (`Range`, `Percent`, `Sleep`) VALUES ('$miles', '$battery_level', '1')");
  13. You're using PHPMyAdmin? Good. What happens when you leave the PHP aside for now and use PHPMyAdmin and paste this in as a SQL query? select * from products
  14. It's referring to this line here: $mail ($to, $subject, $message); What command are you executing there? PHP thinks the command you're executing is deanong96@gmail.com(); which is an undefined function.
  15. Either products isn't a real table, the table is totally empty, or the db.php include at the beginning did not successfully connect you to the database. P.S. From the PHP website: The extension they're talking about is the one you're using.
×
×
  • 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.