Preg_match Problem

Hi All,
This is my first post. Looking forward to being here.
I have a problem with preg_match, I have looked all over to get a fix , but not been able.
I am not familiar with regex.
That said I just need to upload a pdf newsletter, that can be viewed
This is the warning I get :
Email PDF Upload Form
Warning: preg_match(): Unknown modifier ‘+’ in /home/lina/public_html/newsletter/output.php on line 77
Please enter a valid email

This is the code in output.php
// Validation ! ereg

if (! preg_match(’[A-Za-z0-9_-]+@[A-Za-z0-9_-]+.[A-Za-z0-9_-]+’, $email))

{

die(“

Please enter a valid email

”);

}

if( $upload_Size == 0)

{

die(“

Please enter a valid upload

”);

}

if( $upload_Size >2000000)

{

I anyone can show me the change needed , I would be very grateful
Thanks
MORE…i TRIED THIS AND IT UPLOADED, BUT THE PROBLEM IS IF I USE preg_match

here is the results
Deprecated : Function ereg() is deprecated in /home/lina/public_html/newsletter/output.php on line 77

File Transfered

Yeah you should NOT use any ereg function, that may be removed in the future.

So when looking in the manual you will see that the actual regex must be surrounded by delimiters, because additional flags could be served afterwards

https://www.php.net/manual/en/regexp.reference.delimiters.php

Sponsor our Newsletter | Privacy Policy | Terms of Service