Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 05/09/2017 BIG Autumn SALE

    Use AUTUMN17 coupon code to buy our WordPress or Joomla! extensions with 25% discount. Hurry up! The offer is valid till 11 September.

  • 14/04/2017 Happy Easter

    Wish a Happy Easter and give 30% discount for all our WordPress and Joomla! extensions. Use EASTER17 coupon code. The offer is valid till 17 April.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Use $SESSION instead of $REQUEST variables
(1 viewing) (1) Guest
Go to bottomPage: 123
TOPIC: Use $SESSION instead of $REQUEST variables
#56238
Use $SESSION instead of $REQUEST variables 1 Year, 11 Months ago Karma: 0
Hi,

I am currently using $REQUEST variables to pass parameters that the ARI DataTables module is catching and using in its' SQL statement. This works fine but the URL length is becoming a concern. I want to attempt to modify the site pages to use $SESSION variables stored directly on the server instead.

Please see the thread in the link below to see how I am currently using $REQUEST variables passed through the URL,

www.ari-soft.com/ARI-Data-Tables/53660-Strange-Problem-Returning-Specific-MySQL-Results.html

Can $SESSION variable values be called and used in the SQL statements within the ARI DataTables modules? If so, can you provide a simple example? Using $SESSION variables instead will enable me to remove all URL parameters and shorten the URLs.

Please note, this question relates only to using $SESSION variables instead of the $REQUEST variables ONLY in the WHERE statement of the SQL statement, not anywhere else.

Thanks in advance.

Ken
Last Edit: 2015/11/11 18:00 By kefford.
The administrator has disabled public write access.
 
#56240
Re:Use $SESSION instead of $REQUEST variables 1 Year, 11 Months ago Karma: 667
Hello,

Upgrade the module to v. 1.15.4. It supports ability to use session variables in SQL queries. The sample query where "article_id" session variable is used:

Code:


SELECT
 id,
 title
FROM
 #__content
WHERE
 id = {$SESSION:article_id|empty:''}



Regards,
ARI Soft
The administrator has disabled public write access.
 
#56243
Re:Use $SESSION instead of $REQUEST variables 1 Year, 11 Months ago Karma: 0
Excellent, thank you. I will test it following your example.

Ken
The administrator has disabled public write access.
 
#58633
Re:Use $SESSION instead of $REQUEST variables 1 Year ago Karma: 0
Hi,

I tried changing to $SESSION variables but without results. The query does not return data.

I was using $REQUEST variables passed through the URL string, as follows, and this works perfectly,

SELECT
LocRegion as Region,
COUNT(DISTINCT uSimID) AS Count
FROM Simulators
WHERE
MarkForDeletion <> "1"
AND
({$REQUEST:vOrganization|empty:""} = '' OR Organization LIKE CONCAT('%',{$REQUEST:vOrganization|empty:""},'%'))
AND
({$REQUEST:vTrainingNetwork|empty:""} = '' OR TrainingNetwork LIKE CONCAT({$REQUEST:vTrainingNetwork|empty:""},'%'))
GROUP BY
LocRegion
ORDER BY
Count DESC

When I changed to $SESSION variables, as follows, the query does not return any data,

SELECT
LocRegion as Region,
COUNT(DISTINCT uSimID) AS Count
FROM Simulators
WHERE
MarkForDeletion <> "1"
AND
({$SESSION:vOrganization|empty:""} = '' OR Organization LIKE CONCAT('%',{$SESSION:vOrganization|empty:""},'%'))
AND
({$SESSION:vTrainingNetwork|empty:""} = '' OR TrainingNetwork LIKE CONCAT({$SESSION:vTrainingNetwork|empty:""},'%'))
GROUP BY
LocRegion
ORDER BY
Count DESC

Also, I have confirmed that the $SESSION variables are set and being read properly because on the same form and article I re-load the data from those same $SESSION variables.

Am I missing something? Do I have to include a session_start() call? If so, where?

Ken
The administrator has disabled public write access.
 
#58634
Re:Use $SESSION instead of $REQUEST variables 1 Year ago Karma: 667
Hello,

Could you provide a link to a page where use the module and a temporary access to your J! backend by email?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#58635
Re:Use $SESSION instead of $REQUEST variables 1 Year ago Karma: 0
How should I send the details? I do not want the login details posted on a forum. Is there a secure way to send?
The administrator has disabled public write access.
 
Go to topPage: 123