IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
  Reply to this topicStart new topicStart Poll

 Access non-public content from Websites

 Using PHP.
 
goin-god  
Posted: Monday, Apr 9 2012, 11:51
Quote Post


High Roller
Group Icon
Group: $outh $ide Hoodz
Joined: Mar 18, 2007

ar.gif

Member Award




I know it may sound weird, but it's not. smile.gif

I've been having a quick look at PHP because I just wanted to make my own signature rotator. But once I finished that I started to think about the things I could do with php scripts that return images.
For example, check my signature. It gets Today top poster data and makes fun of him.

I'm basicly using this function file_get_contents. Where I need the URL to get data from.
But that was easy to do since the Forum Stats are public. But if I want to get data from my profile or any other Members only section of the Forum, I can't. Since the script won't be able to access that.

Is there any way I can do it?

BTW, I first used PHP today. Still geting the hand on the sintaxis and stuff.
Users WebsitePMMSNPlayStation Network
  Top
 

 
Edmachine  
Posted: Monday, Apr 9 2012, 12:08
Quote Post


Hey.
Group Icon
Group: Andolini Mafia Family
Joined: May 14, 2005

lt.gif

Member Award




To be honest, I have no idea, but I think you may want to check out cURL... See if this helps:
http://www.electrictoolbox.com/php-curl-cookies/
http://lv.php.net/manual/en/book.curl.php
Users WebsitePM
  Top
 

 
goin-god  
Posted: Monday, Apr 9 2012, 12:14
Quote Post


High Roller
Group Icon
Group: $outh $ide Hoodz
Joined: Mar 18, 2007

ar.gif

Member Award




Seems that I can use cURL to login in a website. I would probably have to create a new account for that... since it may risk mine.
Users WebsitePMMSNPlayStation Network
  Top
 

 
K^2  
Posted: Tuesday, Apr 10 2012, 02:24
Quote Post


Vidi Vici Veni
Group Icon
Group: Zaibatsu
Joined: Apr 14, 2004

us.gif

Member Award




Basically, you need to understand a few things about how authentication works. There are several methods. The one used by forums relies on session ID tracking. When you open a log-in page, the browser sends you a cookie containing session ID. Go to cookie browser, and you'll quickly find it. When you send info to the page, it matches session ID with information it already has. Once you log in, it marks that session ID as having logged in, and you no longer need to authenticate yourself in any other way than via the ID.

This has number of vulnerabilities, but overall, it's a pretty solid system. If you want to write a script that retrieves information from a page you need to be logged in to, all you really need to do is set a cookie with session ID and then run the request. Edmachine's links should help you with that. If you want to have the script log in automatically, you'll need to make sure that your script receives cookies along with the data, and keeps track of the session ID while you POST the user name and password.

By the way, a lot of forums allow session ID to be passed as GET parameter. I'm not sure about this one. You can experiment with it by disabling cookies and seeing if it works for you. However, a secure forum script will not allow you to pass session ID via GET method if you logged in with cookies. This has to do with vulnerabilities mentioned earlier.
PMMSN
  Top
 

 
flotwig  
Posted: Sunday, Apr 15 2012, 18:04
Quote Post


Lurk more.
Group Icon
Group: Members
Joined: Jun 12, 2011

us.gif

XXXXX



Some forums are set up to allow search engine user agents to access member pages, you might want to try using a Googlebot user agent string before you go writing an authentication script with CURL.
Users WebsitePMXbox Live
  Top
 

 
nightwalker83  
Posted: Tuesday, Apr 17 2012, 00:31
Quote Post


Don't mind me
Group Icon
Group: Members
Joined: Oct 10, 2004

au.gif

XXXXX



Wouldn't that be a huge security risk if you are accessing a protected area without entering the log-in details?
Users WebsitePMMSN
  Top
 

 
K^2  
Posted: Tuesday, Apr 17 2012, 01:07
Quote Post


Vidi Vici Veni
Group Icon
Group: Zaibatsu
Joined: Apr 14, 2004

us.gif

Member Award




QUOTE (nightwalker83 @ Monday, Apr 16 2012, 20:31)
Wouldn't that be a huge security risk if you are accessing a protected area without entering the log-in details?

It is, if there is any sensitive information there. Private sections of the forum, however, more often than not are kept private simply to keep undesirables out, so it's not always a big deal if these pages are getting read by someone.
PMMSN
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG