Aller au contenu

Ptit probleme en php


Sujets conseillés

Posté

Bonjour,

Ca fait 2 jours que j'esseye d'installe le programe de EZ Invoice sur mon serveur mais j'ai tjrs un problemen qui me sort d'accote .

voila le message d'erreur qui s'affiche pour le moment :

"Notice: Undefined variable: update in c:\program files\easyphp1-8\www\admin\ezi\setup.php on line 13

Notice: Undefined variable: update in c:\program files\easyphp1-8\www\admin\ezi\setup.php on line 22"

Voila ce qu'il y a dans la ligne 12 et 13 :

$link=mysql_connect ("localhost", $admin_mysqluser, $admin_db_pass) or die ('I cannot connect to the database because: ' . mysql_error());

mysql_select_db ($admin_database, $link) or die("Error selecting database. Server may be down try again in a few minutes.");

et voila ce qu'il y a dans la ligne 22 et 23 :

} else {

loginbox(); die("Log In And Update Settings");

Merci beaucoup pour votre aide

Posté

Le message d'erreur t'indique que la variable update est utilisée, mais qu'elle n'est pas intialisée (tu n'as pas de $update = 'bla bla bla' auparavant).

Tu as modifié le script ?

Sinon, poste le code complet de setup.php (entre les balises CODEBOX) pour qu'on puisse t'aider.

Posté

je n'ai effectuer aucune modification sur le script, et pourla page setup.php, la voila :


<? session_start();
include("functions.php");
$username = "username";
$password = "password";
if(!$username)
{
$username = $_SESSION['username'];
$password = $_SESSION['password'];
}
if($username == $admin_username)
{
$link=mysql_connect ("localhost", $admin_mysqluser, $admin_db_pass) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ($admin_database, $link) or die("Error selecting database. Server may be down try again in a few minutes.");
$query = "SELECT * FROM client_list WHERE username = '$username'";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$line = mysql_fetch_array($result);
if($password != $admin_password)
{
loginbox(); die("Log In And Update Settings");
}

} else {
loginbox(); die("Log In And Update Settings");
}
?>
<br>
</font>
<?
if($update=="yes")
{
$admin_update = "UPDATE admin_data SET firstname = '$firstname', lastname = '$lastname', company = '$company', email = '$email', paypal = '$paypal', paypalemail = '$paypalemail', username = '$formusername', password = '$formpassword', address = '$address', ";
$admin_update .= "city = '$city', state = '$state', remitbox = '$remitbox', zip = '$zip', phone = '$phone', fax='$fax', taxid='$taxid', taxrate='$taxrate' WHERE username = '$admin_username';";
$admin_updateres = mysql_query($admin_update);
$_SESSION['username'] = $formusername;
$_SESSION['password'] = $formpassword;
die("<font face='arial' size='2' color='#006699'>Settings Have Been Updated</font>" . ' <script language="JavaScript">location="index.php";</script>');
?>
<?
}
?>
<div align="left">
<form name="form1" action="setup.php">
<input name="update" value="yes" type="hidden">
<? if($update=="did"){ echo "<font face='arial' size='2' color='#006699'>Settings Have Been Updated.</font>"; } ?>
<table width="570" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div align="left">
<table width="467" border="0" cellspacing="1" cellpadding="2">
<tr>
<td width="122" bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">First Name:</font></td>
<td width="334" bgcolor="#CCCCCC"><input name='firstname' type='text' value='<? echo $admin_firstname; ?>' size="40"></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Last Name:</font></td>
<td bgcolor="#CCCCCC"><input name='lastname' type='text' value='<? echo $admin_lastname; ?>' size="40"></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Company Name:</font></td>
<td bgcolor="#CCCCCC"><input name='company' type='text' value='<? echo $admin_company; ?>' size="40"></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Tax
ID:<br>
<font color="#CCCCCC" size="1">( <em>or social security #</em> )</font>
<br>
</font></td>
<td bgcolor="#CCCCCC"><input name='taxid' type='text' id="taxid" value='<? echo $admin_taxid; ?>' size="40">
<br>
<font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><font color="#333333" size="1">This
will automatically be placed on all invoices.</font> </font> </td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Tax
Rate:<br>
</font></td>
<td bgcolor="#CCCCCC"><input name='taxrate' type='text' id="taxrate" value='<? echo $admin_taxrate; ?>' size="10" maxlength="10">
%<br>
<font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><font color="#333333" size="1">This
will be used to add tax on invoices if taxable is selected.</font> </font> </td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Email:</font></td>
<td bgcolor="#CCCCCC"><input name='email' type='text' id="email" value='<? echo $admin_email; ?>' size="40">
</td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">UserName:<br>
<font color="#FF0000" size="2"><strong>*CREATE NOW!<br>
<font size="1">* Case Sensitive
</font><br>
</strong></font></font></td>
<td bgcolor="#CCCCCC"><input style="color:red" name='formusername' type='text' id="formusername" value='<? echo $admin_username; ?>' size="40"></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Password:<br>
<font color="#FF0000" size="2"><strong>*CREATE NOW!</strong></font> <br>
<font color="#FF0000" size="2"><strong><font size="1">* Case Sensitive </font></strong></font></font></td>
<td bgcolor="#CCCCCC"><input style="color:red" name='formpassword' type='text' id="formpassword" value='<? echo $admin_password; ?>' size="40"></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Address: </font></td>
<td bgcolor="#CCCCCC"><input name='address' type='text' value='<? echo $admin_address; ?>' size="40"></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">City:</font></td>
<td bgcolor="#CCCCCC"><input name='city' type='text' value='<? echo $admin_city; ?>' size="40"></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">State:</font></td>
<td bgcolor="#CCCCCC"><input name='state' type='text' value='<? echo $admin_state; ?>' size="40"></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Zip:</font></td>
<td bgcolor="#CCCCCC"><input name='zip' type='text' value='<? echo $admin_zip; ?>' size="40"></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Phone:</font></td>
<td bgcolor="#CCCCCC"><input name='phone' type='text' value='<? echo $admin_phone; ?>' size="40"></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Fax:</font></td>
<td bgcolor="#CCCCCC"><input name='fax' type='text' value='<? echo $admin_fax; ?>' size="40">
</td>
</tr>
<tr align="left" bgcolor="#CCCCCC">
<td colspan="2"><font color="#000000" size="1" face="Arial, Helvetica, sans-serif">The
Remit to Option lets you specify whether you would like to use "Ship
To, Remit To, Make Payable To, Etc..." above your information on the
invoice. If you are unsure, leave as "Ship To", this can be changed at
any time in your control panel.</font></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Remit
to Option:</font></td>
<td bgcolor="#CCCCCC"><input name='remitbox' type='text' value='<? echo $admin_remitbox; ?>' size="40">
</td>
</tr>
<tr align="center" bgcolor="#CCCCCC">
<td><font color="#000066"> </font></td>
<td align="left"><font color="#000066"> </font></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Enable
Paypal:</font></td>
<td bgcolor="#CCCCCC"><font face="Arial, Helvetica, sans-serif">
<input type="radio" name="paypal" value="yes"<? if($admin_paypal=="yes"){ echo " checked";} ?>>
Yes        
<input name="paypal" type="radio" value="no"<? if($admin_paypal=="no"){ echo " checked";} ?>>
No
</font></td>
</tr>
<tr>
<td bgcolor="#000000"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Paypal
Email:</font></td>
<td bgcolor="#CCCCCC"><input name='paypalemail' type='text' value='<? echo $admin_paypalemail; ?>' size="40">
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#CCCCCC"><font size="1" face="Arial, Helvetica, sans-serif">If you have a paypal account you can add
your account here. By adding your account here your clients will have the
option to pay by paypal through the client lounge.</font></td>
</tr>
<tr align="center">
<td> </td>
<td align="left"><input type="submit" name="Submit" value="Update Your EZI Settings"></td>
</tr>
</table>
</div></td>
</tr>
</table>
</form>

<font face="Arial, Helvetica, sans-serif"><br>
<br>
<br>
<br>

</font>
</div>
</div>

Posté

Essaye en ajoutant, en début de code :

if(!isset($update))
$update = false;

L'erreur vient du script, apparemment, qui a été développé avec une configuration de PHP plus permissive en ce qui concerne la déclaration de variables.

Posté

Re,

J'ai ajouté mais ça marche pas encore, je comprend plus parfois ça montre pas d'erreur et parfois il y a des erreur.

Voila le lien du script si tu peux faire le teste.

www.proweb-ma.com/invoice.rar

merci encore

Veuillez vous connecter pour commenter

Vous pourrez laisser un commentaire après vous êtes connecté.



Connectez-vous maintenant
×
×
  • Créer...