Jump to content

aysiu

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by aysiu

  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.
  16. So is there just one table with all those fields? And if a player has played five years, that one player has five separate records in that one table?
  17. Are you sure the POST data is even being set? Before this bit $user = $_POST['username']; $pass = $_POST['password']; echo $user; Try putting in this if(isset($_POST['username'])){ echo '<p>There is a username set, and it is ' . $_POST['username'] . '</p>'; } else { echo '<p>There is no username set.</p>'; }
  18. This is your form action: <form action="" method="post"> Can you change that to <form action="adminlogin.php" method="post"> and try again?
  19. That's not simple. If you use a traditional GET or POST submission of a form, the page will be reloaded and then will show the top of the page by default. I guess you could put in some kind of anchor in the middle of the page, but it would still reload to the top and then jump down to the middle afterwards. Look into AJAX. It's not simple, but that'll do what you want.
  20. This doesn't sound like the proper approach. If I'm understanding what you've described correctly, you basically don't have a database... you have a whole bunch of different databases that you try to merge together periodically. Instead of having people work with CSVs that they update manually and then have to upload to merge with the real MySQL database, create PHP forms to have them update the MySQL database directly. Again, perhaps I'm not understanding you correctly, but it sounds as if there are multiple people working with a bunch of contacts. Each person then sends out emails and marks "Oh, this person has been sent a newsletter... that person moved to a different state" but marks these on a CSV file, which she then has to upload, and then that CSV gets parsed... this is not ideal and creates a lot of overhead (you have to upload and process the entire CSV, even if there are only a few changes, and if there is any shared data, it isn't being updated in real time). Instead, each person should have a PHP form to edit contacts and mark address changes or newsletter sends, which would then immediately be directly changed in the MySQL database.
  21. Oh, you want to be able to store it and bring it back later as PHP? Then leave out the <?php and ?> parts.
  22. Sorry. My bad. Yes, please hash instead of encrypting! $hash=password_hash($password, PASSWORD_DEFAULT); And later, to check an entered password: if(password_verify($password, $hash)){ echo 'It matches.'; }
  23. You want to execute your own code? Just stick some PHP in there. For example: <textarea> <?php echo 'Here is some PHP code'; ?> </textarea>
  24. This code doesn't make sense. 1. You define $find_multiple as one query, and then in the next line, you completely overwrite the first query with a second query. 2. As someone mentioned earlier, there's no point in selecting out something you already know. Your first query (that gets overwritten) says "Select the username I already know if the username matches the username I already know." Then your second query says "Select the password I already know if the password matches the password I already know." 3. Also, this isn't necessarily an error, but it looks very suspicious: is your table name actually resgistration and not registration? 4. The mysql_ extension is deprecated. You should use mysqli or PDO. 5. It seems as if you're storing your passwords in plain text instead of encrypting them. You should encrypt them.
×
×
  • 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.