Page 3 of 3

Re: Sendmail.php

Posted: Thu Feb 07, 2008 4:41 am
by hairytea
Everah | Please use the proper bbCode tags when posting code in the forums. You can use [code], [php] for PHP code, [{LANG}] or [syntax="{LANG}"] (where {LANG} is the lowercase name of the language you want to highlight with) to highlight code blocks.

I have come to the conclusion that my web hosts php interpreter is a bit quirky....i think.

Basically, i have the script working now and functioning correctly after hours of writing, re-writing etc etc....

Here is the completed (working) php code....

Code: Select all

<?php
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;
  $name = $_REQUEST['name'] ;
  $string = "Name: ".$_POST['name']."\n";
  $string .= "E-Mail: ".$_POST['email']."\n";
  $string .= "Message: ".$_POST['message'];
 
  if (!isset($_REQUEST['email'])) {
    header( "Location: http://www.thanweb.co.uk/contactus.html" );
  }
  elseif (empty($email) || empty($message) || empty($name)) {
    header( "Location: http://www.thanweb.co.uk/error.html" );
  }
  else {
    mail("root@thanweb.co.uk", "Website Request Form", $string, "Your website contact form has been used...", "-froot@thanweb.co.uk");
    header( "Location: http://www.thanweb.co.uk/thankyou.html" );
  }
?>
The reason i think the php interpreter is dodgy is as follows.....

Lets say for example i wanted to alter the way in which the content is formatted in the email being sent. If i change the $string variable here ($string = "Name: ".$_POST['name']."\n";) to also include the word 'Your' i would then proceed to alter htis snippet of code to be ($string = "Your Name: ".$_POST['name']."\n";). To me this seems logical and should present no problems???

Obviously not.....by me adding this one piece of text to the string it completely stops the script from working..

So now you can see why it took me so long to create this code as my web hosts php interpreter is very strange indeed and i had to keep writing it until it decided it was happy with my input..

Is it just me or is that very strange indeed??

Everah | Please use the proper bbCode tags when posting code in the forums. You can use [code], [php] for PHP code, [{LANG}] or [syntax="{LANG}"] (where {LANG} is the lowercase name of the language you want to highlight with) to highlight code blocks.

Re: Sendmail.php

Posted: Thu Feb 07, 2008 10:12 am
by RobertGonzalez
That doesn't seem right at all.

Re: Sendmail.php

Posted: Thu Feb 07, 2008 3:07 pm
by hairytea
hairytea wrote:Everah | Please use the proper bbCode tags when posting code in the forums. You can use [code], [php] for PHP code, [{LANG}] or [syntax="{LANG}"] (where {LANG} is the lowercase name of the language you want to highlight with) to highlight code blocks.

I have come to the conclusion that my web hosts php interpreter is a bit quirky....i think.

Basically, i have the script working now and functioning correctly after hours of writing, re-writing etc etc....

Here is the completed (working) php code....

Code: Select all

<?php
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;
  $name = $_REQUEST['name'] ;
  $string = "Name: ".$_POST['name']."\n";
  $string .= "E-Mail: ".$_POST['email']."\n";
  $string .= "Message: ".$_POST['message'];
 
  if (!isset($_REQUEST['email'])) {
    header( "Location: http://www.thanweb.co.uk/contactus.html" );
  }
  elseif (empty($email) || empty($message) || empty($name)) {
    header( "Location: http://www.thanweb.co.uk/error.html" );
  }
  else {
    mail("root@thanweb.co.uk", "Website Request Form", $string, "Your website contact form has been used...", "-froot@thanweb.co.uk");
    header( "Location: http://www.thanweb.co.uk/thankyou.html" );
  }
?>
The reason i think the php interpreter is dodgy is as follows.....

Lets say for example i wanted to alter the way in which the content is formatted in the email being sent. If i change the $string variable here ($string = "Name: ".$_POST['name']."\n";) to also include the word 'Your' i would then proceed to alter htis snippet of code to be ($string = "Your Name: ".$_POST['name']."\n";). To me this seems logical and should present no problems???

Obviously not.....by me adding this one piece of text to the string it completely stops the script from working..

So now you can see why it took me so long to create this code as my web hosts php interpreter is very strange indeed and i had to keep writing it until it decided it was happy with my input..

Is it just me or is that very strange indeed??

Everah | Please use the proper bbCode tags when posting code in the forums. You can use [code], [php] for PHP code, [{LANG}] or [syntax="{LANG}"] (where {LANG} is the lowercase name of the language you want to highlight with) to highlight code blocks.
WTF?

Can you not see from how many posts ive made that im a newbie here???

Instead of great big red writing a simple email or reply would be enough to tell me that you don't like the code put in the forum ic certainways!

A**hole

Re: Sendmail.php

Posted: Thu Feb 07, 2008 3:21 pm
by RobertGonzalez
I already coded two of your posts. I understand that you are a new member here, but after 24 posts you'd think you would have at least a small grasp on our rules.

I also do not appreciate being called names. No one here does. If you have read the rules you would have probably found that out by now too.

We are here to help you but we expect that you would do the smallest bit of your part which is, in effect, following the rules of the board.

Since you made this public I will publicly warn you: continue to call members derogatory names, continue to not follow the rules of the forum, including using code tags and NOT using AOL speak, and I will ban you. Happily.

Enjoy our forums.