Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

So close, but I think I need a little more help...

Everett Streeter
Registered User
Join date: 28 Apr 2007
Posts: 20
09-18-2007 18:32
Thanks for all the help so far, but writing to a sql database on my site is still not working. Here is the code I currently have (I have tried literally 100 variations):

FYI - i changed my web site and passwords to secondlife for privacy reasons

LSL:

default
{
state_entry()

{
llSetText( "Touch to open your free secondlife.com account", < 1,1,1>, 1 );
}

touch_start(integer total_number)

{

string name;
string password;

name = llDetectedName(0);
password = llDetectedKey(0);

llInstantMessage(llDetectedKey (0), "Your Login name is your Second Life Name, " + name + ". Your password is " + password + ". Please copy your password from History and visit www.secondlife.com where you can then change your password to something you remember.";);

llHTTPRequest( "http://www.secondlife.com/attempt2.php", [HTTP_METHOD,"PUT",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], "name&password";);
}

}





PHP:

<?php

$host="secondlife.secureserver.net";
$user="secondlife";
$pwd="secondlife";
$sys_dbname="secondlife";

$password = $_POST["password"];
$name = $_POST["name"];

$link = mysql_connect($host, $user, $pwd) or die('MySQL Error');
mysql_select_db($sys_dbname, $link) or die('MySQL Error');

$query = "INSERT INTO 'register' ('password', 'Second_Life_Name') VALUES ("$password", "$name";)";

mysql_query($query) or die(mysql_error());
mysql_close();

?>


And thanks again for the previous help I have received. Learning LSL, PHP and SQL at one time is a big project, but I am making good progress thanks to all of you. If anyone has further comments about the above code, that would be appreciated. Many thanks:)

Everett
Sollie Villota
Registered User
Join date: 22 Jun 2007
Posts: 46
09-18-2007 18:34
Change this:
CODE

llHTTPRequest( "webaddress", [HTTP_METHOD,"PUT",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], "name&password");



To this:
CODE

llHTTPRequest( "webaddress", [HTTP_METHOD,"PUT",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], "name=" + name + "&password=" + password);
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
09-19-2007 02:19
please don't start a new thread if there's already one about the same subject - started by you...
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
also...
09-19-2007 07:30
Your touch event assumes only one person will touch it. It needs to handle two people touching it at almost the exact same time.