Link to home
Start Free TrialLog in
Avatar of bilgehanyildirim
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?
Avatar of bilgehanyildirim
bilgehanyildirim

ASKER

Sorry, this question wasn't meant to be for netbeans channel!
You have index/index/

Maybe too many indices?
no, service module index controller index action
and also if I do

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


done that. exactly same result.
ASKER CERTIFIED SOLUTION
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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.

_getParam is shorthand for $this->getRequest()->getParam().

just to be on the safe side, I tried getParam with same result :)
Can you var_dump($this->getRequest()->getParams());

What are you getting?
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.
sorted

service/index/index/?url=http://www.google.co.uk

did just fine.

Thanks for your time anyway.
Argh. Obvious now.