This is such a n00b question, I feel ashamed asking given my post count here at devnetwork. Nevertheless, I got into OOP now (joined the dark side, so to speak
Code: Select all
$userid = $_GET['userid'];
if (is_valid($userid)){ //where is_valid is a custom method that returns true if the user exists and false if he doesn't
$user = new User ($userid);
}
else{
echo "mistake in userid";
}Thank you and happy holidays!