Jump to content

Recommended Posts

As im looking at webhosts now and my website has some php in it which includes the mail function where the user fills in a form and then when the submit button is pressed the form gets sent to my email address.  In regards to buying a server i know it needs to allow php but does it matter if it simply has PHP or PHP5? 

 

Thanks in advance.

 

 

Link to comment
https://forums.phpfreaks.com/topic/87209-simple-question/
Share on other sites

So basically both these hosting options:http://www.fasthosts.co.uk/hosting/ and http://www.easyspace.com/starter_hosting.php

 

will support this section of php:

 

<?php 
$to = "lucealmighty@hotmail.co.uk";
$subject = "Contact Us";
$name_field = $_REQUEST['name_field'] ;
$email_field = $_REQUEST['email_field'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email_field";
$body = "Name: $name_field \n E-Mail: $email_field \n Message:\n $message";
$sent = mail($to, $subject, $body, $headers) ;
if(!eregi("[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}",$email_field)) print ("<br><br><br><br><p align=\"center\"><strong><font face=\"Verdana, Arial, Helvetica, sans-serif\" font color = \"#FFFFFF\">Invalid E-Mail address please correct the error and try again.</strong></font>");
else if($sent)
{print ("<br><br><br><br><p align=\"center\"><strong><font face=\"Verdana, Arial, Helvetica, sans-serif\" font color = \"#FFFFFF\">Your message was sent successfully</strong></font>"); }
else
{print ("<br><br><br><br><p align=\"center\"><strong><font face=\"Verdana, Arial, Helvetica, sans-serif\" font color = \"#FFFFFF\">We encountered an error sending your message.  Please try again or call us on 07802 414985</strong></font>"); }
?>

 

Thanks in advance.  Really appreciate the help i got through these fourms.

Link to comment
https://forums.phpfreaks.com/topic/87209-simple-question/#findComment-447667
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.