AureliusR Posted March 19, 2013 Share Posted March 19, 2013 (edited) So I hate to bother everyone with what seems to be such a small question, but I assure you I DID search through the forums here looking for an answer... maybe I didn't search hard enough but the book I'm learning from couldn't help me with this problem either. The code I'm working on is a basic mailing list application, made up of three PHP/HTML pages. One for adding emails to the MySQL database table, one to remove, and one to send an email to all the emails in the list. Currently, I'm trying to learn how to make the Subject and Body fields 'sticky' in case the user makes an error and leaves a field blank in the send_email.php. I've tested it a bunch of times and tried to tweak it but the Body field won't stick! I can leave the body empty and add a subject, and the error comes up properly and the subject stays in the subject line, but if I do it the other way the body won't stick. I don't get it because the code is the same for both of them, at least as far as I can tell... Here's a paste of send_email.php. (I blanked out my email and the database password for privacy reasons). They're also teaching us to put everything in one page, instead of having two separate HTML and PHP pages. So I just migrated everything from the HTML page into the PHP page -- and it didn't affect this problem either way. So I think I did that part right. Any and all help is MUCH appreciated!! (PS also -- I do my coding on Linux (specifically Ubuntu and/or Fedora, and I would LOVE to have some sort of debugger for PHP... currently I'm using gedit with a bunch of extra plugins to support PHP coding (auto-completes, highlighting, etc) but I also have Eclipse, which I used to use for Java/Android SDK development. I know it has PHP support but it doesn't seem to work for me... does anyone have any tips? If I could get a debugger working I'm sure that would help solve a LOT of these problems!) (PPS -- the website is currently live at http://aureliusr.mine.nu/ if you want to check it out) Edited March 19, 2013 by AureliusR Quote Link to comment Share on other sites More sharing options...
Solution Jessica Posted March 19, 2013 Solution Share Posted March 19, 2013 Textareas don't have a value, you put the text between the open and closing tags. Quote Link to comment Share on other sites More sharing options...
AureliusR Posted March 19, 2013 Author Share Posted March 19, 2013 MY god... now I'm embarrassed... I should have known that! What about debuggers? Do you use one/can you recommend one? Thanks so much, again, Jessica Quote Link to comment Share on other sites More sharing options...
Jessica Posted March 19, 2013 Share Posted March 19, 2013 (edited) You are the debugger. Edit: However putting your resultant HTML into an HTML Validator might have brought this specific problem to your attention. I use a Firefox plugin that shows me immediately if my site has any errors. Edited March 19, 2013 by Jessica Quote Link to comment Share on other sites More sharing options...
AureliusR Posted March 19, 2013 Author Share Posted March 19, 2013 Right but I mean a plugin of sorts that will go through the code line by line and actively show you how the variables are being changed, and what the interpreter is actually doing behind the scenes. I really like tools like this because they deepen your understanding of the language, and also of how the language actually interacts with all the functions and modules it comes into contact with... Has anyone seen anything like this for PHP/MySQL? They have multitudes of them for C++, Java, etc... but I can't find much for PHP. Perhaps because it's a web-based language? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.