Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Upload zdjęć
Kredka29
post
Post #1





Grupa: Zarejestrowani
Postów: 78
Pomógł: 1
Dołączył: 6.12.2008
Skąd: Polska

Ostrzeżenie: (0%)
-----


Witam.

- http://php-http.com/Upload_Images_to_TinyP...trieve_the_URLs -
  1. <?php
  2. include 'phpWebHacks.php';
  3.  
  4. $h = new phpWebHacks;
  5.  
  6. /* tinypic.com */
  7. $h->get('http://tinypic.com');
  8.  
  9. /* get the hidden fields */
  10. $form = $h->parseForm('uploadform', &$action);
  11.  
  12. /* filetype = image, resize = default */
  13. $form['file_type'] = 'image';
  14. $form['dimension'] = '1600';
  15.  
  16. /* 'browse' the image to upload */
  17. $file = array('the_file' => $_POST['filename']);
  18.  
  19. /* submit */
  20. $page = $h->post($action, $form, $file);
  21.  
  22. /* It will show a 'click here to view the image' page
  23.   and then redirects using javascript.
  24.   Since javascript is not supported, we need to manually
  25.   parse the URL */
  26. preg_match('/<a\s+href\s*=\s*"(.+)".*>/iU', $page, $url);
  27.  
  28. /* get the result page */
  29. $page = $h->get($url[1]);
  30.  
  31. /* here is your URL */
  32. preg_match('/\[IMG\](.+)\[\/IMG\]/si', $page, $m);
  33. echo 'Direct link: ' . $m[1];
  34. ?>
  35. <form method="post" enctype="multipart/form-data" name="uploadform" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  36. Enter path to file: <input type="file" name="filename" /><br />
  37. <input type="submit" name="sub" />
  38. </form>


Czemu nie działa?

Errory:
Kod
Warning: fopen(.log/headers.txt) [function.fopen]: failed to open stream: No such file or directory in [...]\phpWebHacks.php on line 69
Warning: fputs(): supplied argument is not a valid stream resource in [...]\phpWebHacks.php on line 70
Warning: fclose(): supplied argument is not a valid stream resource in [...]\phpWebHacks.php on line 71

Domyślam się że chodzi o plik headers.txt, ale skąd go wziąć?

Ten post edytował Kredka29 20.12.2009, 17:20:22


--------------------
Mam Windows 7 RC
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
varez
post
Post #2





Grupa: Zarejestrowani
Postów: 275
Pomógł: 32
Dołączył: 17.06.2007

Ostrzeżenie: (0%)
-----


nie chce mi sie analizowac ale jak na mnie to musisz go stworzyc (glupi skrypt ze sam tego nei zrobi)
Go to the top of the page
+Quote Post
Kredka29
post
Post #3





Grupa: Zarejestrowani
Postów: 78
Pomógł: 1
Dołączył: 6.12.2008
Skąd: Polska

Ostrzeżenie: (0%)
-----


Hm... to z innej beczki.

W np. iframe otwiera się strona X.
Co zrobić, aby treść pola tekstowego na stronie X, wyświetlić na stronie, gdzie iframe jest załadowywana?


up

Albo chociaż aktualny adres iframe jak wyświetlić w pozostałej części strony?


--------------------
Mam Windows 7 RC
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 04:40