You are here: Re: php form 'sometimes' works « PHP Programming Language « IT news, forums, messages
Re: php form 'sometimes' works

Posted by David Haynes on 01/10/06 05:07

bokke wrote:
> Can someone please help me with this?
>
> I have a form that I use on most of my sites - they all worked fine -
> then one day they stopped working. here is the code
>
> <?
> $name=$_POST['name'];
> $phone=$_POST['phone'];
> $email=$_POST['email'];
> $email = preg_replace( '/[\r\n]/', '', $email );
> $comment=$_POST['comment'];
> $to="myname@yahoo.ca";
>
> $message="The E-mail is From:$name\n\nTheir Phone Numbers
> is:$phone\n\nTheir e-mail address is: $email\n\nThey
> wrote:\n\n$comment";
> if(mail($to,"E-mail from myname.ca",$message,"From:$email\n")){
> echo "Thank you $name. Your Information has been sent successfully.
> We will contact you shortly.";
> }else{
> echo"There was a problem sending the messages. <br> <a href='mailto:
> myname@yahoo.ca'>Please click here to e-mail us</a>";
> }
> ?>
>
> I know the page is getting the info from the first page because if I
> change the last line to include $name $phone etc it all appears.
> The preg_replace is purely for spammers.
>
> Where is the error? Any ideas? An aside here - On two of my sites it
> runs fine (a different hosting company though) but this hosting company
> refuses to say it's on their end? - Either way I need this to start
> working yesterday. Please help.
>
> michael
>
A quick thought...
In some systems, <? may not be sufficient. Have you tried it with <?php
at the start. Syntactically, the PHP is fine.

-david-

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация