Jump to content

Arancaytar

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Arancaytar's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks a lot! I still don't understand why the CUSTOMREQUEST thing doesn't seem to work, but I got headers with your method, and that's what counts. One thing though: Will this fetch the whole page, thus increasing the amount of data actually transferred? At the volume I will be using it, this won't be a real problem, but still. Edit: Okay, NOBODY will prevent the whole page from being fetched. So it appears to act exactly the same as a HEAD request. Now I'm only wondering why you can't use customrequest for this...
  2. Edit: Ignore this; I type too slowly. Have you checked the permissions of the upload folder, and are you running in safe mode? --------------- I looked for the part where you actually upload the file, but couldn't find it. You realize that you need to use [url=http://php.net/manual/en/function.move-uploaded-file.php]move_uploaded_file()[/url] to actually put the file anywhere on the server? Otherwise it stays in the temp directory and is deleted once the script is done. As for the MySQL, I assume that conn.inc.php actually makes a connection rather than just containing a function that would do so. If it does, then I don't know what is going wrong with that. However, this command prints the last error message returned by mysql: [code]echo mysql_error();[/code]
  3. Wasn't the question whether it was possible to put a [i]function call[/i] inside an [i]echo command[/i], not the other way around? Your example [code]echo 'some text smileys()';[/code] would work with just one small change. You can't put a function call inside quotation marks. So you'd do this: [code]echo 'some text ' . smileys();[/code] In case you've never used the "." operator before: When you put it between string values (in this case 'some text' and the return value of smileys), it concatenates them into a single string. "hello" . "world" is "helloworld".
  4. I can't figure out what I'm doing wrong here. The code block is intended to take the URL contained in $url, send a HEAD request and then print the header that comes back. For this test, I set $url="http://www.google.com/". [code=php:0] $url="http://www.google.com/"; $ch = curl_init(); $timeout = 5; curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt( $ch, CURLOPT_CUSTOMREQUEST,"HEAD"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $head=curl_exec($ch); var_dump($head); curl_close($ch);[/code] [url=http://php.net/manual/en/function.curl-exec.php]curl_exec[/url] only returns true - even though it should return the entire response since I set RETURNTRANSFER to 1. Any ideas?
×
×
  • 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.