Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Http Connect/PostFormData
#1
Hello,
I've been trying to grab a page from a site (http://yyy.com/view/id/1403030). I need to log in first at http://yyy.com/login
I use this:

Code:
Copy      Help
ARRAY(POSTFIELD) a.create(3)
a[0].name="signin-username"; a[0].value="my username"
a[1].name="signin-password"; a[1].value="my password"
a[2].name="btnLogin"; a[2].value="Login!";; (for login button, not sure if that's needed)

Http h.Connect("yyy.com"); h.PostFormData("login" a)
str SourceLink; h.FileGet("view/id/1403030" SourceLink)

Am I doing something wrong? Are the missing "/", "http" and "www" correct? It doesn't log on, SourceLink shows up as the login page (with an error, can't login). Also the site has a https version so I tried above Http h.Connect("yyy.com" "" "" 443), but now SourceLink becomes a blank page.

I copy paste below the relevant part of the login page's html, perhaps I'm not using the right parts for names/values? (I also used "username" and "password" without the "signin-" parts but still nothing). Thank you, I appreciate any help!



Code:
Copy      Help
USERNAME
<div class="form-row"><div class="form-label">
<label for="signin-username">Username</label>
</div><div class="form-field">
<input type="text" size="25" id="signin-username" name="username" value="my username" maxlength="100" />
</div></div>

PASSWORD
<div class="form-row"><div class="form-label">
<label for="signin-password">Password</label>
</div><div class="form-field">
<input type="password" size="25" id="signin-password" name="password" maxlength="50" />
</div></div>

BUTTON
<div class="form-submit"><div class="form-field">
<a class="button" href="#" id="btnLogin"><span>Login!</span></a>
</div></div>


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)