Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. Good explanation, but..... why did you get different error messages ? Open up phpmyadmin, go to sql tab (on the top), and copy/paste this code, post out the result: SHOW GRANTS FOR 'root'@'localhost'; and SHOW GRANTS FOR 'testuser'@'localhost'
  2. Which part of this statement does not work ? Did you replace it with your tables and columns name ?
  3. This warning: there is nothing to do it with the host name. Do you have access to DB through any php web or desktop applications ?
  4. No problem young lady Instead of your $query use this: $query = sprintf("INSERT INTO `t_documentos` SET `documento_titulo_esp` = '%s',`documento_titulo_cat` = '%s',`documento_path_esp` = '%s',`documento_path_ca` = '%s'", mysql_real_escape_string($documento_titulo_esp), mysql_real_escape_string($documento_titulo_cat), mysql_real_escape_string($filePath_1), mysql_real_escape_string($filePath_2));
  5. According this result, string(11) "myfile1.pdf" string(11) "myfile1.pdf" string(23) "C:\wamp\tmp\phpF2CF.tmp" string(23) "C:\wamp\tmp\phpF2CF.tmp" you have to images with the same name, but it's no true, right ? Check the name of $fileName2 = $_FILES['documento_path_cat']['name']. There is something wrong
  6. You want documento_path_esp to be "documento_path_esp = myfile1.pdf" or "documento_path_esp = ../uploads/myfile1.pdf" ? Get rid of this code, and check what result you get in DB: $filePath_1 = $uploadDir . $randName . '.' . $ext; $filePath_2 = $uploadDir . $randName . '.' . $ext; // Replace spaces with a '_' $filePath_1 = str_replace(" ", "_", $filePath_1); $filePath_2 = str_replace(" ", "_", $filePath_2); $result = move_uploaded_file($tmpName, $filePath_1); $result2 = move_uploaded_file($tmpName, $filePath_2); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath_1 = addslashes($filePath_1); $fileName2 = addslashes($fileName2); $filePath_2 = addslashes($filePath_2); } $fileinsert[]=$filePath_1; $fileinsert[]=$filePath_2; }
  7. Ok, everything is fine until here Could you explain me this code $filePath_1 = $uploadDir . $randName . '.' . $ext; I don't see you declare $randName and $ext php varibles, somewhere in your code
  8. Good for you, I've started to learn php at 37 years old, now I'm 40 Ok, find this code: if($fileName=="" || $fileName2=="") { $filePath_1 = '../uploads/img/none.jpg'; $filePath_2 = '../uploads/img/none.jpg'; } else{ $filePath_1 = $uploadDir . $fileName; $filePath_2 = $uploadDir . $fileName2; } And replace with this. What result did you get ? <?php if($fileName=="" || $fileName2=="") { echo 'False'; exit; $filePath_1 = '../uploads/img/none.jpg'; $filePath_2 = '../uploads/img/none.jpg'; } else{ echo 'True'; exit; $filePath_1 = $uploadDir . $fileName; $filePath_2 = $uploadDir . $fileName2; }
  9. Hm..... you need learn more of php Put in this code immediately before if($fileName=="" || $fileName2==""), and give us the results: echo '<pre>'.var_dump($fileName,$fileName2,$tmpName,$tmpName2).'</pre>';exit;
  10. What a result, you expect to be ?
  11. Add exit in the end, sorry : echo '<pre>'.var_dump($filePath_1, $filePath_2).'</pre>'; exit;
  12. Ok, in this case you need to check the values before mysql_query sends them to DB. For example, add this code immediately before $query = "INSERT INTO t_documentos (documento_titulo_esp, documento_titulo_cat,documento_path_esp,documento_path_cat) ". "VALUES ('$documento_titulo_esp','$documento_titulo_cat','$filePath_1','$filePath_2')"; Give us a result, please. echo '<pre>'.var_dump($filePath_1, $filePath_2).'</pre>';
  13. Could you post out entire mail sending script, please.
  14. Try this: <?php $uploadDir = '../uploads/'; if(isset($_POST['upload'])) { foreach ($_FILES as $file) { $fileName = $_FILES['documento_path_esp']['name']; $fileName2 = $_FILES['documento_path_cat']['name']; $tmpName = $_FILES['documento_path_esp']['tmp_name']; $tmpName2 = $_FILES['documento_path_cat']['tmp_name']; $fileSize = $_FILES['documento_path_esp']['size']; $fileSize2 = $_FILES['documento_path_cat']['size']; $fileType = $_FILES['documento_path_esp']['type']; $fileType2 = $_FILES['documento_path_cat']['type']; if($fileName=="" || $fileName2=="") { $filePath_1 = '../uploads/img/none.jpg'; $filePath_2 = '../uploads/img/none.jpg'; } else{ $filePath_1 = $uploadDir . $fileName; $filePath_2 = $uploadDir . $fileName2; } $filePath_1 = $uploadDir . $randName . '.' . $ext; $filePath_2 = $uploadDir . $randName . '.' . $ext; // Replace spaces with a '_' $filePath_1 = str_replace(" ", "_", $filePath_1); $filePath_2 = str_replace(" ", "_", $filePath_2); $result = move_uploaded_file($tmpName, $filePath_1); $result2 = move_uploaded_file($tmpName, $filePath_2); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath_1 = addslashes($filePath_1); $fileName2 = addslashes($fileName2); $filePath_2 = addslashes($filePath_2); } $fileinsert[]=$filePath_1; $fileinsert[]=$filePath_2; } $documento_titulo_esp = $_POST["documento_titulo_esp"]; $documento_titulo_cat=$_POST["documento_titulo_cat"]; $query = "INSERT INTO t_documentos (documento_titulo_esp, documento_titulo_cat,documento_path_esp,documento_path_cat) ". "VALUES ('$documento_titulo_esp','$documento_titulo_cat','$filePath_1','$filePath_2')"; mysql_query($query) or die('Error, query failed : ' . mysql_error()); header("Location: PC_documentos_display.php?documentoinserted=true"); } ?>
  15. Could you post a form submission too.
  16. Why did you put in die() in the end of the query string ? This does not make sense it supposed to be in the end of mysql_query function.
  17. Yes, you can do it without any problems. You need to insert the same value comes from drop down menu to different database columns. INSERT INTO tbl_name (col1,col2) VALUES('reception-room','reception-room');
  18. The result of my query above is : To get the same result your variable could be: $displayheight = '5\\'.'\''.'10\\'.'"';
  19. I've never tried this, but.... it could be something like this: $query = sprintf("INSERT INTO `tbl_name` SET `name` = '%s'", mysql_real_escape_string('5\\'.'\''.'10\\'.'"')); $result = mysql_query($query);
  20. There is a newer version: 2.6.27
  21. Before sending the query string to your database, add this: mysql_query('SET NAMES utf8"); http://forums.mysql.com/read.php?103,22311,249326
  22. You need to go to the folder and to run find (search) engine in your windows explorer. I've never used windows in my life to tell you how to do this but you can google it. Take a look at this: http://www.wikihow.com/Find-the-Right-File-in-Windows-Explorer
  23. Sorry, my EN grammar is not very proper. I just want to say, do you know how to find files and directories? In this case, just go to the project folder and run find command to find this class.
  24. Have you been searched any files and directories before? Download a project into your local machine (or upload files into your IDE ) and run search.
  25. Could you post the script from BaseTest class ?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.