Sending and Receiving information To and From a website to SL – Beginner
|
|
Dragon Muir
Registered User
Join date: 25 Jun 2005
Posts: 60
|
03-13-2008 20:43
Sending and Receiving information To and From a website to SL – Beginner
I slowly learned how to script in the SL language. I am not an advance scripter, but I am capable of scripting.
I need to take my scripting to the next level and it is a large jump for me. Honestly I am overwhelmed, so am hoping someone can provide some feedback is laymen’s terms or where online I can hopefully learn the very basics without my head exploding from the sea of endless knowledge that is needed.
I would like to be able to have an SL script send information to a website and simply store it. It would be long string of information.
1) The question is, how hard is this to learn for someone that knows nothing of php and where could I learn how to do this?
2) If there is a semi simple way to do that then the next step to that would be, is there a simple way to have a script access specific information that the script sent to the website?
Any information would be greatly appreciated.
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
03-13-2008 23:32
From: Dragon Muir 1) The question is, how hard is this to learn for someone that knows nothing of php and where could I learn how to do this?
lsl and php are very similar, php obiously has different and a TON more functions, but all the basics are there aside from remembering to declare your variables as $X and getting used to the language quirks its not a huge jump here is the php manual and its HUGE!! dont let it get you worried tho, use the search, and read, read, read! From: Dragon Muir 2) If there is a semi simple way to do that then the next step to that would be, is there a simple way to have a script access specific information that the script sent to the website?
Any information would be greatly appreciated.
/54/0c/205116/1.html#post1641083also using something along those lines would be just like reading a notecard to access data
|
|
Dragon Muir
Registered User
Join date: 25 Jun 2005
Posts: 60
|
03-14-2008 03:26
Thank you Osgeld Barmy for the information. : )
With the site and example I can hopefully understand what I need to know. Thanks for making it simple enough that I can hopefully figure it out so I can make one without looking at the manual and just end up scratching my head with my mouth hanging open.
One question comes to mind thought. Your example mentioned that it should only be used for learning purposes because once someone finds out where your URL is to the php they can add names to the list.
There is a way to make it more secure?
If so, can you describe the basic concept of how?
Example, perhaps place a single long hidden password into both the LSL script and the php script for authentication?
- Php script is not accept data unless the LSL transmits the correct password with the data
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
03-14-2008 13:56
Yes, the password would work. You wouldn't want to send the password itself in cleartext though. Instead use it to compute an authentication hash based on the message content. For example, take the body or a combination of the parameters, append the password, and compute an MD5 sum. You could also look into using HTTPS instead of straight HTTP. I recommend also adding a timestamp to the content before computing the hash. That way your server side script can make sure the message was sent recently (not reused some time in the future unless it is done with a pretty quick turnaround).
There are other things you can do, like a challenge/response protocol (client sends initial request to the server, server responds with some kind of random or sequential value, client uses the password to hash/encrypt the value and includes it with the message, server remembers the challenge and doesn't accept a second use of the same one--at least any time in the near future).
There is also a list of IP address ranges for LL's servers that you can find in the Knowledge Base and SL wiki. Actually there are two lists; one is official and one is not but has a few ranges that I have found it necessary to include myself. I highly recommend checking the originating IP address against these ranges and also checking for the presence of the HTTP headers added by the LSL library (neither is sufficient proof, but they can help to raise confidence that a request originated from an LSL script).
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
03-14-2008 19:27
From: Hewee Zetkin Yes, the password would work. You wouldn't want to send the password itself in cleartext though. Instead use it to compute an authentication hash based on the message content. For example, take the body or a combination of the parameters, append the password, and compute an MD5 sum. You could also look into using HTTPS instead of straight HTTP. I recommend also adding a timestamp to the content before computing the hash. That way your server side script can make sure the message was sent recently (not reused some time in the future unless it is done with a pretty quick turnaround). exactly http://cheesefactory.us/lslwm/llMD5String.htm
|
|
Dragon Muir
Registered User
Join date: 25 Jun 2005
Posts: 60
|
03-20-2008 21:34
Can anyone recommend a good free hosting site that I could attempt to use the examples given? I found one site, but not sure if anyone might know of a better place? http://www.noads.biz/Says it is free, but it will put banner ads on the website, but I do not plan to use it as a real website. ^.=.^
|
|
Ryann Slade
Registered User
Join date: 5 Jan 2008
Posts: 8
|
03-20-2008 21:53
|
|
Shane Oherlihy
Registered User
Join date: 11 Jan 2007
Posts: 17
|
03-21-2008 12:03
110mb's free version isn't very good if you're dealing with a game, because you'll probably want persistent external storage. I run server colocation IRL and have 4-5 of my own doing very little. Drop me an IM in SL. If I like your idea I'll help you out.
|
|
Dragon Muir
Registered User
Join date: 25 Jun 2005
Posts: 60
|
03-22-2008 00:07
Ok, I have a URL at http://www.110mb.com/I looked at: /54/0c/205116/1.html#post1641083/54/0c/205116/1.html#post1641083And took the php code, put it into a text file, and made sure it had the extension php. Called it test.php I also created a file named userlog.dta I dropped both files into the root, example: http://SOMEnameI Choosed.110mb.com/test.php I tried: http:// SOMEnameI Choosed 110mb.com/test.php?search=Osgeld%20Barmy Nothing happened. No name added to the userlog.dta file Yes, I do not know what I am doing. Anyone want to tell me what I did wrong? >_< I know if I at least have the most basic of functioning php file I can start to grasp this by experimenting and testing different functions and code. The, “How to start it working” is the part I am in the dark about. 110mb has php support.
|
|
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
|
03-22-2008 15:40
Are you sure the .dta file is writable? You need to CHMOD it 666 or readable and writable by all.
_____________________
There are no stupid questions, just stupid people.
|
|
Dragon Muir
Registered User
Join date: 25 Jun 2005
Posts: 60
|
03-22-2008 18:26
Yes. The file is writeable. I just made the file with notepad. It is blank/empty file with the “.dta” extension. Do I need to make it with a program or need something else in the file?
|
|
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
|
03-22-2008 19:34
I am talking about the files permissions on your webhost. If you just uploaded a file and did nothing else, more than likely the files permissions are 644 (this is usually the default for a file uploaded to a webserver or webhost). Readable/writable by owner, readable by group and readable by others (rw-r-r....644). It needs to be readable/writable by owner, readable/writable by goup and readable/writable by others (rw-rw-rw or 666). When you attempt to write to it with the PHP file, it is not actually YOU that is writing to it, it is Apache webserver or whatever webserver software your host uses (more then likely Apache). Apache falls into the category "others" or "group" (I don't remember which and really depends on how Apache was set up). If you CHMOD the .dta file 666 or rw-rw-rw you will allow Apache to write to it. By the way, if you change the userlog.dta file name in the PHP file to userlog.txt you can also use just a plain .txt file named userlog.txt. The test.php file will write to it fine (if the permissions are right) and lsl will read from it just fine. A .dta file will work just fine also. I don't mean to add to the confusion hahaha was just on a train of thought.
_____________________
There are no stupid questions, just stupid people.
|
|
Dragon Muir
Registered User
Join date: 25 Jun 2005
Posts: 60
|
03-22-2008 22:28
It worked!!! I am in awe. ^.=.^ This is the very first time I have ever done this. Thank you! - Osgeld Barmy - Hewee Zetkin - Ryann Slade - Shane Oherlihy - Laurence Corleone For your help. I can now start to learn how to script with php! Pretty cool. 
|