| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Nov 2004
Posts: 60
![]() | PHP Form help - beginner :( Hey everyone, I've got a simple PHP mail form working on the intranet at work but now I want to customize it for our use. Basically it's going to be a form that teachers can fill in when there is a lock-down (drill or otherwise) to inform the necessary people that they are okay. The script consists of two files - sendeail.php PHP Code: ...and contact.php PHP Code: - Rather than the user inputting their e-mail address, I need it to always send FROM a specified address (eg. ld@gv.edu.au) - The 'Your Name' field needs to display in the 'Subject:' header of the resulting e-mail - Where it says 'All Students Accounted For?' was actually a 'CC:' option but I just need it to list the YES or NO answer in the resulting e-mail - I also want to add a couple more multi-line text boxes where they can add names of missing students and other staff in the classroom I think that's about it... I'm sorry but I have NO IDEA where to start! Can somebody help me? Thanks heaps in advance! Neil EDIT: Removed e-mail address
Last edited by neilfahey; 11-08-2005 at 11:26 PM.
|
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Member Join Date: Nov 2004
Posts: 60
![]() | I didn't realise it would be that much work? I thought someone could just give me a quick tip... Sorry about that! I can give ya $74 namebucks but you'll have to tell me how (Thats what people do isn't it? I don't even know what they are!) ![]() Maybe I'll look around the web for more help and come back when I've got more specific questions.... Cheers Neil |
| |
| | #4 (permalink) |
| NamePros Regular Join Date: Jun 2004
Posts: 563
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | The PHP mail() command takes four parameters: mail(<email address where it is going to>, <subject>, <body of email>, <additional headers>); All you need to do is alter the variables that you need. For example, to alter what the subject looks like, all you need to do is adjust this lines accordingly: $attn = $attn . "(" . $ccopy . ")" ; The same goes for the other things. -Bob
__________________ Want a way to monitor your website against hacking? Check out CrossCheck.net |
| |
| | #6 (permalink) |
| Tech Support Join Date: Mar 2005
Posts: 4,944
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Is this sort of what you are looking for? mail.php PHP Code: |
| |
| | THREAD STARTER #7 (permalink) |
| NamePros Member Join Date: Nov 2004
Posts: 60
![]() | Darn it! That'll teach me to check my e-mail more often! That looks pretty good but blissfully unaware, I've been having a crack at it myself... Here's what I came up with: (THANKYOU HEAPS SecondVersion FOR YOUR POST!) sendeail.php PHP Code: contact.php PHP Code: This is actually doing EVERYTHING I want it to do now except for two things... - I want the From: field of the resulting e-mail to display either the real address that it comes from or just 'Lockdown Report'... Currently it comes up with name@someobscuredomain.edu.au (where name is what the user has typed as their name) - I was also wondering if it was possible to tabulate the resulting e-mail or at least bold the answers to the questions, so the person who receives the e-mail isn't sifting through it all ????: NamePros.com http://www.namepros.com/showthread.php?t=138666 Hope that's clear enough... Can anyone help? Thanks Neil PS. Thanks again to moondog for getting me started!! Thankfully I've got a little bit of a grounding in programming (from 10 or more years ago) so I was able to figure most things out from there! ????: NamePros.com http://www.namepros.com/showthread.php?t=138666 Just found another problem I'm having trouble with too... If you leave a field blank and click 'Submit' it tells you to go back and fill in all fields, but it still sends the e-mail! Is there any way I can tell it not to send the e-mail in this case?Thanks again, Neil |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP search form | Barrucadu | Programming | 18 | 08-11-2005 09:12 AM |
| Populate a dropdown for PHP form | static1635 | Programming | 6 | 08-10-2005 04:32 AM |
| We customize form for your website at very good price. | shrekwarrior | Web Development Wanted | 0 | 03-25-2005 08:05 PM |