0

I have a little problem regarding fetching the query string in php...

The initial URL that I used to have was like following:

www.sitename.com/?id=someid

Fetching was done with the following method:

if(!empty(htmlspecialchars($_GET["id"])) && empty($me))
    {
        $_SESSION['FriendID'] = $userId;

        return $this->redirect()->toUrl("/user/emailsignup");
    }

Now I had to add a name to the URL with slashes like this:

www.sitename.com/SomeName/?id=someid

With this URL I'm getting an error...

How can I fetch the Id now with the backslashes added to the query string, so that the If statement does its job properly??

Thanks heaps!!

perkes456
  • 1,163
  • 4
  • 25
  • 49
  • 1
    can you post the error message you are getting? – IzzEps May 13 '16 at 14:45
  • I'm getting a custom error from the application... it says "Oops, that page isn't available For some reason, the page you were looking for isn't here. Try again later" – perkes456 May 13 '16 at 14:46
  • You ain't doing anything wrong to access it. Using `$_GET['id']` is just fine for this. – Akshay May 13 '16 at 14:47
  • it's laravel? you can try configuration display error – Naumov May 13 '16 at 14:47
  • 1
    No this is Zend framework @Naumov – perkes456 May 13 '16 at 14:48
  • @Akshay apparently not... The error is there, not sure why tho ... :/ – perkes456 May 13 '16 at 14:49
  • Have you checked the HTTP status code? – Jonnix May 13 '16 at 14:50
  • Have you created a new route for that URL? I don't think it's an issue with the query string parameter. It sounds like you aren't even getting to that page. `$_GET["id"]` should still work if you are. – Don't Panic May 13 '16 at 14:53
  • @Don'tPanic no how can I do that? Can u reply as an answer and post how to do that, I think that might be the case here... – perkes456 May 13 '16 at 14:54
  • I'm sorry, I'm not that familiar with Zend Framework. I can only point you to what looks like it should be the appropriate documentation: http://framework.zend.com/manual/1.12/en/zend.controller.router.html – Don't Panic May 13 '16 at 14:57
  • If you are using a framework make sure you add the framework tag to your question. The answer for getting the query param in for example Zend Framework or Zend Framework 2 is very different from getting such thing in just php. – Wilt May 17 '16 at 14:30
  • For zend framework you find your will answer [here](http://stackoverflow.com/a/3733681/1697459) and for zend framework 2 you will find your answer [here](http://stackoverflow.com/a/12077127/1697459) – Wilt May 17 '16 at 14:32

0 Answers0