Aplogies, I should have stated that this is the code straight form the book, or the cd at least.
I typed it all myself to learn the concept of the script using my own domain, etc.....
The way the book taught me was this, so you understand.
First I created a form in HTML and saved that file as entermail.html, the form action was to call a script called sendemail.php which had the script to send the email after getting the values from the entermail.html
So that was two scripts to send the e-mail.
It then goes on to show you (the script above) how to create just 1 file to setup the form and send the mail. The above script is not working even if I put in my domain details.
Ignore my ignorence here but this is what I thought strange.
There is a hidden field in the scripts $form_block area called "op" (operation)
That field has a value of "ds" (do something)
So basically what the book is saying is that when you run the script the first time it shows the form as the "op" field has a value of "ds", you can then enter your details in the form.
Following me so far?
Okay so the form action in the script has a value of
$_SERVER[PHP_SELF]
this tell me that your going to run the script again upon the user pressing the submit butotn on the form.
So what should happen now is that the value of "op" should now be not equal (!=) to ds, this would then mean that the script has been run to collect the data and you now want to send the mail and output the "mail sent" message.
So if the value of "op" is not "ds" then the form will not be displayed.
But there is at no point in the script an option to change the value of "op" so how can it tell if something has happened to cause it not to display?
As I say I am new to this but thats my thoughts, anyone care to at least shoot me down and say I am talking rubbish.
:cheesy: