PHP Help!

Discussion in 'Web Design & Coding' started by Stuart Leyland, Apr 11, 2003.

  1. 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:

    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

    Thanks for any help you can offer :)

  2. Khayman

    Khayman I'm sorry Hal... Political User Folding Team

    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

    good luck :)
  3. 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.

  4. 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:

    And here is the code I am using for that:

    Very grateful for any advice.
  5. Khayman

    Khayman I'm sorry Hal... Political User Folding Team