• Navigation
Results 1 to 15 of 15
  1. #1
    Sea Torques
    Join Date
    Aug 2007
    Posts
    514
    BG Level
    5

    HTML / VBS / Java Script Gurus -- Help Needed!

    I recently created an intranet site for work and now I'm looking to add something to it, but I need some help as it gets into an area I'm unfamiliar with.

    Our corporate offices want us to make a site available to all our users, but with a catch. The site requires a login, but they don't want anybody to have to actually log in. So they gave us this script (address and login info changed):

    Code:
    'On Error Resume Next
    WScript.Quit Main
    
    Function Main
      Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
      IE.Visible = True
      IE.Navigate "http://url.aspx"
      Wait IE
      With IE.Document
        .getElementByID("txtClientID").value = "xxxx"
        .getElementByID("txtUserID").value = "xxxx"
        .getElementByID("txtPassword").value = "xxxx"
        .all.item("cmdLogin").Click
        End With
    End Function
    
    Sub Wait(IE)
      Do
        WScript.Sleep 500
      Loop While IE.ReadyState < 4 And IE.Busy 
      Do
        WScript.Sleep 500
      Loop While IE.ReadyState < 4 And IE.Busy 
    End Sub
    
    Sub IE_OnQuit
      On Error Resume Next
      WScript.StdErr.WriteLine "IE closed before script finished."
      WScript.Quit
    End Sub
    Running this as a vbs works fine to launch the site and log in, and the easy solution would be to just put a shortcut to the vbs on everybody's desktop. However, we're trying to get people to use the intranet more so we'd rather make them go there to access this site. I'm getting fairly decent at HTML, but I'm still a noob with VB and javascript. I can just point a link to the vbs file, but that pops up 2 windows (one for open/save/cancel and one for run/don't run). I'm hoping to put this script directly into the webpage to avoid those popups but that's where I'm getting stuck. Standard WScript functions don't seem to work in HTML. Can anyone help me convert this to something that would run inside HTML, or is this even possible?

    To summarize, can I put code in my page that will launch another IE window (or stay in the same window if that's more feasible) and enter the data into three fields to log in?

    Thanks for any help BG!

  2. #2
    Conejita's Jolly
    Chaparrita's Dulce
    Trigger warning: Fuck your feelings.

    Join Date
    Feb 2006
    Posts
    7,075
    BG Level
    8

    Let me get this straight. You want to have a log in website that doesn't require anybody to log in? Sort of have the fields already filled in?

    Anyway, yeah you can. Use Javascript, PHP, or CF (very little support).

  3. #3
    Sea Torques
    Join Date
    Aug 2007
    Posts
    514
    BG Level
    5

    Quote Originally Posted by Meteora View Post
    Let me get this straight. You want to have a log in website that doesn't require anybody to log in? Sort of have the fields already filled in?

    Anyway, yeah you can. Use Javascript, PHP, or CF (very little support).
    Kind of. To clarify, the site that requires a login I have no control over. I have no way to alter the code on that site in any way. All I have is my own site which at the moment has a regular link to the login site. I was provided with a script that enters the required login info, but I'm trying to find a way to integrate that script into my own site and enter the info when they click on the link. My site doesn't require a login, just the site I'm linking to.

  4. #4
    Warrior Tank
    Join Date
    Nov 2007
    Posts
    607
    BG Level
    5
    WoW Realm
    Burning Blade

    Spoiler: show
    Retarded code removed ;3


    Actually, ignore the above.. this is a LOT cleaner:

    Code:
    <script type="text/javascript">
    function fillLogin()
    {
    var loadDelay = 2000;
    opening = window.open("theloginpage.html");
    
    setTimeout("opening.document.getElementById('txtClientID').value='xxxx';",loadDelay);
    setTimeout("opening.document.getElementById('txtUserID').value='xxxx';",loadDelay);
    setTimeout("opening.document.getElementById('txtPassword').value='xxxx';",loadDelay);
    }
    </script>
    
    Button: <input type="button" value="Load Login Page" OnClick="fillLogin()">
    
    or
    
    Link: <a href="#" OnClick="fillLogin()">
    Works in IE and Firefox, can set the delay lower if you want. (1000 = 1 second)

  5. #5
    Sea Torques
    Join Date
    Aug 2007
    Posts
    514
    BG Level
    5

    Quote Originally Posted by byte View Post
    Spoiler: show
    Retarded code removed ;3


    Actually, ignore the above.. this is a LOT cleaner:

    Code:
    <script type="text/javascript">
    function fillLogin()
    {
    var loadDelay = 2000;
    opening = window.open("theloginpage.html");
    
    setTimeout("opening.document.getElementById('txtClientID').value='xxxx';",loadDelay);
    setTimeout("opening.document.getElementById('txtUserID').value='xxxx';",loadDelay);
    setTimeout("opening.document.getElementById('txtPassword').value='xxxx';",loadDelay);
    }
    </script>
    
    Button: <input type="button" value="Load Login Page" OnClick="fillLogin()">
    
    or
    
    Link: <a href="#" OnClick="fillLogin()">
    Works in IE and Firefox, can set the delay lower if you want. (1000 = 1 second)

    This is launching the page, but the fields aren't receiving any text. I'll spend some time with it in the morning, I think I should be able to figure out what's going on. Thanks for pointing me in the right direction. :D

  6. #6
    Warrior Tank
    Join Date
    Nov 2007
    Posts
    607
    BG Level
    5
    WoW Realm
    Burning Blade

    Well, the fields should be receiving text after 2 seconds (2000) and they do when I tested it.

    This is the html I had for the login page:

    HTML Code:
    <input type="Text" id="txtClientID" />
    <input type="Text" id="txtUserID" />
    <input type="Text" id="txtPassword" />
    document.getElementById() will only work if those textboxes HAVE an id (Which is what your first post implied). If, however, they don't have ids, you can refer to them by name (provided that they are inside a named <form>).

    HTML Code:
    <form name="loginform" action="etc. etc." method="GET">
    <input type="Text" name="Client" />
    <input type="Text" name="User" />
    <input type="Text" name="Password" />
    </form>
    Code:
    function fillLogin()
    {
    var loadDelay = 2000;
    opening = window.open("theloginpage.html");
    
    setTimeout("opening.document.loginform.Client.value='xxxx';",loadDelay);
    setTimeout("opening.document.loginform.User.value='xxxx';",loadDelay);
    setTimeout("opening.document.loginform.Password.value='xxxx';",loadDelay);
    }
    ps. Remember to enable scripts for file:// if you have NoScript on ._. otherwise, it will never work lol


    ----------

    I took this a step further and decided to make an auto-login USB stick which could fill out my username and password on multiple sites once I plug it in. All these files can be made in notepad (just make sure to save them as the right extensions). Just create them and put them on the drive.

    Spoiler: show

    autologin.html
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <script type="text/javascript" src="fillLogin.js"></script>
    </head>
    
    <body onload="fillLogin()"> 
    </body>
    </html>
    fillLogin.js
    Code:
    var webList = new Array();
    var username = new Array();
    var userBox = new Array();
    var password = new Array();
    var passBox = new Array();
    
    var loadDelay = 3000;
    
    // Add your sites here:
    // (Example)
    
    webList[0]="test.html"; // Website Address:
    username[0]="my name"; // Username:
    userBox[0]="user"; // Id for Username textbox
    password[0]="secret"; // Password:
    passBox[0]="pass"; // Id for Password textbox
    
    //webList[1]="http://mail.google.com/";
    //username[1]="[email protected]";
    //userBox[1]="Email";
    //password[1]="the_password";
    //passBox[1]="Passwd";
    
    
    // ==== DO NOT EDIT BELOW ===
    
    function fillLogin()
    {
    	for (i=0;i<username.length;i++)
    	{
    		opener = window.open(webList[i]);
    		setTimeout("opener.document.getElementById('" + userBox[i] + "').value='"
    		 + username[i] + "';", loadDelay);
    		setTimeout("opener.document.getElementById('" + passBox[i] + "').value='"
    		 + password[i] + "';", loadDelay);
    	}
    }
    
    // === end ===
    Autorun.inf
    Code:
    [autorun]
    Open = firefox.exe "autologin.html"
    shell\open\command=firefox.exe "autologin.html"
    useautoplay=1
    And finally, the test file

    test.html
    HTML Code:
    <input type="Text" id="user" />
    <input type="Password" id="pass" />


    edit: Hmm.. curiously, this doesn't seem to work when the source and destination are not on the same server. Maybe for security reasons..
    Oh well, my idea of multiple site login was kind of useless if this is the case XD

    Perhaps that's why it doesn't work for you?

    edit2: Potentially, you could trick the browser into thinking the source and destination are the same by using a PHP include. I don't really have time to work on this now. I'll see what I can come up with later.

  7. #7
    Sea Torques
    Join Date
    Aug 2007
    Posts
    514
    BG Level
    5

    Quote Originally Posted by byte View Post

    edit: Hmm.. curiously, this doesn't seem to work when the source and destination are not on the same server. Maybe for security reasons..
    Oh well, my idea of multiple site login was kind of useless if this is the case XD

    Perhaps that's why it doesn't work for you?

    edit2: Potentially, you could trick the browser into thinking the source and destination are the same by using a PHP include. I don't really have time to work on this now. I'll see what I can come up with later.
    This seems to be exactly the case. Just to test this, I copied the source from the login page to an index_test.html and threw it onto the same server that is serving my webpage and the fields are receiving the input.

  8. #8
    Banned.

    Join Date
    Jul 2005
    Posts
    5,821
    BG Level
    8
    FFXI Server
    Sylph
    WoW Realm
    Arthas

    You cannot have cross domain Javascript..

  9. #9
    Sea Torques
    Join Date
    Aug 2007
    Posts
    514
    BG Level
    5

    Quote Originally Posted by Senoska View Post
    You cannot have cross domain Javascript..

    How about this scenario (this is all internal, none of these pages are hosted to the world)?
    The server I'm hosting from is servername.companyname.corp in Utah.
    The server hosting the login page is servername.cdc.companyname.corp at our corporate office in Tennessee.
    So the second server is in a subdomain within the same forest. Actually, we've all been in the middle of a migration so hopefully that cdc will go away and it will be directly a part of the same domain sometime soon. So I'm assuming that if it's migrated it will work, but as it is it won't work due to the cdc domain?

    Edit: Just for a test, I added a host entry to our DNS server pointing to the server at corporate and pointed my link to the new DNS entry rather than directly to the server (so now I can ping fake-entry.companyname.corp without the cdc). No luck with that route.

  10. #10
    Banned.

    Join Date
    Jul 2005
    Posts
    5,821
    BG Level
    8
    FFXI Server
    Sylph
    WoW Realm
    Arthas

    I think they have to be the same domain, even subdomains might through it off. I'm not too sure how to answer that though, but you're for sure running into a cross domain error right now. The code posted here works. If they wanted this so badly, why not add a $_GET value to fill in the text boxes? That'd be like the easiest shit in the world...

  11. #11
    Sea Torques
    Join Date
    Aug 2007
    Posts
    514
    BG Level
    5

    Quote Originally Posted by Senoska View Post
    I think they have to be the same domain, even subdomains might through it off. I'm not too sure how to answer that though, but you're for sure running into a cross domain error right now. The code posted here works. If they wanted this so badly, why not add a $_GET value to fill in the text boxes? That'd be like the easiest shit in the world...
    Corporate people don't do things the easy way lol. They let us peons figure out how to make it work in the real world.

    One of my coworkers who is decent with VB found a possible avenue, but we're still having troubles there. He created this test.html (this is the code in its entriety):
    Code:
    <html>
    <head>
    <title>Learn something new</title>
    </head>
    <body>
    <Input language="VBScript" type="Button" value="Click me" onclick="ExecHTA()">
    <Script language="VBScript">
    ' Public Object so i dont have to keep making them
    'and they are separated by subs or functions
    Public w
    Set w = CreateObject("WScript.Shell")
    
    Sub ExecHTA()
    w.Exec("wscript C:/STARS_ENTERPRISE.vbs")
    End Sub
    
    </Script>
    </body>
    </html>
    This works when run directly run from the PC, but once we move it to the server and it's hosted it stops working. So we're looking at this as another possibility, but not sure what's stopping the script from running once it's being hosted (if IIS is the issue, we can look at other hosting methods).

    Thanks guys, this is all very helpful. :D

    Edit: Just to clarify that the script being run in this code is the same vbs script in the first post, in case that wasn't clear.

  12. #12
    Warrior Tank
    Join Date
    Nov 2007
    Posts
    607
    BG Level
    5
    WoW Realm
    Burning Blade

    Is it not possible to send form data cross domain? In that case, you could create 2 local files as I did and use the second one to login and post the form data straight to the other program? There might also be a way to send POST through the jscript window.open() but I don't know about that.

    It would be much more helpful if you could post the source of the login page you're trying to send to. Just the part with the login form.

    Quote Originally Posted by Senoska View Post
    I think they have to be the same domain, even subdomains might through it off. I'm not too sure how to answer that though, but you're for sure running into a cross domain error right now. The code posted here works. If they wanted this so badly, why not add a $_GET value to fill in the text boxes? That'd be like the easiest shit in the world...
    Proof of said easiness -_-
    HTML Code:
    loginpage.html
    <input type="text" id="txtClientID" value="<?php if (isset($_GET['sendClientID'])) { echo $_GET['sendClientID']; } ?>" />
    <input type="text" id="txtUserID" value="<?php if (isset($_GET['sendUserID'])) { echo $_GET['sendUserID']; } ?>" />
    <input type="text" id="txtPassword" value="<?php if (isset($_GET['sendPassword'])) { echo $_GET['sendPassword']; } ?>" />
    
    First Page:
    <a href="loginpage.html?sendClientID=xxxx&sendUserID=xxxx&sendPassword=xxxx">Click Me!</a>
    Gotta hate the boss/non techy types for making the programmer's life hell, huh .

  13. #13
    Sea Torques
    Join Date
    Aug 2007
    Posts
    514
    BG Level
    5

    Quote Originally Posted by byte View Post
    Is it not possible to send form data cross domain? In that case, you could create 2 local files as I did and use the second one to login and post the form data straight to the other program? There might also be a way to send POST through the jscript window.open() but I don't know about that.

    It would be much more helpful if you could post the source of the login page you're trying to send to. Just the part with the login form.



    Proof of said easiness -_-
    HTML Code:
    loginpage.html
    <input type="text" id="txtClientID" value="<?php if (isset($_GET['sendClientID'])) { echo $_GET['sendClientID']; } ?>" />
    <input type="text" id="txtUserID" value="<?php if (isset($_GET['sendUserID'])) { echo $_GET['sendUserID']; } ?>" />
    <input type="text" id="txtPassword" value="<?php if (isset($_GET['sendPassword'])) { echo $_GET['sendPassword']; } ?>" />
    
    First Page:
    <a href="loginpage.html?sendClientID=xxxx&sendUserID=xxxx&sendPassword=xxxx">Click Me!</a>
    Gotta hate the boss/non techy types for making the programmer's life hell, huh .
    This is the login page source:
    Spoiler: show
    Code:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <html>
    	<head>
    		<title>
    			STARS Enterprise
    		</title>
    		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    		<meta name="GENERATOR" content="Microsoft Visual Studio 7.0"/>
    		<meta name="CODE_LANGUAGE" content="C#"/>
    		<meta name="vs_defaultClientScript" content="JavaScript"/>
    		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"/>
    		<link rel="shortcut icon" href="/Stars/images/stars_icon.ico"/> 
    		<link rel="stylesheet" type="text/css" href="/Stars/styles/unsecured/unsecuredstyles.css"/>
    	</head>
    	<body topmargin="5" marginwidth="5" marginheight="5" leftmargin="5" rightmargin="5" bgcolor="#ffffff" onload="javascript:document.forms[0]['txtTimeZoneOffset'].value=new Date().getTimezoneOffset();">
    		<form name="Login" method="post" action="login.aspx" id="Login">
    <div>
    <input type="hidden" name="__view_cache" id="__view_cache" value="5671016c-d67b-45ee-879a-f1334d93e9a4" />
    <input type="hidden" name="__POSTNEWBROWSER" id="__POSTNEWBROWSER" value="" />
    <input type="hidden" name="__MESSAGEWINDOWPRESENT" id="__MESSAGEWINDOWPRESENT" value="" />
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTI0MTU4NDMyNg9kFgJmD2QWAgILDw8WAh4EVGV4dAUPTG9nIEluIHRvIFNUQVJTZGRk/X2B2s4RA0+/Di9ZmJfaT6+mGl0=" />
    </div>
    
    <script src="/Stars/scripts/unsecured/messaging.js" type="text/javascript" ></script><script src="/Stars/scripts/unsecured/navigation.js" type="text/javascript" ></script><script type="text/javascript">try { if ( window.screenTop > HiddenWindowLeft  && ( MessageWindow != 'Yes' ) )	{ center_and_resize_window( HiddenWindowWidth, HiddenWindowHeight ); } }catch( ex ){ /*eat the error*/ } document.body.attachEvent("onkeydown", handle_window_keydown)</script>
    <div>
    
    	<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
    	<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
    </div>
    			<style>
    				#body_section { PADDING-LEFT: 100px; VERTICAL-ALIGN: top }
    				#welcomeImage { MARGIN-TOP: 40px; MARGIN-BOTTOM: 40px }
    				.instruct { FONT-WEIGHT: bold; FONT-SIZE: 14px; MARGIN-BOTTOM: 10px }
    				A { COLOR: #57699b }
    			</style>
    			<table id="tblForm" cellspacing="0" cellpadding="0" border="0" width="100%" height="100%">
    				<tr>
    					<td>
    						
    <style>
    	#marshBanner
    	{
    		text-align: right;
    		height: 63px;
    		
    		background-image: url('/Stars/images/header_gradient_blue.gif');
    		background-repeat: repeat-x;
    		background-position: top-left;
    		
    		padding-right: 12px;
    	}
    	
    	#orange-lining
    	{
    		background-image: url('/Stars/images/box-top.gif');
    		background-repeat: repeat-x;
    		background-position: top-left;
    	}
    </style>
    <table id="tblTopSpace" cellspacing="0" cellpadding="0" border="0" width="100%" height="66px">
    	<tr>
    		<td id="marshBanner" width="100%">
    			<img id="CSSTARSLogo" src="/Stars/images/LogonLogo.gif" alt="CS STARS"/>
    		</td>
    	</tr>
    	<tr>
    		<td id="orange-lining" width="100%" height="3px">
    		</td>
    	</tr>
    </table>
    
    					</td>
    				</tr>
    				<tr height="100%">
    					<td id="body_section">
    						<div id="welcomeImage">
    							<img src='/Stars/images/welcome-en.gif'/>
    						</div>
    						<div class="instruct">
    						    <span>Please enter your user information.</span>
    						</div>
    						<table id='field' border="0">
    							<tr>
    								<td>
            						    <span>Client ID</span>
    								</td>
    								<td>
    									<input name="txtClientID" type="text" id="txtClientID" class="WebInputControlStyle" style="width:200px;" />
    								</td>
    							</tr>
    							<tr>
    								<td>
            						    <span>User ID</span>
    								</td>
    								<td>
    									<input name="txtUserID" type="text" id="txtUserID" class="WebInputControlStyle" style="width:200px;" />
    								</td>
    							</tr>
    							<tr>
    								<td>
            						    <span>Password</span>
    								</td>
    								<td>
    									<input name="txtPassword" type="password" id="txtPassword" class="WebInputControlStyle" style="width:200px;" />
    								</td>
    							</tr>
    							<tr>
    								<td/>
    								<td>
    									<a href="javascript:__doPostBack('forgotPassword','')">Forgot your password?</a>
    								</td>
    							</tr>
    							<tr>
    								<td>									
    									<input name="txtTimeZoneOffset" type="hidden" id="txtTimeZoneOffset" />
    								</td>
    							</tr>
    							<tr height="40">
    								<td/>
    								<td>
    									<div class="webMessage" title="Double click to hide this message" ondblclick="this.style.display='none'" id="__main_message_bar" name="msgError" style="display:none">
    	<img src="/Stars/images/info_small.gif" id="__main_message_icon" /><div class="webMessage_header" id="__main_message_header">
    		
    	</div><div id="__main_message_body" class="webMessage_message">
    		
    	</div>
    </div>
    								</td>
    							</tr>
    							<tr>
    								<td/>
    								<td>
    									<input type="submit" name="cmdLogin" value="Log In to STARS" id="cmdLogin" class="WebButtonControlStyle" style="font-weight:bold;" />
    								</td>
    							</tr>
    						</table>
    					</td>
    				</tr>
    				<tr>
    					<td>
    						
    <style>
    	#pageFooter
    	{
    		border-top: solid 1px #57699B;
    	}
    	
    	#pageFooter td
    	{
    		padding-top: 5px;
    		padding-bottom: 15px;
    	}
    	
    	#pageFooter #links
    	{
    		color: #57699B;
    		text-align: right;
    	}
    	
    	#pageFooter #links div
    	{
    		padding-bottom: 9px;
    	}
    	
    	#pageFooter #links a
    	{
    		color: #57699B;
    		text-decoration: none;
    	}
    	
    	#pageFooter #links a:hover
    	{
    		text-decoration: underline;
    	}
    </style>
    <table id="pageFooter" cellspacing="0" cellpadding="0" border="0" width="100%">
    	<tr>
    		<td width="100%" id="links"> 
    			<div>
    				<a href='http://www.CSStars.com' target='_BLANK'>
    					<span id="LoginPageFooter1_lblStarsInfo">CSStars.com</span>
    				</a> |
    				<a href='http://www.marsh.com' target='_BLANK'>
    					<span id="LoginPageFooter1_lblMarsh">Marsh.com</span>
    				</a> |
    				<a href='http://www.starsinfo.com/support/starsasphome.aspx' target='_BLANK'>
    					<span id="LoginPageFooter1_lblStarsAsp">STARS ASP</span>
    				</a> |
    				<!-- 
    				    <a href=''>
    					    <span id="LoginPageFooter1_lblAboutStars">About STARS</span>
    				    </a> |
    				-->
    				<a href='http://www.csstars.com/Default.aspx?pageID=10257' target='_BLANK'>
    					<span id="LoginPageFooter1_lblContactUs">Contact Us</span>
    				</a>
    			</div>
    			<div>
    				<img src='/Stars/images/mmc_endorsement.gif'/>
    			</div>
    		</td>
    	</tr>
    </table>
    
    					</td>
    				</tr>
    			</table>
    		
    <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['Login'];
    if (!theForm) {
        theForm = document.Login;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    //]]>
    </script>
    
    
    <script language='javascript'> var control = document.getElementById('txtClientID');  if( control != null ){control.focus();}</script><script type="text/javascript">var openerMessageDiv=document.getElementById('__main_message_bar');var openerMessageDivBody=document.getElementById('__main_message_body');var openerMessageDivHeader=document.getElementById('__main_message_header');var openerMessageIcon=document.getElementById('__main_message_icon');</script></form>
    	</body>
    </html>


    If it makes any difference for the $_GET argument (maybe I can pass this suggestion up the line), there's not one single login. I work at one hospital, and each separate hospital will have one login that their entire staff shares (which is why we're trying to auto-login) but there will be multiple logins to differentiate the hospitals.

  14. #14
    Banned.

    Join Date
    Jul 2005
    Posts
    5,821
    BG Level
    8
    FFXI Server
    Sylph
    WoW Realm
    Arthas

    You can send Post data through the curl library in PHP:

    For example, this will log into BG:

    PHP Code:
    $cookiefile tempnam("/tmp""cookies"); 
    $login_post_url='http://www.bluegartr.com/forum/login.php?do=login';
    $agent="Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
    $reffer='http://www.bluegartr.com/forum/forumdisplay.php?f=68';
    $loginpost="vb_login_username=##USERNAME##&cookieuser=1&vb_login_password=##PASSWORD##&s=&do=login&vb_login_md5password=&vb_login_md5password_utf=";

    $ch curl_init(); 
    curl_setopt($chCURLOPT_URL,$login_post_url);
    curl_setopt($chCURLOPT_USERAGENT$agent);
    curl_setopt($chCURLOPT_POST1); 
    curl_setopt($chCURLOPT_POSTFIELDS,$loginpost); 
    curl_setopt($chCURLOPT_RETURNTRANSFER1); 
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    curl_setopt($chCURLOPT_REFERER$reffer);
    curl_setopt($chCURLOPT_COOKIEFILE$cookiefile);
    curl_setopt($chCURLOPT_COOKIEJAR$cookiefile); 
    $result curl_exec ($ch);
    curl_close ($ch); 
    Dunno how much this will help you, but someone mentioned sending post data, this is how you do it.

  15. #15
    Sea Torques
    Join Date
    Aug 2007
    Posts
    514
    BG Level
    5

    Well, this won't work for an "out in the world" scenario, but we've finally got a working solution! A couple posts back where I posted my coworker's script, it turned out that the issue stopping that from working once we served the page was an IE security setting. If we change "Local Intranet" settings to Enable "Initialize and script ActiveX controls not marked as safe" (obviously not a great idea out in the world, but we feel safe doing it only for the Local Intranet zone) then it has no problem running the script. We can easily push that setting out to all our users through Group Policy.

    Obviously, if anyone works out a cleaner way to do this without lowering security settings I'm all ears, but I'm excited to have it in a working state now! :D

    Thanks BG for helping with this process.

Similar Threads

  1. Wireless Bridge -- Help Needed
    By Obiron in forum Tech
    Replies: 5
    Last Post: 2009-05-14, 22:33
  2. USB issue. Tech Gurus help!
    By thestalkmore in forum Tech
    Replies: 6
    Last Post: 2007-02-06, 02:00