You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using centos and have installed piwik in it.
I want to validate user's login on my website html page.
So my 1st page is test1.html and 2nd page will be test2.html.
I tried with using document.getElementById to capture the username from test1.html to test2.html like Test1.html <form action="test2.html>" onsubmit="MyFunction()" > <input type="text" name="username" id="username"/> <input type="submit" name="Login"/> </form><script> function MyFunction() { var username= document.getElementById("username"); } Test2.html : var _paq = _paq || []; _paq.push(['getUserId',username]); // _paq.push(['getUserId','"username'"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); `
even after doing this i am getting the username.
Plz help me to how to validate userlogin name.
The text was updated successfully, but these errors were encountered:
Possibly it is because of a type maybe. Can you try to remove the > in action="test2.html>".
_paq.push(['getUserId',username]); won't do anything as we do not save the username across requests. Maybe you want to call setUserId? In test2.html also make sure username is actually set.
Actually i need to get the value of username in my next page(page2.html). Where piwik stores that user_id in database and i get the username in my piwik plugin, where i have written a query to display user_Id. i.e select user_id from piwik_log_visit;
& if i remove form action then,how can i redirect to next page??
I'm sorry but I don't really understand what you are trying to achieve. AFAIK it is not possible to get the username on the next page via piwik.js. Actually, you kind of have to set the username on each request instead so piwik will always use the same username across requests of a specific user.
I'm not sure if a custom "Piwik plugin" can help you there either as Piwik won't really know which user it is when you query the API. Maybe try to store the username in a session or cookie within your regular application/website, then on each page request call _paq.push(['setUserId',usernameFromSessionOrCookieOr...]);.
Hi,
I am using centos and have installed piwik in it.
I want to validate user's login on my website html page.
So my 1st page is test1.html and 2nd page will be test2.html.
I tried with using document.getElementById to capture the username from test1.html to test2.html like
Test1.html
<form action="test2.html>" onsubmit="MyFunction()" >
<input type="text" name="username" id="username"/>
<input type="submit" name="Login"/>
</form><script>
function MyFunction() { var username= document.getElementById("username"); }
Test2.html :
var _paq = _paq || []; _paq.push(['getUserId',username]); // _paq.push(['getUserId','"username'"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']);
`even after doing this i am getting the username.
Plz help me to how to validate userlogin name.
The text was updated successfully, but these errors were encountered: