Passing $_GET variables.

A collection of tutorials and posts that show additional functionality of MATE

Moderator: KarelB

Re: Passing $_GET variables.

Postby hexxamillion » Tue Jun 12, 2012 11:03 pm

This is interesting. I can get the list of my tables to show but can you help me understand the purpose of this code? When I select one of my tables the URL updates but the screen is just blank with the list of tables menu.
hexxamillion
 
Posts: 100
Joined: Fri Jul 08, 2011 11:36 pm

Re: Passing $_GET variables.

Postby KarelB » Fri Jun 22, 2012 12:12 pm

There is one assumption in the example and that is that there is an (auto increment) column 'id" that serves as the $primaryCol.
KarelB
 
Posts: 458
Joined: Mon Dec 01, 2008 11:49 pm
Location: The Netherlands

Re: Passing $_GET variables.

Postby AlexNu » Thu Jan 17, 2013 3:02 pm

I'm having some trouble with this in the free version.

Inside, display_html, the line you say to look for isn't there. The closest there is is this:
Code: Select all
var ajaxUrl = '<?php echo $_SERVER['PHP_SELF']; ?>;


Replacing that (or leaving it and adding) with the line given here in this thread,
Code: Select all
setAjaxInfo({url: "'.$_SERVER["PHP_SELF"].'?tbl='.$_GET["tbl"].'", history: true});


Doesn't seem to change anything. Also, my syntax highlighting doesn't seem to think that the quote marks are arranged properly.

Is ther some way I can alter teh ajaxUrl to make this work?
AlexNu
 
Posts: 4
Joined: Thu Jan 17, 2013 11:43 am

Re: Passing $_GET variables.

Postby lukasnem » Tue Feb 16, 2016 1:29 pm

Hello,

I would like to ask how can I access to value of $_GET variables in the newest version of mate?

When I define $defaultSessionData like below searchString is empty, I thing it is because of base64_encode of url :

Code: Select all
$defaultSessionData['searchString'] = isset($_GET['search_string']) ? $_GET['search_string'] : '';
$defaultSessionData = base64_encode($this->Editor->jsonEncode($defaultSessionData));


I am using Autocomplete.php example.


Please help me
Best regards
lukasnem
 
Posts: 5
Joined: Tue Feb 16, 2016 12:10 pm

Re: Passing $_GET variables.

Postby lukasnem » Fri Mar 04, 2016 8:18 am

lukasnem wrote:Hello,

I would like to ask how can I access to value of $_GET variables in the newest version of mate?

When I define $defaultSessionData like below searchString is empty, I thing it is because of base64_encode of url :

Code: Select all
$defaultSessionData['searchString'] = isset($_GET['search_string']) ? $_GET['search_string'] : '';
$defaultSessionData = base64_encode($this->Editor->jsonEncode($defaultSessionData));


I am using Autocomplete.php example.


Please help me
Best regards




Solved
lukasnem
 
Posts: 5
Joined: Tue Feb 16, 2016 12:10 pm

Re: Passing $_GET variables.

Postby jack_c » Mon Dec 28, 2020 7:56 pm

Could someone (KarelB) please help me with updated code to pass a $_Get variable with the newer version (4.2) of mate? It appears that the functions have changed since the last post on this topic, and I do not know how to apply this.
My goal is to add buttons or a selector to allow changing which table is being edited. In previous versions, I was using a button to change a SESSION variable to do this.
Thanks
Jack
jack_c
 
Posts: 10
Joined: Mon Feb 18, 2013 7:44 pm

Previous

Return to How To

Who is online

Users browsing this forum: No registered users and 1 guest

cron