bilgehanyildirim
asked on
Passing full web address as an url parameter
Hi
I am trying to get a full web address from url with php (zend framework)
This is what I type to the browser
http://domain.com/service/index/index/url/http%3A%2F%2Fwww.google.co.uk
and in my action I do
$url = $this->_getParam('url');
echo $url;
but I get the following error
The requested URL /service/index/index/url/http://www.com was not found on this server.
Am I missing something here?
I am trying to get a full web address from url with php (zend framework)
This is what I type to the browser
http://domain.com/service/index/index/url/http%3A%2F%2Fwww.google.co.uk
and in my action I do
$url = $this->_getParam('url');
echo $url;
but I get the following error
The requested URL /service/index/index/url/http://www.com was not found on this server.
Am I missing something here?
You have index/index/
Maybe too many indices?
Maybe too many indices?
ASKER
no, service module index controller index action
ASKER
and also if I do
http://domain.com/service/index/index/url/normal_string
I get normal_string
http://domain.com/service/index/index/url/normal_string
I get normal_string
Can you try ...
http://domain.com/service/index/index/url=http%3A%2F%2Fwww.google.co.uk
http://domain.com/service/index/index/url=http%3A%2F%2Fwww.google.co.uk
ASKER
done that. exactly same result.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
url without :// works fine. but if I put .../url/http://www... I only get http:
my .htaccess is
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
and no special zend route defined.
my .htaccess is
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
and no special zend route defined.
OOI, why are you calling _getParam() and not getParam() ...
My experience with ZF is very limited at the moment. I'm only using the Zend_SOAP Server and Client (building soap services for our clients - fun!).
Not used the MVC yet.
http://framework.zend.com/manual/en/zend.controller.request.html mentions getParams() and getParam() - no leading _ which is commonly used to indicate a private call in PHP4, there there was no visibility attribute for properties and methods.
My experience with ZF is very limited at the moment. I'm only using the Zend_SOAP Server and Client (building soap services for our clients - fun!).
Not used the MVC yet.
http://framework.zend.com/manual/en/zend.controller.request.html mentions getParams() and getParam() - no leading _ which is commonly used to indicate a private call in PHP4, there there was no visibility attribute for properties and methods.
ASKER
_getParam is shorthand for $this->getRequest()->getPa ram().
just to be on the safe side, I tried getParam with same result :)
just to be on the safe side, I tried getParam with same result :)
Can you var_dump($this->getRequest ()->getPar ams());
What are you getting?
What are you getting?
ASKER
actually it doesn't even come to that stage... I put it in the beginning of index.php still didn't run. I think it might be something to do with apache's configuration/
Sorry. I can't help there.
ASKER
Argh. Obvious now.
ASKER