Jump to content

Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in


crumpy1

Recommended Posts

Hi All,

 

I am trying to create a PHP code that will run a form, however i keep getting the error message

 

Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in D:\xampp\htdocs\HFCC\Scripts\mailprocess.php on line 55

 

Invalid email address entered. Go Back and try again

 

attached is the complete copy of the code i am using, i have an email text box and label with the id 'email' also my method is POST and my action is Scripts/mailprocess.php.

 

Please let me know if you need any additional details. Any help will be much appreciated.

 

Thanks

17404_.php

Link to comment
Share on other sites

There was no need to post the entire file, we just needed line 55:

 

if(!preg_match("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){

The problem is you're not including a delimiter before and after the pattern, therefore PHP is thinking that your delimiter is "^", but of course you're missing the closing delimiter. This is an easy problem to solve, just have a quick read about delimiters in the manual first.

Link to comment
Share on other sites

Thank you for the quick response, i have only just started dabbling with PHP so i posted the whole code just in case, i will remember for next time. I have read the link you gave me but i really do not understand it. I do not start studing PHP until May so i am lost with all of it. Can you please tell me how to correct this code as i genuinly have no clue  :confused:

Link to comment
Share on other sites

Can you please tell me also where or how i can link the thank you message to a webpage instead of just a plain text message. This is the code for the submission is

 

$thanks="<h1> We have received your message.</h1><br />

<p>We will deal with your enquiry as soon as possible</p> <p><ul><li>Go <a href='http://localhost/HFCC/index/'>Back</a> back to the Home Page/li></ul>"; // This is the message given after successfull submission of form.

 

i will create a new page for this but i am unsure on where to put the url (thats if it can be done at all through PHP).

 

Thank you.

 

Link to comment
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.