PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > php, cURL and javascript
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
php, cURL and javascript

Réponse
 
LinkBack Outils de la discussion
Vieux 13/06/2008, 20h02   #1
h.stroph
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut php, cURL and javascript

Greetings,

I apologize for my lack of literacy with php, but am wondering if someone
will tell me how to use the curl php functions to navigate to the page that
results from entering the login and password at
https://retire.hartfordlife.com/Hart...ine/login.html and clicking the
"Log In" button please.

My intention is to cron the script so that I can automatically retrieve my
account balance every morning, but the javascript is the only roadblock for
me when using curl alone. http://us2.php.net/manual/en/ref.curl.php implies
that it's possible somehow, but I'm at a loss to figure out the coding on my
own.

Thank you for your .


  Réponse avec citation
Vieux 13/06/2008, 21h45   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php, cURL and javascript

h.stroph wrote:
> Greetings,
>
> I apologize for my lack of literacy with php, but am wondering if someone
> will tell me how to use the curl php functions to navigate to the page that
> results from entering the login and password at
> https://retire.hartfordlife.com/Hart...ine/login.html and clicking the
> "Log In" button please.
>
> My intention is to cron the script so that I can automatically retrieve my
> account balance every morning, but the javascript is the only roadblock for
> me when using curl alone. http://us2.php.net/manual/en/ref.curl.php implies
> that it's possible somehow, but I'm at a loss to figure out the coding on my
> own.
>
> Thank you for your .
>
>
>


You might be able to get by the javascript on this page just by posting
the values - not sure, because I haven't looked closely at what the
javascript does. It might work, however.

But the next question is - what about the following page(s)? Do they
require javascript, also?

Have you asked the webmaster how you can do it? They might not care for
what you want to do, among other things (lots of companies don't like
automatic submission like this). Or they may have another way for you
to get the information.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 14/06/2008, 03h19   #3
Hendri Kurniawan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php, cURL and javascript

h.stroph wrote:
> Greetings,
>
> I apologize for my lack of literacy with php, but am wondering if someone
> will tell me how to use the curl php functions to navigate to the page that
> results from entering the login and password at
> https://retire.hartfordlife.com/Hart...ine/login.html and clicking the
> "Log In" button please.
>
> My intention is to cron the script so that I can automatically retrieve my
> account balance every morning, but the javascript is the only roadblock for
> me when using curl alone. http://us2.php.net/manual/en/ref.curl.php implies
> that it's possible somehow, but I'm at a loss to figure out the coding on my
> own.
>
> Thank you for your .
>
>


The JavaScript itself do NOTHING but submit the form to itself.
So if I read the code correctly, you need the following variables
to be passed to https://retire.hartfordlife.com/Hart...ine/login.html

The variables needed are:
- 'target' => 'MultiRole'
- 'user' => YOUR USERNAME
- 'password' => YOUR PASSWORD

If everything wet fine, **should** cURL should return your "Home Page"
(ie. the page you see when you've successfully logged in)

But as Jerry pointed out, the webmaster might provide an API for you
to access the page programmatically.


Hendri Kurniawan
  Réponse avec citation
Vieux 16/06/2008, 18h44   #4
h.stroph
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php, cURL and javascript

In news:g2umd5$j8n$1@registered.motzarella.org,
Jerry Stuckle <jstucklex@attglobal.net> typed:

>> I apologize for my lack of literacy with php, but am wondering if
>> someone will tell me how to use the curl php functions to navigate
>> to the page that results from entering the login and password at
>> https://retire.hartfordlife.com/Hart...ine/login.html and
>> clicking the "Log In" button please.
>>
>> My intention is to cron the script so that I can automatically
>> retrieve my account balance every morning, but the javascript is the
>> only roadblock for me when using curl alone.
>> http://us2.php.net/manual/en/ref.curl.php implies that it's possible
>> somehow, but I'm at a loss to figure out the coding on my own.

>
> You might be able to get by the javascript on this page just by
> posting the values - not sure, because I haven't looked closely at
> what the javascript does. It might work, however.


A simple posting of the values was of course the very first thing I tried.
The URL was included so that if someone was inclined to they could see
the details.

> But the next question is - what about the following page(s)? Do they
> require javascript, also?


No they do not.

> Have you asked the webmaster how you can do it?


The web "master" does not respond to such queries, and my question was how
to use the php curl functions to login to the site, something better suited
to the people here who are well-versed in php.


  Réponse avec citation
Vieux 16/06/2008, 19h03   #5
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php, cURL and javascript

h.stroph wrote:
> In news:g2umd5$j8n$1@registered.motzarella.org,
> Jerry Stuckle <jstucklex@attglobal.net> typed:
>
>>> I apologize for my lack of literacy with php, but am wondering if
>>> someone will tell me how to use the curl php functions to navigate
>>> to the page that results from entering the login and password at
>>> https://retire.hartfordlife.com/Hart...ine/login.html and
>>> clicking the "Log In" button please.
>>>
>>> My intention is to cron the script so that I can automatically
>>> retrieve my account balance every morning, but the javascript is the
>>> only roadblock for me when using curl alone.
>>> http://us2.php.net/manual/en/ref.curl.php implies that it's possible
>>> somehow, but I'm at a loss to figure out the coding on my own.

>> You might be able to get by the javascript on this page just by
>> posting the values - not sure, because I haven't looked closely at
>> what the javascript does. It might work, however.

>
> A simple posting of the values was of course the very first thing I tried.
> The URL was included so that if someone was inclined to they could see
> the details.
>
>> But the next question is - what about the following page(s)? Do they
>> require javascript, also?

>
> No they do not.
>
>> Have you asked the webmaster how you can do it?

>
> The web "master" does not respond to such queries, and my question was how
> to use the php curl functions to login to the site, something better suited
> to the people here who are well-versed in php.
>
>
>


My point is - if the webmaster doesn't respond to such queries, then
they may not want you automating such actions. They would be entirely
within their rights to lock you out of online access to your account in
that case.

So what happened when you tried to post the correct values?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 16/06/2008, 21h19   #6
h.stroph
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php, cURL and javascript

In news:g36a1a$jtk$1@registered.motzarella.org,
Jerry Stuckle <jstucklex@attglobal.net> typed:

> So what happened when you tried to post the correct values?


curl -F user="username" -F password="passwd"
https://retire.hartfordlife.com/Hart...ine/login.html

just returns the same page. Of course the correct user and password were
used.


  Réponse avec citation
Vieux 16/06/2008, 21h47   #7
AnrDaemon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php, cURL and javascript

Greetings, h.stroph.
In reply to Your message dated Tuesday, June 17, 2008, 00:19:53,

>> So what happened when you tried to post the correct values?


> curl -F user="username" -F password="passwd"
> https://retire.hartfordlife.com/Hart...ine/login.html


> just returns the same page. Of course the correct user and password were
> used.


curl -i ....
Will you for debugging purposes.


--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

  Réponse avec citation
Vieux 16/06/2008, 22h40   #8
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php, cURL and javascript

h.stroph wrote:
> In news:g36a1a$jtk$1@registered.motzarella.org,
> Jerry Stuckle <jstucklex@attglobal.net> typed:
>
>> So what happened when you tried to post the correct values?

>
> curl -F user="username" -F password="passwd"
> https://retire.hartfordlife.com/Hart...ine/login.html
>
> just returns the same page. Of course the correct user and password were
> used.
>
>
>


Which shows you're not sending the proper information.

Get the "Live HTTP Headers" plugin for firefox and look at what needs to
be sent. Then try to duplicate it.

Note that the site also uses , so you'll have to handle those,
also. Chances are you'll have to retrieve the login page to get the
, then submit the form. There may be other fields which need to
be posted, also.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h34.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,18555 seconds with 16 queries