Copy link to clipboard
Copied
HI all.. I know enough of the DW8 behaviors to retrieve a mySQL table record, and place field values on the page.. but what I need to do is assign a cookie on that page... where the cookie name value is pulled from a mySQL record. This means manually coding it no doubt, but I can't figure out the context of the statement to assign a dynamic value to a cookie. Help???
Copy link to clipboard
Copied
have you looked here:
http://www.w3schools.com/php/func_http_setcookie.asp
<?php
$value = $your_recordset_row['recordset_value'];
// send a cookie that expires in 72 hours
setcookie("Cookie_Name",$value, time()+3600*72);
?>
Copy link to clipboard
Copied
This is the problem.. even in your example the cookie name is hard coded to "Cookie_name" .. but this is the value I need to populate from a dynamic value...
Copy link to clipboard
Copied
I dont know the first thing about php, but would have to guess it would be as simple as:
<?php
$value = $your_recordset_row['recordset_value'];
$cookieName = $your_recordset_row['recordset_cookieName'];
// send a cookie that expires in 72 hours
setcookie("$cookieName",$value, time()+3600*72);
?>