version 1.51, 2010/09/20 01:00:49 |
version 1.52, 2014/10/06 03:12:33 |
|
|
* http://platon.sk/projects/phpMyEdit/ |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
*/ |
|
|
/* $Platon: phpMyEdit/phpMyEditSetup.php,v 1.50 2007-09-16 12:57:07 nepto Exp $ */ |
/* $Platon: phpMyEdit/phpMyEditSetup.php,v 1.51 2010-09-20 01:00:49 nepto Exp $ */ |
|
|
?> |
?> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
Line 59 if (! defined('PHP_EOL')) { |
|
Line 59 if (! defined('PHP_EOL')) { |
|
: strtoupper(substr(PHP_OS, 0, 3) == 'MAC') ? "\r" : "\n"); |
: strtoupper(substr(PHP_OS, 0, 3) == 'MAC') ? "\r" : "\n"); |
} |
} |
|
|
$hn = @$_POST['hn']; |
$hn = @$_POST['hn']; |
$un = @$_POST['un']; |
$un = @$_POST['un']; |
$pw = @$_POST['pw']; |
$pw = @$_POST['pw']; |
$db = @$_POST['db']; |
$db = @$_POST['db']; |
$tb = @$_POST['tb']; |
$tb = @$_POST['tb']; |
$id = @$_POST['id']; |
$id = @$_POST['id']; |
|
$ssl = @strlen($_POST['ssl']) > 0 ? 'checked' : ''; |
$submit = @$_POST['submit']; |
$submit = @$_POST['submit']; |
$options = @$_POST['options']; |
$options = @$_POST['options']; |
$baseFilename = @$_POST['baseFilename']; |
$baseFilename = @$_POST['baseFilename']; |
Line 162 function get_versions() |
|
Line 163 function get_versions() |
|
|
|
|
|
$self = basename($_SERVER['PHP_SELF']); |
$self = basename($_SERVER['PHP_SELF']); |
$dbl = @mysql_pconnect($hn, $un, $pw); |
$dbl = @mysql_pconnect($hn, $un, $pw, strlen($ssl) ? MYSQL_CLIENT_SSL : null); |
|
|
if ((!$dbl) or empty($submit)) { |
if ((!$dbl) or empty($submit)) { |
echo '<h1>Please log in to your MySQL database</h1>'; |
echo '<h1>Please log in to your MySQL database</h1>'; |
Line 186 if ((!$dbl) or empty($submit)) { |
|
Line 187 if ((!$dbl) or empty($submit)) { |
|
<td><input type="password" name="pw" value="'.htmlspecialchars($pw).'"></td> |
<td><input type="password" name="pw" value="'.htmlspecialchars($pw).'"></td> |
</tr><tr> |
</tr><tr> |
<td>Database:</td> |
<td>Database:</td> |
<td><input type="text" name="db" value="'.htmlspecialchars($db).'"></td> |
<td><input type="text" name="db" value="'.htmlspecialchars($db).'"></td> |
</tr><tr> |
</tr><tr> |
<td>Table:</td> |
<td>Table:</td> |
<td><input type="text" name="tb" value="'.htmlspecialchars($tb).'"></td> |
<td><input type="text" name="tb" value="'.htmlspecialchars($tb).'"></td> |
|
</tr><tr> |
|
<td>Options:</td> |
|
<td><input type="checkbox" name="ssl"'.(strlen($ssl)?' checked="checked"':'').'> use ssl</td> |
</tr> |
</tr> |
</table><br> |
</table><br> |
<input type="submit" name="submit" value="Submit"> |
<input type="submit" name="submit" value="Submit"> |
Line 202 if ((!$dbl) or empty($submit)) { |
|
Line 206 if ((!$dbl) or empty($submit)) { |
|
<input type="hidden" name="hn" value="'.htmlspecialchars($hn).'"> |
<input type="hidden" name="hn" value="'.htmlspecialchars($hn).'"> |
<input type="hidden" name="un" value="'.htmlspecialchars($un).'"> |
<input type="hidden" name="un" value="'.htmlspecialchars($un).'"> |
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
|
<input type="hidden" name="ssl" value="'.htmlspecialchars($ssl).'"> |
<table border="1" cellpadding="1" cellspacing="1" summary="Database selection">'.PHP_EOL; |
<table border="1" cellpadding="1" cellspacing="1" summary="Database selection">'.PHP_EOL; |
for ($i = 0; $i < $num_dbs; $i++) { |
for ($i = 0; $i < $num_dbs; $i++) { |
$db = @mysql_db_name($dbs, $i); |
$db = @mysql_db_name($dbs, $i); |
Line 220 if ((!$dbl) or empty($submit)) { |
|
Line 225 if ((!$dbl) or empty($submit)) { |
|
<input type="hidden" name="un" value="'.htmlspecialchars($un).'"> |
<input type="hidden" name="un" value="'.htmlspecialchars($un).'"> |
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
<input type="hidden" name="db" value="'.htmlspecialchars($db).'"> |
<input type="hidden" name="db" value="'.htmlspecialchars($db).'"> |
|
<input type="hidden" name="ssl" value="'.htmlspecialchars($ssl).'"> |
<table border="1" cellpadding="1" cellspacing="1" summary="Table selection">'.PHP_EOL; |
<table border="1" cellpadding="1" cellspacing="1" summary="Table selection">'.PHP_EOL; |
$tbs = @mysql_list_tables($db, $dbl); |
$tbs = @mysql_list_tables($db, $dbl); |
$num_tbs = @mysql_num_rows($tbs); |
$num_tbs = @mysql_num_rows($tbs); |
Line 251 if ((!$dbl) or empty($submit)) { |
|
Line 257 if ((!$dbl) or empty($submit)) { |
|
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
<input type="hidden" name="db" value="'.htmlspecialchars($db).'"> |
<input type="hidden" name="db" value="'.htmlspecialchars($db).'"> |
<input type="hidden" name="tb" value="'.htmlspecialchars($tb).'"> |
<input type="hidden" name="tb" value="'.htmlspecialchars($tb).'"> |
|
<input type="hidden" name="ssl" value="'.htmlspecialchars($ssl).'"> |
<table border="1" cellpadding="1" cellspacing="1" summary="Key selection">'.PHP_EOL; |
<table border="1" cellpadding="1" cellspacing="1" summary="Key selection">'.PHP_EOL; |
// <tr><td><input type="radio" name="id" value=""> |
// <tr><td><input type="radio" name="id" value=""> |
// <td><i>None</i></td><td><i>No id field required</i></td></tr> |
// <td><i>None</i></td><td><i>No id field required</i></td></tr> |
Line 280 if ((!$dbl) or empty($submit)) { |
|
Line 287 if ((!$dbl) or empty($submit)) { |
|
<input type="hidden" name="db" value="'.htmlspecialchars($db).'"> |
<input type="hidden" name="db" value="'.htmlspecialchars($db).'"> |
<input type="hidden" name="tb" value="'.htmlspecialchars($tb).'"> |
<input type="hidden" name="tb" value="'.htmlspecialchars($tb).'"> |
<input type="hidden" name="id" value="'.htmlspecialchars($id).'"> |
<input type="hidden" name="id" value="'.htmlspecialchars($id).'"> |
|
<input type="hidden" name="ssl" value="'.htmlspecialchars($ssl).'"> |
<table border="1" cellpadding="1" cellspacing="1" summary="Additional options"> |
<table border="1" cellpadding="1" cellspacing="1" summary="Additional options"> |
<tr><td>Base filename</td><td><input type="text" name=baseFilename value ="'.htmlspecialchars($tb).'"></td></tr> |
<tr><td>Base filename</td><td><input type="text" name=baseFilename value ="'.htmlspecialchars($tb).'"></td></tr> |
<tr><td>Page title</td><td><input type="text" name=pageTitle value ="'.htmlspecialchars($tb).'"></td></tr> |
<tr><td>Page title</td><td><input type="text" name=pageTitle value ="'.htmlspecialchars($tb).'"></td></tr> |
Line 308 if ((!$dbl) or empty($submit)) { |
|
Line 316 if ((!$dbl) or empty($submit)) { |
|
$version = isset($versions_ar[$type]) ? $versions_ar[$type] : 'unknown'; |
$version = isset($versions_ar[$type]) ? $versions_ar[$type] : 'unknown'; |
$versions .= sprintf("\n * %36s %s", $desc, $version); |
$versions .= sprintf("\n * %36s %s", $desc, $version); |
} |
} |
|
$ssl = strlen($ssl) ? 1 : 0; |
echo_buffer("<?php |
echo_buffer("<?php |
|
|
/* |
/* |
Line 323 if ((!$dbl) or empty($submit)) { |
|
Line 332 if ((!$dbl) or empty($submit)) { |
|
*/ |
*/ |
|
|
// MySQL host name, user name, password, database, and table |
// MySQL host name, user name, password, database, and table |
\$opts['hn'] = '$hn'; |
\$opts['hn'] = '$hn'; |
\$opts['un'] = '$un'; |
\$opts['un'] = '$un'; |
\$opts['pw'] = '$pw'; |
\$opts['pw'] = '$pw'; |
\$opts['db'] = '$db'; |
\$opts['db'] = '$db'; |
\$opts['tb'] = '$tb'; |
\$opts['tb'] = '$tb'; |
|
\$opts['ssl'] = $ssl; |
|
|
// Name of field which is the unique key |
// Name of field which is the unique key |
\$opts['key'] = '$id'; |
\$opts['key'] = '$id'; |