xxx123 Posted May 5, 2011 Share Posted May 5, 2011 Can someone help me with autologin with curl to a javascript page with login token ? This is the page source code : [*]<head> <META HTTP-EQUIV="pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>F625A</title> <LINK REL="stylesheet" HREF="css/login.css" TYPE="text/css" /> <LINK REL="stylesheet" HREF="css/styleen.css" TYPE="text/css" /> <script> function getObj(id) { return(document.getElementById(id)); } var time="60"; function setTime() { time=time-1; getObj("time").innerHTML=time+" secs"; } function setinner(type) { getObj("myLayer").style.visibility = type ; } function Transfer_meaning(id,value) { getObj(id).value=value; } function onFocus() { if( getObj("Frm_Username").disabled == false ) getObj("Frm_Username").focus(); } function ChangeLang() { var lang = "English"; getObj("_lang").disabled = false; getObj("Frm_Username").disabled = true; getObj("Frm_Password").disabled = true; if(true != getObj("TestLang01").disabled) { if ("English" == lang) { getObj("_lang").value = "Chinese"; } else if ("Chinese" == lang) { getObj("_lang").value = "English"; } document.fLogin.submit(); } } </script> </head> <body onload="onFocus();"> <div id="myLayer" onClick="setinner('hidden')" style="position:absolute; width:185px; height:91px; z-index:9; left: 900px; top: 140px; background: url(img/pop_up.gif) no-repeat; border: 1px none #000000; visibility: hidden;"> <div id="Layer1" style="position:absolute; width:180px; height:45px; z-index:10; left: 2px; top: 28px;"> <table width="183" border="0"> <tr> <td width="183"> <font id="errmsg" class="notecontent" ></font><span id="time" style="color:red;display:none;">60 secs</span></td> </tr> </table> </div> <div id="Layer3" style="position:absolute; width:140px; height:10px; z-index:11; left: 34px; top: 9px; font-size: 8pt;"> <font class="note" id="errnote"> Error</font> </div> </div> <div id="container"> <!--head²¿·Ö¿ªÊ¼--> <div id="head"> <div class="type"><font id="">F625A</font></div> <div id="banner" style="background-image:url(img/banner.gif); background-repeat:no-repeat"></div> </div> <!--head²¿·Ö½áÊø--> <!--content²¿·Ö¿ªÊ¼--> <form name="fLogin" id="fLogin" method="post" onsubmit="return false;" action=""> <input type="hidden" name="_lang" id="_lang" value="" disabled> <input type="hidden" name="frashnum" id="frashnum" value=""> <input type="hidden" name="Frm_Logintoken" id="Frm_Logintoken" value=""> <div class="login_bg"> <!--ÄÚÈÝ¿ªÊ¼--> <div class="login_frame"> <ul class="login_title"> <li class="login_title_left"></li> <li class="login_title_center">Please login...</li> <a id="TestLang" style="cursor:pointer" href="#" ><li id="TestLang01" class="login_title_centerch" style="background:url(../img/login_chinese.gif) no-repeat left top;" onclick="ChangeLang();"></li></a> <li class="login_title_right"></li> </ul> <div class="content login_content"> <ul class="login_blank"></ul> <ul class="login_ul_1"> <li class="login_li_1"><span>Username</span></li> <li class="login_li_2"> <input type="text" class="username" name="Username" id="Frm_Username"> </li> </ul> <ul class="login_blank"></ul> <ul class="login_ul_1"> <li class="login_li_1"><span>Password</span></li> <li class="login_li_2"> <input type="password" class="password" name="Password" id="Frm_Password"> </li> <li class="login_li_3"> <input class="login" type="submit" id="LoginId" value="Login" onclick="dosubmit()"> </li> </ul> </div> </div> <!--ÄÚÈݽáÊø--> </form> </div> <!--bottom²¿·Ö¿ªÊ¼--> <div class="content" style="text-align:center;"> Copyright © 2010 ZTE Corporation. All rights reserved. </div> <div class="bottom_line"></div> <div id="bottomx"></div> <!--bottom²¿·Ö½áÊø--> </div> </body> </html> <script> if(0 == 3||0==3) { SetDisabled(); } function SetDisabled() { getObj("errmsg").innerHTML = "Three times error, the system will be checked later. "; getObj("Frm_Username").disabled = true; getObj("Frm_Password").disabled = true; getObj("LoginId").disabled = true; getObj("TestLang01").disabled = true; getObj("myLayer").style.visibility = "visible" ; getObj("time").style.display = "" ; var timeout = setTimeout("setDisable()",60000); var interval = setInterval("setTime()",1000); } function setDisable() { getObj("Frm_Username").disabled = false; getObj("Frm_Password").disabled = false; getObj("LoginId").disabled = false; getObj("TestLang01").disabled = false; getObj("time").style.display = "none"; getObj("myLayer").style.visibility = "hidden"; } function dosubmit() { if (getObj("Frm_Username").value == "") { getObj("errmsg").innerHTML = "Username cannot be empty."; getObj("myLayer").style.visibility = "visible" ; return; } else { getObj("Frm_Logintoken").value = "477951"; document.fLogin.submit(); } } </script> [*] Quote Link to comment https://forums.phpfreaks.com/topic/235591-curl-autologin-javascript-problem-login-token/ Share on other sites More sharing options...
trq Posted May 5, 2011 Share Posted May 5, 2011 And what is your question? Quote Link to comment https://forums.phpfreaks.com/topic/235591-curl-autologin-javascript-problem-login-token/#findComment-1210849 Share on other sites More sharing options...
xxx123 Posted May 5, 2011 Author Share Posted May 5, 2011 i want to do a curl script to autologin to that page but i don't know how it has a login token that changes his value every time Quote Link to comment https://forums.phpfreaks.com/topic/235591-curl-autologin-javascript-problem-login-token/#findComment-1210859 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.