standard posting method to cgi - programs

hi
id like to know is there a standard format of how to pass query strings and post data to a cgi- program spicifically php
i currently call php like

php.exe phpscript "query strings"

from cmd

but i have no idea of how to pass posted data to the program do i send a file handle or something??

regards mark,
LVL 1
mgazzaAsked:
Who is Participating?
 
ahoffmannCommented:
mgazza, phpinfo.php does not give much valuable information about the called script
It also exposes your whole server, in particular the security holes, that's why the link have been removed.

in PHP you get the passed variables in $_GET[] and/or $_POST[]
For security reason only use these arrays (the one you expect the data) and not $_REQUEST[]

Does this answer your question?
0
 
ahoffmannCommented:
php uses the CGI as usual, means that the query string is passed in as environment variable QUERY_STRING (GET data) and POST data is passed in on STDIN

POST:
  echo variable=value | php.exe script.php

GET:
  set QUERY_STRING="variable=value"
  php.exe script.php
0
 
mgazzaAuthor Commented:
would i set the envar for the program or the system? if you have any example code c or anything that would be gr8
my server is currently showing querystrings (get data) oka
example php

{{ link to phpinfo.php removed for security reason }}
{{ ahoffmann wearing my Page Editor hat }}


regards mark
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
mgazzaAuthor Commented:
:/
 ill just post the data as a html then :P

http://mgazza.kicks-ass.net/phpinfo.html

happy now :P

just look @ PHP Variables

just to show wat my server is currently passing

regards mark,
0
 
mgazzaAuthor Commented:
no sorry im tring to figure out how to post data to php or any cgi script,

currently my server(not iss or apache or anything) calls php.exe passes the script and query string which appears in $_REQUEST[] and $_GET[]

i have no idea of how to pass the posted data.

my server calls createprocess and passes the data there

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp

should i pass the get strings there there is no way to write to std in as far as i know

best regards
mark

ty for your help so far
0
 
ahoffmannCommented:
hmm, stupid API, I don't see how to pass data on STDIN
Either you need to rewrite your script.php to accept all data in environment
or use a web server which supports PHP natively
or ask the developers how to do what you want (which is the usal way)
0
 
mgazzaAuthor Commented:
yea thats wat i keep tryin to do hehe! there is a write handle in createpipe() but php isnt listenin to it when i write to it. i wish there was some standard way of doin this lol!
dlls would also be much better to use than exes much more memory resiliant and faster.

i use my own web server cause i can make it do what ever i want you see. and i know the security holes if there is any so its much harder for people to get into.

regards mark,

ill leave this qa open for afew days thanks for your help!
0
 
mgazzaAuthor Commented:
sorry i forgot about this question :D

thanks alot
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.