fork download
  1. <?php
  2. mysql_connect('localhost', 'k.a', 'sifre')or die("hoppss bisiler ter giris bilgilerini kontrol et");
  3. mysql_select_db('zulfumeh_mail')or die('Veritabanı nerdeki');
  4.  
  5. ?>
  6. <html lang="tr">
  7. <head>
  8. <meta charset="utf-8">
  9. <title>Deneme</title>
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta name="viewport" content="width=device-width, initial-scale=1">
  12. <meta name="description" content="">
  13. </head>
  14. <body>
  15.  
  16. <?php
  17.  
  18. $gelen_kod=$_GET["id"];
  19.  
  20.  
  21. if( isset( $_POST[ 'submit' ] ) !== false )
  22. {
  23. include('class.upload.php');
  24.  
  25. $files = array();
  26. foreach ($_FILES['image'] as $k => $l) {
  27. foreach ($l as $i => $v) {
  28. if (!array_key_exists($i, $files))
  29. $files[$i] = array();
  30. $files[$i][$k] = $v;
  31. }
  32. }
  33.  
  34. // create an array here to hold file names
  35. $uploaded = array();
  36.  
  37. foreach ($files as $file) {
  38. $handle = new Upload($file);
  39. if ($handle->uploaded) {
  40. // create a little array for this set of pictures
  41. $this_upload = array();
  42.  
  43. $handle->file_name_body_add = '_thumbnial';
  44. $handle->file_auto_rename = true;
  45. $handle->image_resize = true;
  46. $handle->image_x = 100;
  47. $handle->image_ratio_y = true;
  48. $handle->Process('files/'.$_GET["id"].'/kucuk');
  49.  
  50. if ($handle->processed) {
  51. echo $handle->file_dst_name;
  52. // store the large image filename
  53. $this_upload['large'] = $handle->file_dst_name;
  54. } else {
  55. echo 'error : ' . $handle->error;
  56. }
  57.  
  58. $handle->file_auto_rename = true;
  59. $handle->image_resize = false;
  60. $handle->image_x = 100;
  61. $handle->image_ratio_y = true;
  62. $handle->Process('files/'.$_GET["id"].'/');
  63.  
  64. if ($handle->processed) {
  65. echo $handle->file_dst_name;
  66. // store the small image filename
  67. $this_upload['small'] = $handle->file_dst_name;
  68. $handle->clean();
  69. } else {
  70. echo 'error : ' . $handle->error;
  71. }
  72.  
  73. // add this set of pictures to the main array
  74. $uploaded[] = $this_upload;
  75. }
  76. }
  77. // now, you have all your picture names in $uploaded
  78. // do your database insert like this for instance
  79. $sql = "INSERT INTO resimler (fotoid, resim_adi, kucuk...) ";
  80. $sql .= "VALUES ('$id', '".$uploaded[1]['resim_adi']."', '".$uploaded[1]['kucuk']."'))";
  81. $x = mysql_query($sql);
  82.  
  83. }
  84.  
  85. ?>
  86. </body>
  87. </html>
Runtime error #stdin #stdout #stderr 0s 82560KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /home/TWIGct/prog.php:2
Stack trace:
#0 {main}
  thrown in /home/TWIGct/prog.php on line 2