[Phpwm] Simple PHP Contact Form

Dave Holmes dave at neteffekt.co.uk
Tue Oct 13 23:25:39 UTC 2009


That's sound like a man with snow leopard which foisted 5.3 in as part
of the upgrade ;)

All ours app's started to moan about quite a few things...


Alex Mace wrote:
> Apart from the fact that eregi was deprecated in PHP 5.3 and will be  
> removed in 6...
>
> Alex
>
> On 13 Oct 2009, at 23:09, <phil at infolinkelectronics.co.uk> wrote:
>
>   
>>> You'd be best off performing some sort of regular expression match -
>>> or using the filter extension ...
>>>
>>> $email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
>>> if(!$email) {
>>>        // invalid email address
>>> }
>>> (Requires PHP5, I think my syntax/usage is correct, but I've not
>>> checked it)
>>>       
>> The regex is (acting on the incoming variable $emaila)
>>
>> if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$",
>> $emaila)) error_alert("Invalid Email Address");
>>
>> where:-
>>
>> function error_alert($msg){global $flag; $flag = 1; echo
>> "<script>alert(\"Error: $msg\");history.go(-1)</script>";}
>>
>> Thats from a page where the form, validation and sending are done as  
>> three
>> invocations via a switch, case, do something and break method. a -1  
>> history
>> kickback works.
>> The eregi bit should be fairly PHP version unspecific though.
>>
>> Regards,
>>
>> Phil Beynon
>> Sales & Operations Director
>>
>> ** Infolink Electronic Systems Ltd.
>> ** S/W Birmingham's Longest Established ISV & VAR
>> ** http://www.infolinkelectronics.co.uk
>> ** Professional Web 2.0 Design & Advanced Hosting Platforms
>> ** http://www.coeus-computica.co.uk
>> ** Affordable Knowledgebase Solutions
>> ** Contact: Sales at infolinkelectronics.co.uk
>> ** Tel / Fax 0121 441 3558
>> <Phil Beynon.vcf>_______________________________________________
>> Phpwm mailing list
>> Website : http://www.phpwm.org
>> Twitter : http://www.twitter.com/phpwm
>> Facebook: http://www.facebook.com/group.php?gid=2361609907
>>
>> Post to list: Phpwm at mailman.lug.org.uk
>> Archive etc : https://mailman.lug.org.uk/mailman/listinfo/phpwm
>>     
>
>
> _______________________________________________
> Phpwm mailing list
> Website : http://www.phpwm.org
> Twitter : http://www.twitter.com/phpwm
> Facebook: http://www.facebook.com/group.php?gid=2361609907
>
> Post to list: Phpwm at mailman.lug.org.uk
> Archive etc : https://mailman.lug.org.uk/mailman/listinfo/phpwm
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/phpwm/attachments/20091013/2bba1248/attachment.htm 


More information about the Phpwm mailing list