简体   繁体   中英

How to use GET/POST without the input argument

I use rapache module to build a web site base on r statistic programing language. The way to pass variables to r are by using the GET/POST methods.

But I want to insert value with PHP to the $_POST variable and then to pass it to r.

Is there a way to use GET/POST without the "input" argument. I mean can I give the variable a value and not to wait for the client to make an action, for example the press the submit button?

Thanks for any help,

yoni.

You can use the HTTP extension in PHP to create your own POST to your r platform. Specifically you can use HttpRequest::addPostFields to add post fields to that request.

Once again, don't use PHP. RApache provides POST and GET superglobals similar to PHP. All you'll have to do is to massage them within R script file. Parameters from POST/GET requests are wrapped into R list (generic vectors), so you can easily manipulate them within R.

Please put a reproducible example, so folks can actually see what are you up to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM