Hello,
I'm having trouble to insert the name of the picture in the database. I don't have any trouble if I don't use hidden field like user_id which in the member id from another table
I did a recordset (Membre) to access the page via URL id like add.php?id=3
Trying to see what is going wrong since 6 hours lolll
This is the code. <?php //********************** // DwZone Upload Resize //********************** require_once("dwzUpload/dwzUpload.php"); require_once('Connections/connexion.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; }
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } }
$colname_Membre = "-1"; if (isset($_GET['id'])) { $colname_Membre = $_GET['id']; } mysql_select_db($database_connexion, $connexion); $query_Membre = sprintf("SELECT * FROM membre WHERE id = %s", GetSQLValueString($colname_Membre, "int")); $Membre = mysql_query($query_Membre, $connexion) or die(mysql_error()); $row_Membre = mysql_fetch_assoc($Membre); $totalRows_Membre = mysql_num_rows($Membre); ?> <?php //************************** // INSERT RECORD UPLOAD // http://www.DwZone-it.com // Version: 1.1.4 //************************** set_time_limit(5400); $upload = new dwzUpload(); $upload->SetProgressBar(""); $upload->SetTempFolder("undefined"); $upload->SetTotalFileSize(""); $upload->SetRedirectUrl("ok.php"); $upload->SetFiles("/membre/;1;;.jpg,.jepg,.gif,.png;2048;1;photo1;3;photo1&S;;;0;;;;;1;;1;photo1@_@_@0@_@_@php@_@_@-1;;;80;0;100;125;80;0;_small;0;1;0;;;80;0;_small;0@_@_@./@_@_@POST"); $upload->SetFormName("form1"); $upload->SetUploadType("insert"); $upload->SetValueToRedirectSend("description|titre|user_id"); $upload->SetDbParam($hostname_connexion, $database_connexion, $username_connexion, $password_connexion); $upload->SetEditTable("annonce_particulier"); $upload->SetFields("titre|value|description|value|annonce_id|value|user_id|value"); $upload->SetColumns("titre|text|description|text|annonce_id|int|user_id|int"); $upload->Execute(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php //********************** // DwZone Upload Resize //********************** require_once("dwzUpload/dwzUploadClient.php"); ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>testing</title> <style type="text/css"> body,td,th { font-family: Verdana, Geneva, sans-serif; font-size: 12px; color: #333; } </style> </head>
<body><div align="center"><br /> <?php echo $row_Membre['prenom']; ?><br /> 2 <form enctype="multipart/form-data" onsubmit="return ProgressBar()" id="form1" name="form1" method="post" action="<?php echo $upload->GetEditAction(); ?>"> <table width="630" border="0" cellspacing="0" cellpadding="0"> <tr> <td>titre</td> <td><input type="text" name="titre" id="titre" /></td> </tr> <tr> <td>des</td> <td><textarea name="description" id="description" cols="45" rows="5"></textarea></td> </tr> <tr> <td>photos</td> <td><input name="photo1" type="file" id="photo1" onchange="dwz_setEvent(this,'change')" onclick="dwz_setEvent(this,'click')" /></td> </tr> <tr> <td><input type="hidden" name="annonce_id" id="hiddenField"><input type="hidden" name="user_id" id="hiddenField"></td> <td><input type="submit" name="dwzSubmit" id="dwzSubmit" value="Submit" /></td> </tr> </table> <input type="hidden" name="dwzUpload" id="dwzUpload" value="form1" /> </form> <p> </p> </div> </body> </html> <?php mysql_free_result($Membre); ?>
|
|
|