Help with transferring values, How to transfer variable values to different parts of program |
Help with transferring values, How to transfer variable values to different parts of program |
fhutt |
Mar 25 2021, 08:50 PM
Post
#1
|
Group: Members Posts: 6 Joined: 25-March 21 Member No.: 27,870 |
Hello,
I have an index page in my secure website with $AUTH_USER variable with the string from the username in the windows 7 login form. This appears to be accessible in the <table> section of the page if the value is derived from the login form. There are times when I would like to change this by entering a different username on the URL eg. https://mypage.com/?name=Family I had problems extracting this 'name' value from the URL but now have it working. What I need to do now is to be able to use this new value in the <table> section. Here are snippets of code. CODE <script> function getQuery(q) { return (window.location.search.match(new RegExp('[?&]' + q + '=([^&]+)')) || [, null])[1]; } var _USER = getQuery("name") document.write("<br>Current user name: '" + _USER + "'<br>") var $AUTH_USER = _USER document.write("<br>Current user name: '" + $AUTH_USER + "'<br>") </script> <table class="c6" cellpadding="5" align="center"> <!--#if expr="$AUTH_USER = Family" --> some code that works here .... <!--#endif --> <!table> The problem is in the <table> section. I verify that the _USER and $AUTH_USER values are correct in the <script> section but $AUTH_USER value is wrong in the <table> section since the IF condition is not met. Could someone please point me in the right direction? Thanks |
fhutt |
Mar 27 2021, 09:12 PM
Post
#2
|
Group: Members Posts: 6 Joined: 25-March 21 Member No.: 27,870 |
Yes.
|
Lo-Fi Version | Time is now: 14th June 2024 - 09:59 AM |