• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 569
  • Last Modified:

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?
0
bilgehanyildirim
Asked:
bilgehanyildirim
  • 8
  • 7
1 Solution
 
bilgehanyildirimAuthor Commented:
Sorry, this question wasn't meant to be for netbeans channel!
0
 
Richard QuadlingSenior Software DeverloperCommented:
You have index/index/

Maybe too many indices?
0
 
bilgehanyildirimAuthor Commented:
no, service module index controller index action
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
bilgehanyildirimAuthor Commented:
and also if I do

http://domain.com/service/index/index/url/normal_string

I get normal_string
0
 
Richard QuadlingSenior Software DeverloperCommented:
Can you try ...

http://domain.com/service/index/index/url=http%3A%2F%2Fwww.google.co.uk


0
 
bilgehanyildirimAuthor Commented:
done that. exactly same result.
0
 
Richard QuadlingSenior Software DeverloperCommented:
Try ...

http://domain.com/service/index/index/url/www.google.co.uk

What rewrite rules have you got defined?

What if the :// is NOT encoded?

http://domain.com/service/index/index/url/http://www.google.co.uk

0
 
bilgehanyildirimAuthor Commented:
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.
0
 
Richard QuadlingSenior Software DeverloperCommented:
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.

0
 
bilgehanyildirimAuthor Commented:
_getParam is shorthand for $this->getRequest()->getParam().

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

What are you getting?
0
 
bilgehanyildirimAuthor Commented:
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/
0
 
Richard QuadlingSenior Software DeverloperCommented:
Sorry. I can't help there.
0
 
bilgehanyildirimAuthor Commented:
sorted

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

did just fine.

Thanks for your time anyway.
0
 
Richard QuadlingSenior Software DeverloperCommented:
Argh. Obvious now.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now