Forums: [SOLVED] Access Search String in List page event - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[SOLVED] Access Search String in List page event how to ? Rate Topic: -----

#1 User is offline   thamesytader 

  • Member
  • PipPip
  • Group: Members
  • Posts: 21
  • Joined: 04-December 15

Posted 29 November 2017 - 11:17 PM

Does anyone have any thoughts as to how I can access the variables or parameters on the webpage 'address' line please?

I want to put code in the JSonload event that can take different actions based on the absence or presence of variables after the xxxxxx.php filename.
......fb_person_list.php - this is an example without variables when the list page is loaded from the menu

The three examples below are when a search has been done using the search field in the standard search bar on the list page.

......fb_person_list.php?qs=b
......fb_person_list.php?qs=b&criteria=or
......fb_person_list.php?qs=Dibnah&criteria=or


I'm not bothered about the actual variable values - just whether or not there is something after the .php.

I have tried $_SERVER["QUERY_STRING"] in BeforeDisplay event to set a proxy variable to display in an alert in JSonload, I've tried the same in the Server and After Client tabs of a custom button on the page. In both cases it shows NULL.

I've also tried $_GET['qs'], $_REQUEST["field1"] in both SeforeDisplay and Server tab of custom button - again nothing is returned.

I tried this code from the PHP manual in the server tab of a custom button on the list page - it didn't do anything either
global $strTableName;
if (isset($_SESSION[$strTableName.'_advsearch']))
{
$searchClauseObj = unserialize($_SESSION[$strTableName.'_advsearch']);
}
echo $searchClauseObj->_where[$searchClauseObj->sessionPrefix."_simpleSrch"];


I've trawled the Forum for ideas and nothing I've tried has worked, so I must be doing something wrong as both these methods have been described in Forum posts as successful.

Thanks
0

#2 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15553
  • Joined: 03-February 03

Posted 30 November 2017 - 10:50 AM

$_SERVER['QUERY_STRING'] should work and normally returns everything after a question sign.
Best regards,
Sergey Kornilov
0

#3 User is offline   YCH 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 62
  • Joined: 06-September 11

Posted 30 November 2017 - 12:20 PM

View Postadmin, on 30 November 2017 - 11:50 AM, said:

$_SERVER['QUERY_STRING'] should work and normally returns everything after a question sign.



$_SERVER['QUERY_STRING'] is not documented in the manual ?
I made request in "search" but nothing showed.
0

#4 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15553
  • Joined: 03-February 03

Posted 30 November 2017 - 12:42 PM

Yes, because is has nothing to do with PHPRunner. This is a PHP feature, Google it.
Best regards,
Sergey Kornilov
0

#5 User is offline   YCH 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 62
  • Joined: 06-September 11

Posted 30 November 2017 - 12:43 PM

View Postadmin, on 30 November 2017 - 01:42 PM, said:

Yes, because is has nothing to do with PHPRunner. This is a PHP feature, Google it.



All right. Thanks. Learning...
0

#6 User is offline   thamesytader 

  • Member
  • PipPip
  • Group: Members
  • Posts: 21
  • Joined: 04-December 15

Posted 30 November 2017 - 09:02 PM

View Postadmin, on 30 November 2017 - 10:50 AM, said:

$_SERVER['QUERY_STRING'] should work and normally returns everything after a question sign.


Thanks Sergey.

I tried it on my List page and it only returned data if I used advanced search, but this page uses a custom view and the pages have been edited to remove some standard fields plus it has event code. I then tried it on a table list page that has not been modified and it worked perfectly returning data for Advanced Search, Basic Search and the simplecombosearch fields.

So I now know that the problem is with the custom view List page - so I'm going to RESET the page and try the $_SERVER['QUERY_STRING'] prior to any editing and removing the simplecombosearch fieldname and fieldtype controls.
0

#7 User is offline   thamesytader 

  • Member
  • PipPip
  • Group: Members
  • Posts: 21
  • Joined: 04-December 15

Post icon  Posted 30 November 2017 - 10:52 PM

View Postthamesytader, on 30 November 2017 - 09:02 PM, said:

I tried it on my List page and it only returned data if I used advanced search, but this page uses a custom view and the pages have been edited to remove some standard fields plus it has event code. I then tried it on a table list page that has not been modified and it worked perfectly returning data for Advanced Search, Basic Search and the simplecombosearch fields.

So I now know that the problem is with the custom view List page - so I'm going to RESET the page and try the $_SERVER['QUERY_STRING'] prior to any editing and removing the simplecombosearch fieldname and fieldtype controls.


I think I've identified the cause......

Its to do with the AJAX Search, Pagination and Sorting option on the list page settings. If this is ticked then the ['QUERY_STRING'] only returns data when the Advanced Search is used. If it is unchecked then ['QUERY_STRING'] returns data from basic search, search panel and Advanced Search.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic