Jump to content

Please help PHP question


l!m!t

Recommended Posts


Hello I am just learning PHP I am trying modify some login code to allow me in if my variables match. Basically I have this

        if ($check_customer['level'] == 2 ) {
          $HTTP_GET_VARS['login'] = 'invalid';
    $messageStack->add('login', TEXT_NOT_APPROVED);
        } else {

but want it so if I am level 2 and my IP = xxx xxxx xxx to let me in

example

        if ($check_customer['level'] == 2 ) {
          $HTTP_GET_VARS['login'] = 'invalid';
    $messageStack->add('login', TEXT_NOT_APPROVED);
        } else {
  if ($_SERVER['REMOTE_ADDR'] != 123.12.124.23 && $row['level'] == 2 ){ LET ME IN

Im not sure if its formatted correctly, but maybe someone can help me I have been on this for 24 hours any help would be great.

I just need it to approve me if I am level 2 and if my IP matches, but in needs to deny everyone who is just level 2

Even if you have some example codes I can probably figure it out.

Thanks for your time!!
Link to comment
Share on other sites

One thing to keep in mind with this is that even if you are on broadband you do not always get your own ip address. Providers normally give you an ip address on connection and this can change. Unless you know 100% for sure that you always have the same ip address on different connections I would not use this method. Also you can have more than one user using the same ip address.

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.