...

View Full Version : php to javascript



rwb7041
05-14-2008, 11:01 PM
ok, here's what i want to do:

I want to get the source code of a specific page from a website. this page is behind a password protected login page. I want to login into the site and then download the source code of the page i need. How could I go about doing this? Also, would it be better to use javascript or php for this? Originally I was using curl, but I am experiencing problems with it.

Some notes on this: I believe the site uses cookies and javascript. Also, the site assigns you an ID# every time you access the page and then changes it when you login in. After you login in, the site keeps the ID# with your username while you are logged in but as soon as you log out it gives the ID to another person. I know the ID number is stored in cookies but don't know how to use it.

thanks,
---rwb7041

binaryWeapon
05-15-2008, 12:55 AM
So basically you need to hack into a site to get something you're not allowed to have?

pixencom
05-15-2008, 01:10 AM
You want to pagescrape?

Mirey86
05-15-2008, 08:19 AM
ok i see where u got chgoto.js from

i had the same problem. The way to make a drop down menu is alot simpler then that.


say in one of your php files just add this code in the appropriate position:

<form name="jump">
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">
<option value="INSERT LINK">INSERT NAME</option>
<option value="INSERT LINK">INSERT NAME</option>
<option value="INSERT LINK">INSERT NAME</option>
</select>
</form>

this will provide you with a drop-down menu. If you need to add more options, just add this line of code again:

<option value="INSERT LINK">INSERT NAME</option>



if you are having problems using it. make sure its outside of a <?php ?> command as its a html code - (WORKS FOR ME)

goodluck

rwb7041
05-18-2008, 07:15 PM
binaryWeapon, that's not what i'm trying to do. the site i am talking about is a email site. I am trying to access my messages from that site without me physically logging into the site and checking the messages. That way, if I don't have internet, I could set up the script to automatically do it and archive my messages for me. Also, I can go to the site and view the source code no problem, so it is not hacking.

pixencom: what do u mean by a pagescrape?

Mirey: what are u talking about? I am not quite sure what the code u posted is supposed to do. I understand the dropdown box, but what is the onChange for. plz explain.

thanks,
rwb

Inigoesdr
05-18-2008, 08:00 PM
Javascript can't do what you're looking to do. Mirey86's post is completely ridiculous. CURL is your best option. It can store cookies so you can login to a site, and then browse around.

rwb7041
05-20-2008, 12:29 AM
ok, but here's my problem with cURL, I am having trouble with redirects and with saving cookies. Since PHP 4.4.x or something like that, cURL can't do redirects because of some stupid settings in PHP. Also, the cookie saving seems to be tripping me up a little, could anyone explain it.

One last thing with cURL, can someone explain the process of posting to a website for me? I am having trouble on figuring out how to post with a set action and then post my login info.

Thanks,
rwb

Inigoesdr
05-20-2008, 01:05 AM
The manual does a much better job of explaining it than I could. See the examples, and comments. Specifically for curl_setopt() (http://php.net/curl_setopt).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum