[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-developers] Creating MySQL Database from PHP



Sorry for the top post, but I'm afraid this will get lost otherwise!

The below PHP script is not appropriate for general use -- it requires
register_globals to be on for it to work, which most hosting companies
and web sites have turned off for security reasons. Please see
http://us3.php.net/register_globals for more information.

To the author of this script -- please update the script to support
register_globals="Off" by using the $_POST[] or $_REQUEST[]
superglobals.

Thanks,
Erica Douglass
Lead Web Developer
Simpli, Inc. Web Hosting
http://www.simpli.biz
--
Simpli is now offering dedicated RaQ4s and dedicated RaQ550s starting at
$79/month... including a 100% Network Uptime Guarantee! 
Colocation and virtual hosting also available. 
See www.simpli.biz for details.
--

-----Original Message-----
From: cobalt-developers-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-developers-admin@xxxxxxxxxxxxxxx] On Behalf Of Tik & Klik
Internetdiensten
Sent: Tuesday, July 15, 2003 10:55 AM
To: cobalt-developers@xxxxxxxxxxxxxxx
Subject: RE: [cobalt-developers] Creating MySQL Database from PHP


<HTML>
<HEAD>
<TITLE>MySQL user</TITLE>
</HEAD>
<BODY BGCOLOR=white TEXT=black>
<font face='verdana, arial' size=1>
<?
if( $navn && $kodeord ) {

echo "$addremove user $navn with password $kodeord...<br>";
mysql_connect( "localhost", "root", "$pwdadmin" );
echo mysql_error();




if ( $addremove == "remove" ) {
mysql_query( "drop database $navn" );
echo mysql_error();
}


if ( $addremove == "add" ) {
mysql_query( "CREATE DATABASE $navn" );
echo mysql_error();
}



mysql_query( "GRANT ALL PRIVILEGES ON $navn.* TO $navn@localhost
IDENTIFIED
BY '$kodeord'" );
echo mysql_error();

echo "<BR><CENTER><FONT COLOR=red>User $addremove!</FONT></CENTER><BR>";
echo "<BR></BODY></HTML>\n";
exit;
}
?>

<H3>Add/remove MySQL user</H3><BR>
<P>
<FORM ACTION="index.php" METHOD=post>
<table>
<tr><td><font face='Trebuchet MS, Tahoma, Verdana' size=3>PWD
ADMIN!:</td><td><input type=text size=20 name=pwdadmin></td></tr>
<tr><td><font face='Trebuchet MS, Tahoma, Verdana'
size=2>Username:</td><td><input type=text size=20 name=navn></td></tr>
<tr><td><font face='Trebuchet MS, Tahoma, Verdana'
size=2>Password:</td><td><input type=text size=20
name=kodeord></td></tr>
</table>
<input type="radio" value="add" name="addremove">add<br>
<input type="radio" value="remove" name="addremove" checked>remove<p>
<input type=submit name="Opret" value="Go!"><br>
</p>
</form>
<p>
<font size=-1>
<i>Username is both being used as database name and as MySQL username.
The
new user is granted local and remote access to his database. (select,
insert, update, delete) - but not options for create and drop and no
administrative rights (reload, shutdown, status, etc.). </i>
<br>

this is what i use



Steffan

_______________________________________________
cobalt-developers mailing list
cobalt-developers@xxxxxxxxxxxxxxx
http://list.cobalt.com/mailman/listinfo/cobalt-developers