0

Does anyone know how i can fix this error.

Undefined variable: email in C:\wamp\www\Root\siginuppage.php on line 57

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

I am trying to set up an email verification form but this error occurs before any data is inputted. The undefined variable is email i can assume but how exactly do i define it??

$email = "$email"  along with $username="" and $password=""    perhaps  ?????

I am ridiculously new to this so a simple answer would be very much appreciated.

hakre
  • 193,403
  • 52
  • 435
  • 836
Daniel o keeffe
  • 51
  • 1
  • 2
  • 8

1 Answers1

0

To start with, variables in php are represented by prefixing a $ sign. So to define a variable $email, you need to do something like this,

 $email = "xyz@pqr.com"; //test email
Teena Thomas
  • 5,139
  • 1
  • 13
  • 17