Pass the logged in username the sAjaxSource
Pass the logged in username the sAjaxSource
SomethingSeven
Posts: 2Questions: 0Answers: 0
Guys,
I'm having trouble passing the logged in username (WordPress) to the sAjaxSource php file so I can mysql_query appropriately. I've tried to globalize my username variable, use an include.php file with the username in it to no avail..
How do I pass a php variable into the sAjaxSource file from my php file that displays the data??
Thanks!
I'm having trouble passing the logged in username (WordPress) to the sAjaxSource php file so I can mysql_query appropriately. I've tried to globalize my username variable, use an include.php file with the username in it to no avail..
How do I pass a php variable into the sAjaxSource file from my php file that displays the data??
Thanks!
This discussion has been closed.
Replies
In my php file that houses the DataTable:
[code]
session_start(); // must be called before data is sent
$_SESSION['user_name'] = $current_user->user_login;
[/code]
And in my sAjaxSource php file:
[code]
session_start(); // must be called before data is sent
$_SESSION['user_name'] = $current_user->user_login;
[/code]
Allan