I\'m new to PHP programming and I wanted to know that is it possible to handle PHP events as we do in ASP.NET
I mean I\'ve got a img and I want to perform some task
PHP itself does not handle client-side events. And PHP paradigm slightly differs from ASP.NET where client and server-side scripds bound together in the same page of code. On client-side, use javascript to handle onClick event, and in event-handler code issue AJAX call to your designated PHP page to send back a response.
name:
Hell
And this is a test.php code:
Username too short\n";
}
switch($name) {
case 'bob':
case 'jim':
case 'joe':
case 'carol':
return "Username already taken\n";
}
return "Username ok!\n";
}
echo validate(trim($_GET['name']));
?>