Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6
Author Message
ThePiston
Worker
Worker



Joined: Dec 22, 2004
Posts: 135

PostPosted: Mon Oct 17, 2005 4:37 pm Reply with quote

I'm trying to add to the "Function userCheck" a function to validate that a variable is not left empty. I tried adding this to the "if" list
Code:
   if ((!$locationid) || ($locationid=="")) $stop = "<center>"._LOCATIONERROR."</center><br>"; 

but it does not work. I added this line to my function too
Code:
    userCheck($locationid);
but still nothing. Anyone have a good easy way to do this?
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon Oct 17, 2005 5:08 pm Reply with quote

Assuming you're using the same userCheck() function in Your_Account/index.php, it is set up for 2 arguments ($username, $user_email). So, when the function is called you call it using arguments that correspond to those values, by position. In other words, the first argument always refers to username. The second always refers to user_email, regardless of the values. Now, you need to add a place-holder for locationid. It doesn'nt matter what you name these place-holders. You could now have function userCheck($username, $user_email, $locationid) or you could have function userCheck($bob, $ted, $carol). The point is that , argA = value_of($bob), argB = value_of($ted), and argC = value_of($carol). So, assuming you are using something more like function userCheck($username, $user_email, $locationid), anytime you call userCheck, the third position is where $locationid must be passed. Something like userCheck($username, $user_email, $locationid);. So, your code of userCheck($locationid); will not work as the function will interpret that $locationid as $username. Clear?
 
View user's profile Send private message
ThePiston







PostPosted: Mon Oct 17, 2005 6:19 pm Reply with quote

crystal, I'll give it a try
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©