Ask a Question related to PHP Development, Design and Development.
-
a dot erler at brain-at-work dot de #1
#25693 [NEW]: No access to posted variables via socket connection
From: a dot erler at brain-at-work dot de
Operating system: Debian
PHP version: 4.3.1
PHP Bug Type: Sockets related
Bug description: No access to posted variables via socket connection
Description:
------------
I'm trying to send some variables via POST with a socket connection to a
HTML form.
The problem:
The socket connection returns HTML-code from the form, but in the form I
can't access the variables I sent (e.g. "go" is not set in $HTTP_POST_VARS
and not in the global scope).
I took the sample code from the PHP manual, section "Stream functions",
"Example 2. Making a POST request to an https server".
I think it should be no problem, that there are additional GET-parameters
in the URI "d_content_kontakt.php" !?
Reproduce code:
---------------
$sock = fsockopen("linux", 80, $errno, $errstr, 30);
$data = 'go='.urlencode('sent');
fputs($sock, "POST
/caranet_redesign/d_content_kontakt.php?art_angebot=Gebrauchtwagen&i d_haendler=00000002&id_lang=00000001&typ=rm&herste ller=&schlafplaetze=&preis_von=&preis_bis=&id_fahr zeuge=00002158
HTTP/1.0\r\n");
fputs($sock, "Host: linux\r\n");
fputs($sock, "Content-type: application/x-www-url-encoded\r\n");
fputs($sock, "Content-length: " . strlen($data) . "\r\n");
fputs($sock, "Accept: */*\r\n");
fputs($sock, "\r\n");
fputs($sock, "$data\r\n");
fputs($sock, "\r\n");
$headers = "";
while ($str = trim(fgets($sock, 4096)))
$headers .= "$str\n";
print "\n";
$body = "";
while (!feof($sock))
$body .= fgets($sock, 4096);
fclose($sock);
Expected result:
----------------
variable "go" should contain "sent", but is not set in
d_content_kontakt.php
--
Edit bug report at [url]http://bugs.php.net/?id=25693&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=25693&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=25693&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=25693&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=25693&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=25693&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=25693&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=25693&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=25693&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=25693&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=25693&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=25693&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=25693&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=25693&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=25693&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=25693&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=25693&r=float[/url]
a dot erler at brain-at-work dot de Guest
-
authentication and access control (.NET socket connection)
Hi, Can someone point me in the right direction on a really simple access control issue? Here is the situation: 1. an app on a client... -
iterate through POSTed variables
Is there a way to iterate the POSTed variable to a page? A means by which I can see what variables HAVE been POSTed ? -Ike -
Faking Posted Variables
I have played with this some unsuccessfully and can't find any references to it on-line. What I have is a forms-based application where I POST... -
#25693 [Bgs]: No access to posted variables via socket connection
ID: 25693 User updated by: a dot erler at brain-at-work dot de Reported By: a dot erler at brain-at-work dot de Status: ... -
#25693 [Opn->Bgs]: No access to posted variables via socket connection
ID: 25693 Updated by: sniper@php.net Reported By: a dot erler at brain-at-work dot de -Status: Open +Status: ...



Reply With Quote

