yeah i upload the files into this folder
http://img221.imageshack.us/my.php?i...nleavesmr9.jpg
i move the file to this folder with move_upload_file
this is my upload.php file to load the file in the mysql phpmyadmin database
PHP Code:
<?php
$uploadDir = 'D:\\lol\\';
if(isset($_POST['upload']))
{
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
$filePath = $uploadDir . $fileName;
$result = move_uploaded_file($tmpName, $filePath);
$fileName = addslashes($fileName);
$filePath = addslashes($filePath);
$texteNouvelle = $_POST['texteNouvelle'];
$connection = mysql_connect("localhost","root","") or die("impossible de se connecter au serveur mysql.<p>Veuillez réessayer plus tard");
$res = mysql_select_db("test") or die("impossible de sélectionner la base de données <b>ecole</b>.<p>Veuillez réessayer plus tard");
$requeteStr = "INSERT INTO upload2 (name, size, type, path,textNouvelle ) "."VALUES ('$fileName', '$fileSize', '$fileType', '$filePath','$texteNouvelle')";
$resultatRequete = mysql_query($requeteStr) or die("la requete de sélection a échoué.<p>Veuillez réessayer plus tard");
$result=mysql_query($requeteStr);
}
?>
Code:
<form action="" method="post" enctype="multipart/form-data" name="uploadform">
<table width="350" border="0" cellpadding="1" cellspacing="1" class="box">
<tr>
<td width="246" style="height: 95px"><input type="hidden" name="MAX_FILE_SIZE" value="2000000"><input name="userfile" type="file" class="box" id="userfile">
<br>
<br>
<textarea name="texteNouvelle" style="width: 263px; height: 61px"></textarea><br>
<br>
<br>
</td>
<td style="height: 95px; width: 51px" class="style1"><input name="upload" type="submit" class="box" id="upload" value=" Upload "></td>
</tr>
</table>
</form>
$uploadDir = 'D:\\lol\\';
is my two \\ slashes right ?
$fileName = addslashes($fileName);
$filePath = addslashes($filePath);
and addslashes too ? im wondering if thats correct now
i wish so hard this image thing can be resolve its giving me a headeache... and ty for ur time again
i can do some research of my news with a select like query
but without showing the image its sucks ...
Bookmarks