Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Environmental Variables To PHP-CGI.exe
Old 04-06-2010, 11:40 PM Environmental Variables To PHP-CGI.exe
Junior Talker

Posts: 1
Trades: 0
I'm writing my own web server in Java, and have a small problem.

Code:
                ArrayList<String> envp = new ArrayList<String>();
                for (Map.Entry<String, String> entry : System.getenv().entrySet()) { // Add the computer set variables.
                    envp.add(entry.getKey() + "=" + entry.getValue());
                }
                envp.add("HTTP_KEEP_ALIVE=" + httpRequest.getHeaderProperty("Keep-Alive"));
                envp.add("HTTP_CONNECTION=" + httpRequest.getHeaderProperty("Connection"));
                envp.add("HTTP_COOKIE=" + httpRequest.getHeaderProperty("Cookie"));
                envp.add("HTTP_CACHE_CONTROL=" + httpRequest.getHeaderProperty("Cache-Control"));
                Process process = Runtime.getRuntime().exec(command, envp.toArray(new String[envp.size()])); // Execute php-cgi.exe
Which works great for settings things such as $_COOKIE in the PHP-CGI process. That said, I still have a problem: passing POST. I've tried multiple different names, such as POST, HTTP_POST, HTTP_POST_VARS, etc, but none add to $_POST. Does anyone know what environmental variable PHP uses for POST?
Bob the_Builder is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-08-2010, 10:42 AM Re: Environmental Variables To PHP-CGI.exe
Average Talker

Posts: 22
Trades: 0
$HTTP_POST_VARS is used for post. Please check out php.ini if this works in simple php first.. May be you need to rethink on the aproach.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
katierosy is offline
Reply With Quote
View Public Profile Visit katierosy's homepage!
 
Reply     « Reply to Environmental Variables To PHP-CGI.exe
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.40610 seconds with 12 queries