Skip to content
Advertisement

Tag: request

Getting all request parameters in Symfony 2

In symfony 2 controllers, every time I want to get a value from post I need to run: Is there any way to consolidate these into one statement that would return an array? Something like Zend’s getParams()? Answer You can do $this->getRequest()->query->all(); to get all GET params and $this->getRequest()->request->all(); to get all POST params. So in your case: For more

Make a HTTPS request through PHP and get response

I want to make HTTPS request through PHP to a server and get the response. something similar to this ruby code Thanks Answer this might work, give it a shot. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // Set so curl_exec returns the result instead of outputting it. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Get the response and close the channel. $response =

Undefined index: Error in php script

In a php page I have following code: I keep getting Undefined index error. On Googling I manage to understand that if a page is access without parameters (in URL) which we are trying to access we can get this error/warning. I believe that if a parameter is not defined in the URL it should just return empty instead of

Advertisement