Picking up varibles from another site??? Is it possible?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Picking up varibles from another site??? Is it possible?

Post by Jade »

Hey,
I run a php powered SIM game website (http://www.whiteoaks.idlegames.net) and I was wondering if there is anyway to pick up varibles from another person's website? For instance, there is a game called HorseLand (HorseLand.com) that passes generated number through ASP to keep its players from creating scripts. I was wondering if there was a way, for instance, for me to pick up the number on their site from my own site.

Let me know if you have any ideas,
Jade
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

It's not possible... and even if it was you would need to know the name of the variable(s) you are trying to steal.
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

You So Sure?

Post by Jade »

What if i know the name of the varibles I want to get? Are you sure its not possible, I mean, when you declare something global its out there for you to use. What's to say you can't use globals off of other sites?

Jade
kcomer
Forum Contributor
Posts: 108
Joined: Tue Aug 27, 2002 8:50 am

Post by kcomer »

If the varibale is in a query string then it would be easy to use. What format or how are the varibales passed?
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Post METHOD

Post by Jade »

Hey there,

They are using the POST method in ASP, never used that language before, but I know there has to be some way to pick up their varibles. Here's some of the code for example:

<form action="/Scripts/ENTERHORSE.asp" method="POST" onSubmit=" return confirm('Are you sure you want to enter this horse?')">
- | 1.1k | -- Since When?
<INPUT TYPE="submit" STYLE='font-weight:normal;font-size:10px;' VALUE="Enter this horse" >
<input type="hidden" value='6375457' name='class_id'>
<input type="hidden" value='2663858' name='horse_id'>
<input type="hidden" value='4' name='key5'>
<input type="hidden" value='DE983D' name='11'>
</form>

For instance, I want to pick up the code I've highlighted in GREEN. I know there has to be a way for me to pick that varible up from my site. Any suggestions?
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

try the file function or the fopen function

Post by lostboy »

http://www.php.net/manual/en/function.file.php

http://www.php.net/manual/en/function.fopen.php

the problem may be that the data in the file is dymanically generated...what you are trying to do is to use have your server treat that file as a respose to a client (ie your server is making a http request to their server) and what you want is the completed page served to you...

not sure if either of these will do that...

hth
Beans
Forum Commoner
Posts: 49
Joined: Mon Dec 23, 2002 3:06 am
Location: Manila, Philippines
Contact:

Post by Beans »

As lostboy has mentioned, if the data is dynamically created, you're dead.

Also, let's say the variable you want is not actually displayed on the page. It is only used to come up with another variable that would eventually get the code to show something on the page. The problem here lies in the way the internet works. Variables are stored in the web server's memory. One cannot just talk to another server and get the contents of that variable in the server's memory. If this is stored in a file, then it might be more possible. But directly getting it is not possible.
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

though it IS possible with ASP using a third party free comp

Post by lostboy »

see this article about how to do this...don't know if anyone has written something for this in java or php, there must be a way to do this
Post Reply