PHP Code:
$db_post=$_POST['db-s1'];
if (is_null($db_post) && empty($db_post))
{
$db_set=1;
}
if(!empty($db_post) && (!$db_post==""))
{
$db_test=mysql_select_db($db_post);
if(!$db_test){
echo "Database Not Exist";
}
else
{
$db_set=0;
}
if the $db_post empty then it set flag to 1
if the $db_post is not empty if user wrote some value like db then it check whether the database exist then it set to flag 1.
but if not exist the database it show database not exists let us create. and set flag to 1 so it create database.
please help for this criteria