Larry You're right - you should be using 'eq'. But I can't imagine why it's not working.
Try hard-coding a value for $ip and trying it that way: $ip = "192.168.100.377"; if ( $ip eq "192.168.100.100" ) { &process_form; } else { &generate_form("NOT A VALID LOCATION"); exit; } Cheers, Rob ----- Original Message ----- From: "Larry Sandwick" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 27, 2002 6:17 PM Subject: if statement not validating properly > > > In the program below the if statement that qualifies the IP address > never evaluates to be false, for what ever reason the form is always > processed. Can anybody help me with this problem? > > > > The code should only allow computers with certain IP's to access the > data to be processed. I know it sound different, but I have been asked > to validate the IP's which are assigned by building location to access > the data#! > > > > The first time through the code it will always generate the form, and > the second time through it has the ip address and validates the IP and > then processes the form if it has a valid IP. > > > > I have tried the code with "eq" and "==" and it makes no difference. I > would think I need to use the "eq" because it is not a valid number... > [uhm]I could be wrong...would not be the first time! > > It does not matter what the IP is; the "if statement" is always true and > processes the form. > > > > Any suggestions would be appreciated. > > > > See code below > > > > TIA > > Larry > > #----------------------------------------------------------------- > > > > <begin snip> > > > > > > if ( $ip == "192.168.100.100" ) > > { > > &process_form; > > } > > else > > { > > &generate_form("NOT A VALID LOCATION"); > > exit; > > } > [snip function defs] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]