Tuesday, April 28, 2009

how to get past undefined variables when grabbing a get post that may or may not be there

$title = isset($_GET['title'])?$_GET['title']:'default_title';

if the variable 'title' exists in the $_GET array, $title will take its value, if not, it will take the value you define as default.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
Web Design & Marketing - Click and get an instant quote on your project