• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

PHP Help!


Stuart Leyland

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 :)



I'm sorry Hal...
Political User
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 :)

Stuart Leyland


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.


Stuart Leyland

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 posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member