Michael9 Posted July 20, 2007 Share Posted July 20, 2007 hey people, I wrote some simple script that works on my computer [winXp+ apache + php5] the script uses the HTTP extension: http://www.php.net/manual/en/ref.http.php In fact, it just uses the http_post_data() function. the thing is that my hosting provider [free shared hosting] doesn't support this function. is there any way to make this function work on the hosting server? maybe if I upload the files that contain this function and all the related classes, and the use include() or something like this. I have no idea... If there's no way to do this, I'll be glad if you tell me what free hosting service supports this. and if you don't know, maybe you can tell me how to do the same that http_post_data() but without using it I know that I can use sockets, but I don't know how to calculate the 'content-size' header. the http_post_data() does this automatically, you just need to provide the post data and it generates the correct 'content-size'. Quote Link to comment Share on other sites More sharing options...
john010117 Posted July 20, 2007 Share Posted July 20, 2007 If it doesn't work on free hosting servers, it will never work until they decide to activate that feature (which is very rare). I'm sorry about this, but it's their decision on what is allowed on their servers and what is not. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted July 20, 2007 Share Posted July 20, 2007 this is a pecl library thing - unless your host install it (which they probably won't) then you are unfortunately adrift in a sea of retarded adolescent sexuality.... Been on the Spinal Tap again - sorry. Quote Link to comment Share on other sites More sharing options...
Michael9 Posted July 21, 2007 Author Share Posted July 21, 2007 so, someone know how to send POST data? I can use socket_create(), socket_connect(), socket_write() and other socket functions. but the header looks like this: /POST: /path/to/some/page \r\n Host: domain.com \r\n user-agent: firefox \r\n content-type: text/html [color=red]content-size: 1564[/color] \r\n \r\n //empty line to tell the server it's the end of the headers $some_string \\after the headers we send the server the actual content, which is in my example in size 1564 so my problem is to calculate the 'content size', I have the content string but have no idea how to calculate it's size. I don't think it's just len(), maybe I cna send a fake size that probably be bigger from the real size? Quote Link to comment Share on other sites More sharing options...
Michael9 Posted July 21, 2007 Author Share Posted July 21, 2007 someone? Quote Link to comment Share on other sites More sharing options...
lur Posted July 21, 2007 Share Posted July 21, 2007 "Content-Length: " . strlen($some_string); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.