[Solved]Constant Post Data

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
stuartp44
New Member
New Member
Posts: 2
Joined: Thu Feb 12, 2015 9:34 am

[Solved]Constant Post Data

Post by stuartp44 »

Hi all,

At present we have a Wireless system that uses WISPr to hand off the front end Wi-Fi authentication to a webserver, and in our case this is a Windows Server with CMS Made Simple on it. The webserver gets traffic from the Wi-Fi controller with all the information on the query string, for example "?loc=blah&sip=123.123.123.123&ip=123.123.123.123". So once the webserver receives the information i am trying to keep it nestled in the users session via a UDT, so we can ask the user to login. We then call it in a few pages and a forms that i have created to get the user to agree to the terms and conditions of service. However when the hits the page the data goes into an array and that array is put into the users session the second you navigate away from the page the data is missing but the array is there with the data headings. The code i am using is below

Code: Select all

$wifidata = array();
$wifidata['sip'] = htmlspecialchars($_GET["sip"]);
$wifidata['mac'] = htmlspecialchars($_GET["mac"]);
$wifidata['client_mac'] = htmlspecialchars($_GET["client_mac"]);
$wifidata['uip'] = htmlspecialchars($_GET["uip"]);
$wifidata['lid'] = htmlspecialchars($_GET["lid"]);
$wifidata['dn'] = htmlspecialchars($_GET["dn"]);
$wifidata['url'] = htmlspecialchars($_GET["url"]);
$wifidata['ssid'] = htmlspecialchars($_GET["ssid"]);
$wifidata['loc'] = htmlspecialchars($_GET["loc"]);
$wifidata['vlan'] = htmlspecialchars($_GET["vlan"]);
$smarty->assign('wifidatapass',$wifidata);
$_SESSION[$var] = $wifidata;
All i want is the data that is captured via the query string right at the beginning to stay with that user, though-out the login process.

I am not a PHP expert and thats why i like CMS Made Simple because it just works with very limited knowledge however i am a little out of my depth at the moment.

A
Last edited by stuartp44 on Tue Feb 24, 2015 10:47 am, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Constant Post Data

Post by velden »

Without looking into the details: the existance of the variable and it headings suggest the UDT is called after the original request. Of course without the query string. Result a array with the proper keys but empty values.

So make sure to check for the existance of the proper query string variables or something else before overwriting the variable in the array.

Using cookies in CMSMS: http://www.cmscanbesimple.org/blog/set- ... ug-cookies
stuartp44
New Member
New Member
Posts: 2
Joined: Thu Feb 12, 2015 9:34 am

Re: Constant Post Data

Post by stuartp44 »

Thanks velden,

I ended up using the Cookie system, i was trying to steer away from using cookies but it works and i cant Complain. I did however create a udt of my own rather than using the one your stated as i want things a little bit different.

Thanks again,

Stuart
Post Reply

Return to “The Lounge”