et encore merci..je viens de tester avec la fonction extract, c nickel aussi..magique
voila le code de la page complet, si ca peut vous aider a m'aider :
(sachant que le code de la ligne 159 est en ligne 157 vu que sur le code , j'utilise la fonction " EXTRACT" , donc j'ai gagné 2 lignes
<html>
<body bgcolor="#DDDDDD">
<style>
<!--
p, td { font-family: Verdana; font-size: 10pt }
.head { font-family: Verdana; font-size: 10pt; font-weight:bold }
.small { font-family: Verdana; font-size: 8pt }
-->
</style>
<div align="center">
<center>
<table style="border-collapse: collapse" bordercolor="#111111" cellspacing="1" width="75%" border="1">
<tr>
<td bgcolor="#748992">
<p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">Flash News Component Ver 1.0 Installation</font></b></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<?php
extract( $_REQUEST );
function message($str)
{
?>
<span style="color: red"><p class="head">Stopping!</p> Encountered an error:</span><br/>
<pre>
<?=$str?>
</pre>
<?php
}
if (isset($confirm))
{
////////////////////////////////
// Connect to Database
////////////////////////////////
$conn=mysql_connect ($dbhost, $dbuser, $dbpass) or die ("<br><br><b>Failed! Unable to connect to database, go back and check your database host, username and password.</b><br>Error:<br>". mysql_error());
mysql_select_db ($dbname) or die ("<br><b>Failed! Unable to select database, go back and check your database name.</b><br>Error:<br>". mysql_error());
////////////////////////////////
//Create Table
////////////////////////////////
echo "<p class=\"small\"><br>Inserting tables...</p>";
$drop = "DROP TABLE IF EXISTS ". $dbtabel."";
mysql_query($drop, $conn) or die(message(mysql_error()));
$sql = "CREATE TABLE ". $dbtabel." (
`newsID` int(11) NOT NULL auto_increment,
`title` varchar(100) default NULL,
`link` varchar(255) default NULL,
`posted` int(11) default NULL,
`body` mediumtext,
PRIMARY KEY (`newsID`)
) TYPE=MyISAM COMMENT='newscomponent Table'";
mysql_query($sql, $conn) or die(message(mysql_error()));
////////////////////////////////
/// Write config.php file
////////////////////////////////
chmod("inc/config.php", 0755);
if (!$fp = fopen ("inc/config.php", w)) message ("Can't open config.php file for writing");
$data= "<?php \n";
$data.= " \$dbhost = \"".$dbhost."\";\n";
$data.= " \$dbname = \"".$dbname."\";\n";
$data.= " \$dbuser = \"".$dbuser."\";\n";
$data.= " \$dbpass = \"".$dbpass."\";\n";
$data.= " \$dbtabel = \"".$dbtabel."\";\n?>";
if (!$fw = fwrite($fp, $data, strlen($data))) message ("Error writing into config.php. Please set the filepremission of config.php to 755");
fclose($fp);
if ($fw) {echo "<p align=\"center\"><b><font size=\"4\">Installation Complete!</font></b></p>
<p align=\"center\">You must now delete install.php file for security reasions.</p><br>"; exit();}
else echo "Installation failed. Error writing config.php.";
}
if (isset($submit))
{
$error = array();
if (!$dbname) { $error [] = "Database Name has not been filled."; }
if (!$dbhost) { $error [] = "Database Hostname has not been filled."; }
if (!$dbuser) { $error [] = "Database Username has not been filled."; }
if (!$dbpass) { $error [] = "Database Password has not been filled."; }
if (!$dbtabel) { $error [] = "Tabel name has not been filled."; }
if (count($error) == 0)
{
///////////////////////
// CONFIRM
////////////////////////
$dbname = htmlentities ($_POST['dbname']);
$dbhost = htmlentities ($_POST['dbhost']);
$dbuser = htmlentities ($_POST['dbuser']);
$dbpass = htmlentities ($_POST['dbpass']);
$dbtabel = htmlentities ($_POST['dbtabel']);
?>
<p align="center"><br><b>Cofirm Settings</b><br>Please confirm your settings.</p>
</b></p>
<center><form method="POST" action="<?php echo "$PHP_SELF?agree=yes"; ?>" name="confirm">
<table cellpadding="3" style="border-collapse: collapse" bordercolor="#111111" width="90%" id="AutoNumber1" cellspacing="0">
<tr>
<td colspan="3" align="center"><table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr bordercolor="#111111">
<td width="50%" align="right">Database Name</td>
<td width="50%"><b><?php echo $dbname; ?></b></td>
</tr>
<tr bordercolor="#111111">
<td width="50%" align="right">Database Host</td>
<td width="50%"><b><?php echo $dbhost; ?></b></td>
</tr>
<tr bordercolor="#111111">
<td width="50%" align="right">Database Username</td>
<td width="50%"><b><?php echo $dbuser; ?></b></td>
</tr>
<tr bordercolor="#111111">
<td width="50%" align="right">Database Password</td>
<td width="50%"><b><?php echo $dbpass; ?></b></td>
</tr>
<tr>
<td width="50%" align="right" bordercolor="#111111">Tabel Name </td>
<td><b><?php echo $dbtabel; ?></b></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" align="right"> </td>
</tr>
<tr>
<td colspan="3">
<p align="center" class="small">
<input type="submit" value="confirm" name="confirm" ><br>(Note: The installer will setup the tables in the next step.)</p>
<p align="center">No I've to make changes! Go <a href="javascript:history.go(-1)">back</a></p>
</td>
</tr>
</table>
<input type="hidden" name="dbname" value="<?php echo $dbname; ?>">
<input type="hidden" name="dbuser" value="<?php echo $dbuser; ?>">
<input type="hidden" name="dbpass" value="<?php echo $dbpass; ?>">
<input type="hidden" name="dbhost" value="<?php echo $dbhost; ?>">
<input type="hidden" name="dbtabel" value="<?php echo $dbtabel; ?>">
</form>
</center>
<?php
}
else
{
echo "<br><p class=\"head\">You've not filled in all database!<br/>\n";
echo "Here is what you mised:</p>\n";
echo "<ul>\n";
for ($i = 0; $i < count($error); $i++) {echo "<li>" . $error[$i] . "</li><br/>\n";}
echo "</ul>\n";
echo "<p>Please go <a href=\"javascript:history.go(-1)\">back</a> and complete all details</p>\n";
}
}
else if ($agree!="yes")
{
?>
<br><br>
<p align="center"><b>Warning:</b> Run this script only if you're installing "NewsComponetForFlash" for the first time. The setup process will create new tables and overwrite any previous "NewsComponetForFlash" data.</p>
<p align="center"><b>NewsComponetForFlash License Agreement </b></p>
<p align="center"><em><font size="2">componentsforflash.net is not to be held resposible for deleting data or in other ways harm content on you server.</font></em> </p>
<p align="center"><a href="?agree=yes">I Agree</a></p>
<br> <?php
}
else
{
if (file_exists("inc/config.php"))
if (is_writeable("inc/config.php"))
{
///////////////////
//DISPLAY FORM
///////////////////
?>
<div align="center"><b> Database Settings<br>
</b><font size="1">If you're unaware of your database settings please ask your
webhost.</font> </div>
<div align="center">
<center>
<form method="POST" action=""$PHP_SELF?agree=yes"">
<table border="0" cellpadding="3" style="border-collapse: collapse" bordercolor="#111111" width="90%" id="AutoNumber1" cellspacing="3">
<tr>
<td width="45%" align="right">Database Name</td>
<td width="45%"> <input type="text" name="dbname" size="20" ></td>
</tr>
<tr>
<td width="45%" align="right">Database Host</td>
<td width="45%"> <input type="text" name="dbhost" size="20" value="localhost" ></td>
</tr>
<tr>
<td width="45%" align="right">Database Username</td>
<td width="45%"> <input type="text" name="dbuser" size="20" ></td>
</tr>
<tr>
<td width="45%" align="right">Database Password</td>
<td width="45%"> <input type="password" name="dbpass" size="20" ></td>
</tr>
<tr>
<td align="right">Tabel Name </td>
<td align="left"><input type="text" name="dbtabel" size="20" value="mynews" ></td>
</tr>
<tr>
<td width="100%" style="font-family: Verdana; font-size: 10pt" colspan="2">
<p align="center">
<input type="submit" value="submit" name="submit" >
</td>
</tr>
<tr>
<td colspan="2" align="right"> <p align="center">
</td>
</tr>
</table>
</form>
</center>
</div>
<?php
///////////////////
//END DISPLAY FORM
///////////////////
}
else
{
echo ' <p align="center"><font color="#FF0000"><b>Error</b>:</font> <b>
inc/config.php</b> is not writeable! Please CHMOD it to <b>666</b> or <b>777</b>.</p>';
}
else
{
echo '
<p align="center"><font color="#FF0000"><b>Error</b>:</font> <b>
inc/config.php</b> is not FOUND! Please upload the file.</p>';
}
}
function encrypt($string) {//hash then encrypt a string
$crypted = crypt(md5($string), md5($string));
return $crypted;
}
?>
</tr>
</table>
</center>
</div>
</body>
</html>