PHP Help!

S

Stuart Leyland

Guest
Hi all.

Hope you can help me here. I'm trying, with little success so far, to create an email program using PHP. Now I'm a novice in all honesty with PHP but I've copied the code from the book "Beginning PHP4" by Wrox Press in Chapter 15 for anyone that has the book.

Here is my attempt: http://www.2312.co.uk/simple_mailer.php.

As you can see there is an error on Line 98. After counting up to Line 98 I found there were no errors and even copied and pasted the correct line from the code which I downloaded from Wrox's website.

Now my question is split into 3:

1. Is a blank line counted as a line when an error such as the above is displayed?

2. How can I check my code (ie: with a program).

3. What's wrong with this code (it's the one used to create the email program)? I have saved it as a text file at http://www.2312.co.uk/simple_mailer.txt.

Thanks for any help you can offer :)

Stuart
 
I can see a few errors, not sure if they are the main problem though

for one in al your html text boxes you put

input_type="mail_from" (or whatever the name) this should be

input type="text" name="mail_from"

you have a function called mailer_handler which never gets used but you call a function called mailer_header which doesn't exist (I assume these are supposed to be the same thing


the error on line 98 is because there is no semi colon on line 97

A good site for simple php tutorials (including form email) is http://www.spoono.com/tutorials/php/

good luck :)
 
Khayman,

You're a star mate :)

Managed to get all the errors sorted out now, there were a few more semi-colons missing as well as that one you mentioned.

Anyway, now the problem is that the blasted thing aint sending any emails! Or, for that matter, bringing up any errors. I get the feeling that I may have mis-typed something but can't find anything obvious.

Again I'd be grateful for any help.

Cheers
Stuart
 
Hi again.

I've now managed to get the thing to send emails. It turns out that it wouldn't send them in Opera but would in Internet Explorer. The reason? I'd spelt form as from :huh:

Anyway, my next objective was to shorten down the code as I found that most of it would not be required. All fine and dandy. But now the main thing I needed this emailer to do was to be able to send attachments and at this point I am stuck. It is in my book how to add attachment capability so to speak but I can't get it to work.

Here is the script: http://www.2312.co.uk/simple_mailer3.php

And here is the code I am using for that: http://www.2312.co.uk/simple_mailer3.txt

Very grateful for any advice.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back