You are here: super easy questions « PHP Programming Language « IT news, forums, messages
super easy questions

Posted by walterbyrd on 09/30/64 11:43

I am trying to get user input from a php form. Problem is: the form
doesn't wait for the user to press the submit button, but falls right
through. Therefore the variable I am trying to get, is never set. I
know it has to be something simple, but I'm missing it. Here is the
code:

echo "<form action=\"$PHP_SELF\" method=\"post\">";
echo "Name of new database to create: ";
echo "<br><input type=\"text\" name=\"new_db\">";
echo "<input type=\"submit\" value=\"submit\"><br><br>";
if ($new_db)
{
$create_db = 'CREATE DATABASE '.$new_db;
if (mysql_query($create_db, $conn))
{
echo "Database $new_db created successfully\n";
}
else
{
echo 'Error creating database: ' . mysql_error() . "\n";
}
}
else
{
echo ("new database not created");
};

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация