Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6858267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:08:11+00:00 2026-05-27T02:08:11+00:00

In cakePHP 1.3 , when I try to get the variables GET sent on

  • 0

In cakePHP 1.3 , when I try to get the variables GET sent on the url, I can use this :

$this->params['url'];

Example: url = www.mySite.com/messages/get/?var1=1&var2=2

the result of $this->params['url']; is :

Array => ( [url] => Array
    (
    [url] => messages/get
    [var1] => 1
    [var2] => 2
    )
)

But when I try to get those params from the same URL using cakePHP2.0, the result is in json format:

{"params":{"controller":"messages","named":[],"pass":[],"action":"index","plugin":null}}

There is no index ‘url’ in the array, so do you have any idea how to get those variables sent on the url that I posted using the attribute $params or something else?

EDIT :

i have tried this from the cookbook cakePHP2.0 :

<?php
// url is /posts/index?page=1&sort=title
$this->request->query['page'];

// You can also access it via array access
$this->request['url']['page'];

But i got the same Error :

Notice (8): Undefined index: page [APP\Controller\MessagesController.php, line 23]

Notice (8): Undefined index: page [APP\Controller\MessagesController.php, line 24]

Any ideas ??? how can i get the Variables sent on an url like this :

/posts/index?page=1&sort=title
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:08:11+00:00Added an answer on May 27, 2026 at 2:08 am

    There’s a new Request object in 2.0 that handles the query string among other things:

    <?php
    // url is /posts/index?page=1&sort=title
    $this->request->query['page'];
    
    // You can also access it via array access
    $this->request['url']['page'];
    

    From the 2.0 Request object docs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm starting out with CakePHP 2.0 and can't get past a simple login. This
I followed this tutorial to create multilingual site. http://nuts-and-bolts-of-cakephp.com/2008/11/28/cakephp-url-based-language-switching-for-i18n-and-l10n-internationalization-and-localization/ However although I can get
In CakePHP we can use $this->Auth->allow('someMethod'); to make a page viewable without having to
I'm getting this error when I try to mail from CakePHP 2.0 using CakeEmail:
Hey there, I'm using the tutorial at http://www.jamesfairhurst.co.uk/posts/view/uploading_files_and_images_with_cakephp to try to get myself up
in CakePHP book example here I try: cake bake all then I choose 1
I've get this message when I tried to use a wrong controller and I
In a CakePHP 1.2 app, I'm using <?php $session->flash();?> to output messages like Record
I have the CakePHP stack in /var/www/site from one view under controller A I
I use CakePHP 1.2.6 and have the following relations: Showcase HABTM User belongsTo Galleryitem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.