Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About American_Buddy

  • Rank
  1. Okay, that makes sense, I was just confused how exactly the scripts were able to pick up on using the 'id' but I think you explained it well. Again, I appreciate you taking your time to help me solve this issue -- thanks again!
  2. Thanks Larry, that fixed it, by adding the opening quotation mark, it worked as intended. It's weird because learning the new concepts/syntax of php doesn't seem to be causing me problems, but like every time I hit a roadblock it's like bad HTML or something basic like having the wrong link set up. Anyway, I appreciate your help on this. Perhaps you could clarify for me, or point me to the right resource: I don't understand how the delete_users.php actually knows the 'id' value is the same entered for the user_id from the DB. <a href="delete_user.php?id=' . $row['user_id'] . '">
  3. Hello all, I'm having an issue w/ Script 10.2, wherein I keep getting errors from the first part of the script, wherein you check for a valid ID via GET or POST. Basically, I've read online and most people suggest sessions, which is covered later in the book. I've read some past forums on this site, and I don't think there's an issue w/ the database, as I can add/update password, and view the database entries on the browser. For reference, I'm using PHP 7.4.12. In the browser, I can see the URL when I get to the error page, and the URL is displaying "?=57" or whatever each en
  4. Hello all, I'm having an issue w/ Script 10.2, wherein I keep getting errors from the first part of the script, whereing you check for a valid ID via GET or POST. Basically, I'
  5. Lol, wow that was it. Literally just not double checking my form action in the HTML section was causing the script to be ran on the old, register.php. At least, I'll now know to double check that aspect, and hopefully won't make this mistake again. I really appreciate your help in figuring out this issue, even though it was a mistake in the HTML form action on my end, at least we were able to get it working. Thanks Again Larry!
  6. Hey, I'm going to test that new code you sent later today, but I've been busy on my end. Either way, I was looking into making this a prepared statement, and think I got that aspect figured out, but I noticed something that I think eluded me before. Essentially, we have the register.php for 9.3, originally made without the mysqli_real_escape_string, and at the bottom of which, we have HTML code, that creates the input, using form action="register.php". As I've been working on this, I noticed there was a typo that was displaying at the bottom of my screen, 'jj0j' via HTML. I found that s
  7. No worries -- I'm cool to keep debugging it. Based on your prior response, I put this code on the page: if($dbc) { echo "$dbc"; } else { echo '<p>Submitted last name: ' . $_POST['last_name'] . '</p>'; echo '<p>Established charset: ' . mysqli_get_charset($dbc) . '</p>'; $ln = mysqli_real_escape_string($dbc, trim($_POST['last_name'])); echo '<p>Processed last name: ' . $ln . '</p>'; } And when I do so, I see this printed: So it prints the HTML elements, but not the information called by PHP. For re
  8. I do have an update on this topic, maybe it can help to shed some more light. I double checked my SQL in phpMyAdim -- and my tables have all been collated in utf8_general_ci, but the server collation (in phpMyAdmin) was set to: utf9mb4_unicode_ci. I changed the server collation to match utf8_general_ci, but it looks like the error is still persistent. I also changed the mysqli_set_charset() in mysqli_connnect.php to ...($dbc, 'utf8_general_ci) to see if that would have any affect, but it looks like that's not the case. I also accessed the mySQL from the terminal and could find/edit al
  9. Thanks for the reply, Larry. I double checked my database in myPHP admin, to make sure it's using UTF8, and it says the collation is 'utf8_general_ci' but that's how all my databases have been set up, so I think that's good to go. I fixed the mysqli_connect syntax, but the issue is still happening where I can enter a name w/o an apostrophe, but not one including the special character. I had some issue printing the value of $dbc to confirm it's an object: require('../mysqli_connect.php'); echo "$dbc"; and got the error message: Recoverable fatal error: Object of class mysqli
  10. Hey Larry, Thanks for getting back to me, I really appreciate it. Also, really digging the book, I'm starting to feel much more confident in the PHP and SQL -- the book and forum is very helpful in learning this, and this knowledge has helped me me a ton in my work, so thank you! Regarding your suggestion, I double checked my script, and it has the CHARSET in it, I'll attach that code below. One other thought I had is that it might have something to due with a setting in mySQL. In chapter 7, I can't remember the script, but I got an error, and upon reading the forums, I fou
  11. Hello, Basically, I'm on script 9.5, using mysqli_real_escape_string(). After making the changes to the 9.3 script, I went to enter the name information, but what's weird is this: I can enter a name if there is no apostrophe or problematic characters, but still can't add to the database if those characters exist. For example: I can connect to the database and insert a record using "Sinead Oconnor" -- and when I look in the database, I can confirm that is uploading correctly I get an error message if I try the same with "Sinead O'Connor" - and can confirm this data is not sent
  12. Hey Carbs, I appreciate the heads up on the white space, and tightened it up, but didn't see a difference. When I was doing that though, I looked at the whole file w/ 'fresh eyes,' and caught that I had missed an underscore in the validation check: && is_numeric($_POST['gallon price']) && -- there should be an underscore between gallon and price. I added the underscore and it worked perfectly. Thank you for your time looking this over for me! Crazy how a little slip up like that got me and bottlenecked my progress, but it's a mistake I'll likely not make as mu
  13. Hello All! I'm hoping to get some help with my validation check on this exercise. Basically what's happening is the calculator will work, but only if I comment out the 'minimal form validation' php script. I read in an earlier post that it might have something to do w/ missing braces, but I don't think that's the case as I've looked at this code both in VS Code and Brackets and both show the braces as being balanced. I also don't get any errors when debugging or saving the .php file. I have a hunch it might have something to do w/ the radio options in the HTML portion, or the value o
  • Create New...