Re: [PHP] POST Format

2002-05-29 Thread Philip Olson


> I'm trying to figure out how to correct the proper format for
> simulating the data sent in a POST.  I believe the basic syntax
> is
> 
> ?name1=value1&name2=value2 ...
> 
> Is this correct?

That is correct for GET information, but not for POST. 
POST is not passed through the QUERY_STRING like GET is.  
If you _really_ want to mimick POST (it doesn't sound 
like you do) then consider:

 Using PHP, how do I send a http POST without using a form?
 --
 http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51

> If so, how are the value's encoded?  Is each value surrounded by
> ""?  Do I need to urlencode() each value (without the surrounding
> "")?

I you plan to pass non-url friendly values through
the URL, then using urlencode() is a good idea.  For 
example:

  $words = "Cheese is good";

  echo 'hi';

Which essentially makes:

  yep.php?motto=Cheese+is+good

More information on what urlencode exactly does and 
related information (like for htmlentities), see the 
manual entry:

  http://www.php.net/urlencode


Regards,
Philip Olson


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] POST Format

2002-05-29 Thread Demitrious S. Kelly

No you can do

Index.php?name=apokalyptik&[EMAIL PROTECTED]&subscribe=n
o

&&

';
echo 'NAME: '.$name.chr(10);
echo 'EMAIL:'.$email.chr(10);
echo 'SUBSCRIBE:'.$subscribe;
echo '';
?>

-Original Message-
From: Jonathan Rosenberg [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, May 29, 2002 7:58 PM
To: PHP General
Subject: [PHP] POST Format

This is not entirely a PHP question & I should know the answer,
but ...

I'm trying to figure out how to correct the proper format for
simulating the data sent in a POST.  I believe the basic syntax
is

name1=value1&name2=value2 ...

Is this correct?

If so, how are the value's encoded?  Is each value surrounded by
""?  Do I need to urlencode() each value (without the surrounding
"")?

Any help appreciated.

--
JR


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php