Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 107,143 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,327 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Fetch numbers from within an account?

 
Reply to this topicStart new topic

Fetch numbers from within an account?, Get how many MB used (this is after login into the site, using php?)

Techno Guy
post 30 Jun, 2008 - 01:53 AM
Post #1


New D.I.C Head

*
Joined: 27 May, 2008
Posts: 3

I want to make or edit a existing php script that will do the following:
1, it will go to a site url (http://www.orcon.net.nz/my_orcon/) then insert username + password so it longs into my account.
2, then to click on a dynamic link:
This is the code for where the link is in, could a script be able to find the word "Broadband Authentication" and then go to the link before that?
CODE
<tr> <!-- UBS -->
<td class="panel_bodyleft"></td>
<td class="panel_body" width="1%"><a href="/cgi-bin/WebObjects/OSM.woa/1102/wo/GyeGRY1K5mCt2xy4vYgkj0/1.45.3.5.0.0.9.OcnSplash.0.16.18.23.1.3.0"><IMG src="/appearance-v2/default/general_usage.gif" border="0"></a></td>
<td class="panel_body">
    <a href="/cgi-bin/WebObjects/OSM.woa/1102/wo/GyeGRY1K5mCt2xy4vYgkj0/1.45.3.5.0.0.9.OcnSplash.0.16.18.23.1.5.0">Broadband Authentication</a>
    
    &nbsp;(<I>Surfer Broadband</I>)
    
    </td>
<td class="panel_body" width="1%"></td>
<td class="panel_body" width="1%"><a href="/cgi-bin/WebObjects/OSM.woa/1102/wo/GyeGRY1K5mCt2xy4vYgkj0/1.45.3.5.0.0.9.OcnSplash.0.16.18.23.1.15.0"><IMG src="/appearance-v2/default/general_more.gif" border="0"></a></td>
<td class="panel_bodyright"></td>
</tr>

3, Then find the words "Total data:" and take the "8.70" and store it in mysql or just remember it....
CODE
<tr>
    <td class="gen_subhead" colspan="3">2008-06-23  <IMG src="/appearance-v2/default/sm_arrow_right.gif" border="0"> 2008-07-22</td>
    <td class="gen_subhead" colspan="4" align=right>Total time: 188.20 hours</td>
    <td class="gen_subhead"></td>
    <td class="gen_subhead" colspan="5" align=right>Total data: 8.70 GB</td>
    
        <td class="gen_subhead" colspan="5"></td>
    
    <td class="gen_subhead" colspan="2"></td>
</tr>

4, Then logout from site (optional)
5, Then to display the number 8.70 on my home page?

Is this possible?
Can php do this or does it need a different programming language?

Many thanks for any help you can provide.
User is offlineProfile CardPM

Go to the top of the page


joeyadms
post 30 Jun, 2008 - 10:17 AM
Post #2


D.I.C Head

Group Icon
Joined: 4 May, 2008
Posts: 145



Thanked 6 times

Dream Kudos: 600
My Contributions


This is all possible, the best way to do it would be to use cURL .

Just get the action="" from the login page, and send your POST variables there to be logged in, then after logging in , request the page with the link on it, and use iteration or regex to find your link, follow the link and again iteration or regex to find your number.

Store that in a var and your set to go.

http://www.php.net/cURL
User is offlineProfile CardPM

Go to the top of the page

akozlik
post 1 Jul, 2008 - 11:23 AM
Post #3


D.I.C Regular

Group Icon
Joined: 25 Feb, 2008
Posts: 381



Thanked 14 times

Dream Kudos: 700
My Contributions


Here's an excellent cURL/libcURL tutorial

http://devzone.zend.com/article/1081-Using...ibcurl-with-PHP

It might be about time to write one up for DIC
User is offlineProfile CardPM

Go to the top of the page

Techno Guy
post 10 Jul, 2008 - 06:54 PM
Post #4


New D.I.C Head

*
Joined: 27 May, 2008
Posts: 3

Thanks for your replies!

Sorry for my late reply, I was busy with another of my projects, but I hope to get started on this one in the few days smile.gif
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/27/08 07:20PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month