Re: Form content type missing, how to fetch variables?
| From: | Simon Troup | Date: | Sat, 01 Jun 2002 00:56:00 +0000 |
| Subject: | Re: Form content type missing, how to fetch variables? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100199@lists.php.net to get a copy of this message | ||
This "non form" is a posted response from a commercial server quoting the
results of various transactions as pretty much a basic text dump. Weird I
know, and it is their problem/fault, however, I'm still left having to work
with it until such a time as they fix it (4 weeks, who knows why!). Also, it
is not a browser calling my script, it's just that, a raw text dump from a
server aimed at myscript.php
Thanks
Simon
> So is it even a web page that's returned? Or is it more like a text
> file?
>
> Will getallheaders() help you at all?
>
> www.php.net/getallheaders
>
> ---John Holmes...
>
>> -----Original Message-----
>> From: Simon Troup [mailto:simon.troup@digitalmusicart.com]
>> Sent: Friday, May 31, 2002 8:23 PM
>> To: php-general@lists.php.net
>> Subject: Re: [PHP] Form content type missing, how to fetch variables?
>>
>> Thanks Dan, but I don't think I'm explaining well.
>>
>> Submitting that form will produce, from most browsers, a request that
> has
>> in
>> one of it's headers:
>>
>> content-type: x-www-form-urlencoded
>>
>> ... the variable $Foo will automatically be available within PHP for
> use
>> in
>> any script that form is directed to, however, I have to write a script
>> that
>> will accept raw data, it's input comes from a server that is not kind
>> enough
>> to put in the header content-type: x-www-form-urlencoded and so is not
>> automatically being passed by PHP into the script.
>>
>> The page content is just raw data like this ...
>>
>> foo=boo&name=joe&action=jump
>>
>> ... but php does not pass them into variables as content-type is not
>> x-www-form-urlencoded
>>
>> The answer could be "tell the people to add the content type" but they
> say
>> "by the end of june" and I need to read this stuff today!
>>
>> Sorry if my explanation inadequate, I'm trying my best.
>>
>> Thanks
>>
>> Simon
>>
>>> Simon:
>>>
>>> <form method="post">
>>> <input type="submit" name="Foo" value="Boo" />
>>> </form>
>>> <?php
>>> if ( isset($_POST['Foo']) ) {
>>> echo '<p>' . $_POST['Foo'] . '</p>';
>>> }
>>> ?>
>>>
>>> Viewing that the first time will show the form. Submitting the form
>>> will show you the form again and then the value of Foo.
>>>
>>> --Dan
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
>