Jump to content
MakeWebGames

undefined offset


Legaci

Recommended Posts

I currently working on a game i am building...

Notice: Undefined offset: 1 in C:\Users\AJ\Downloads\USBWebserver v8.5\USBWebserver v8.5\8.5\root\global_reg.php on line 68

Notice: Undefined offset: 1 in C:\Users\AJ\Downloads\USBWebserver v8.5\USBWebserver v8.5\8.5\root\global_reg.php on line 74

 

else
              {
              $email = explode("@", $_GET['string']);
              $check_for_the_dot = explode(".", $email[1]);
              if(substr_count($_GET['string'], "@") > '1')
              { 
                  echo "<font color='white'><b>No more than one \"@\".</b></font>";
                  exit(); 
              }
              if(!$check_for_the_dot[1])
              { 
                  echo "<font color='white'><b>Email address will be verified.</b></font>";
                  exit(); 
              }

 

Line 68 is : $check_for_the_dot = explode(".", $email[1]);

Line 74 is :if(!check_for_the_dot[1])

Would this work for Line 74

if (isset(!check_for_the_dot[1]))
 !check_for_the_dot = substr(!check_for_the_dot[1]);
Link to comment
Share on other sites

I currently working on a game i am building...

Notice: Undefined offset: 1 in C:\Users\AJ\Downloads\USBWebserver v8.5\USBWebserver v8.5\8.5\root\global_reg.php on line 68

Notice: Undefined offset: 1 in C:\Users\AJ\Downloads\USBWebserver v8.5\USBWebserver v8.5\8.5\root\global_reg.php on line 74

 

else
              {
              $email = explode("@", $_GET['string']);
              $check_for_the_dot = explode(".", $email[1]);
              if(substr_count($_GET['string'], "@") > '1')
              { 
                  echo "<font color='white'><b>No more than one \"@\".</b></font>";
                  exit(); 
              }
              if(!$check_for_the_dot[1])
              { 
                  echo "<font color='white'><b>Email address will be verified.</b></font>";
                  exit(); 
              }

 

Line 68 is : $check_for_the_dot = explode(".", $email[1]);

Line 74 is :if(!check_for_the_dot[1])

Would this work for Line 74

if (isset(!check_for_the_dot[1]))
 !check_for_the_dot = substr(!check_for_the_dot[1]);

You said it yourself - undefined offset.

If there is only 1 result, given arrays start at 0, you need $check_for_the_dot[0]

With that said, you could also just use a function that google could return using a search term like "php email validation"

Link to comment
Share on other sites

With false positives from filter_var?

Not necessarily no. But with filter var that would have checked for the @ and the '.' he was seeking right? Now I'm sure you can do some other high tech regex pattern because the filter_validate_email type does allow a range of chars that you would not normally see in an email address or a super long prefix to the email domain.

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...