Jump to content

Michael9

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by Michael9

  1. 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?
  2. 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'.
  3. roopurt18, thanks, very useful reply. about the template engine, why don't use them? I mean, with direct PHP it's all very messy, I think that some good template engine can make the life easier.
  4. hey all, I'm wondering what tools and techniques people use to do stuff with PHP. yes yes, I know it depends. but in general, let's say you have a BIG project to complete, how would you do it? there are programmers that all they use is direct PHP, there are some people that use template engine [ie Smarty] and some database abstraction [ie- ADODB ] , there are people that use some MVC framework or something else. so, what are you guys using most of the time?
×
×
  • 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.