View Full Version : Web Mailer Help..
.Matt
July 31st, 2005, 04:43 PM
Yes.. i am a complete idiot when it comes to php... I'm trying to make a webmailer with that Spoono PHP Tutorial. (http://www.spoono.com/php/tutorials/tutorial.php?id=6) and im having some trouble.. not a lot just some. What code goes into which files? :smirk:
THats all
Ankou
July 31st, 2005, 06:46 PM
For the page you're linking all the code goes in to one php file called "comments.php".
You see the form tag and where it says "action=comments.php"? That's the name of the file.
What's happening is when a user loads the "comments.php" page for the first time the variable $submit has no value. That's where the line if($submit) comes into play. Since there is no value for $submit that fails and you use the else{ ... } portion of the code.
The else{ ... } is the part that displays the actual form asking for the users email address, subject line, and comment. When the user fills in that infomarion and hits the submit button the line: <input type="submit" name="submit" value="submit"> recalls the comments.php page BUT this time $submit = submit. Because of that when the page reloads the if($submit) line comes into play because now $submit has a value of $submit.
I have to say though that I'm not a fan of that tutorial - at least for people who don't know PHP. I'd like to see the actual calls (like $submit = $_POST['submit']; ) in there so you know - or could see - what was going on. If you don't see that and you're not familiar with PHP it's easy to get confused. Sadly... not one of Spoono's better tutorials.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.