nicko Posted November 17, 2006 Share Posted November 17, 2006 Hi Im new to php development and have a question that is probably simple to answer.How do you deal with a post that wasn't sent from a form. All examples I have seen on forums only show you how to deal with posts from a html form. What if I post simply a header with content type and a body. How do I process this?Hope someone can help Link to comment https://forums.phpfreaks.com/topic/27598-new-to-php-question-about-http-post-requests/ Share on other sites More sharing options...
fert Posted November 17, 2006 Share Posted November 17, 2006 posts are completely different than headers. Link to comment https://forums.phpfreaks.com/topic/27598-new-to-php-question-about-http-post-requests/#findComment-126215 Share on other sites More sharing options...
Orio Posted November 17, 2006 Share Posted November 17, 2006 fret you are wrong. POST information is passed with the headers. If you get POST data not through a form it's the same- the variables will be called $_POST['var_name'].Orio. Link to comment https://forums.phpfreaks.com/topic/27598-new-to-php-question-about-http-post-requests/#findComment-126240 Share on other sites More sharing options...
nicko Posted November 19, 2006 Author Share Posted November 19, 2006 Orio,I see you say use $_POST array. OK, but say if the body is an image how do I retrieve it? In other words,what would be the 'var_name'? Do I put this in the header some how? Link to comment https://forums.phpfreaks.com/topic/27598-new-to-php-question-about-http-post-requests/#findComment-127210 Share on other sites More sharing options...
fert Posted November 19, 2006 Share Posted November 19, 2006 you can't only values from forms are in $_POST Link to comment https://forums.phpfreaks.com/topic/27598-new-to-php-question-about-http-post-requests/#findComment-127218 Share on other sites More sharing options...
nicko Posted November 19, 2006 Author Share Posted November 19, 2006 So fert,How do I get hold of data that is posted but not posted from a form? Link to comment https://forums.phpfreaks.com/topic/27598-new-to-php-question-about-http-post-requests/#findComment-127225 Share on other sites More sharing options...
fert Posted November 19, 2006 Share Posted November 19, 2006 There is any kind of post data that doesn't come from a form. Link to comment https://forums.phpfreaks.com/topic/27598-new-to-php-question-about-http-post-requests/#findComment-127250 Share on other sites More sharing options...
trq Posted November 20, 2006 Share Posted November 20, 2006 All data sent via post will be contained within the $_POST array, sent via a form or not. Link to comment https://forums.phpfreaks.com/topic/27598-new-to-php-question-about-http-post-requests/#findComment-127261 Share on other sites More sharing options...
nicko Posted November 20, 2006 Author Share Posted November 20, 2006 thorpe,I'm glad you said that, I thought this was the case, when extracting data from $_POST, I'm used to specifing a variable name (the one that we specified in the form). How do you retrieve the data from $_POST without specifing the var name? Link to comment https://forums.phpfreaks.com/topic/27598-new-to-php-question-about-http-post-requests/#findComment-127394 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.