This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#76 2011-11-26 09:36:52

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

flashgocrazy wrote:

Magnie wrote:

The reason it doesn't connect to the database is because there are to many people already connected to it. So it either has to do with the web host, or something to do with the coding to connect to the database.

Code:

<b>Warning</b>:  mysql connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: User [user info removed] already has more than 'max user connections' active connections in <b>/home/vol5/xtreemhost.com/[user info removed]/htdocs/set.php</b> on line <b>13</b><br />

the coding for the set.php is

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";
$user  = $_GET["user"];
$pass  = $_GET["pass"]; 
$value = $_GET["value"];

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";
                        if ($pass == 1)
                                {


$val = strlen($value);
if ($val > 0)
{
    echo "Acting on request";
    $act = "set";
}
else
{
    echo "Getting request";
    $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

            if(1==0)
                {

                    $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
                    mysql_query($sql,$con);
                    echo "<br />";
                    echo "Table made";
                    echo "<br />";
            
                }


    $you = "
SELECT * 
FROM Users";
$you4 = $you;

    
          $result = mysql_query($you4)
or die(mysql_error());
$n = 0;
$get = "";
$x = 0;
while($row = mysql_fetch_array($result))
  {
$x = $x + 1;
    $you = $row['Username'];
  if ($you == $user)
{
$n = $x;
if ($act == "get")
{
$get = $row['Value'];
}

}
 }



if ($n==0)
{
$you = "INSERT INTO ";
$you2 = $SQLtable;
$you3 = " (Username, Value)";
$you = $you . $you2 .$you3;
$you2 = ",";
$you3 = ")";
$you4 = "'";
$you5 = " VALUES (";
$query = $you . $you5 . $you4. $user . $you4 . $you2 . $you4. $value. $you4. $you3;
mysql_query($query);
}




                                echo "<br />";
                                echo "\n";




if ($act == "get")
{
echo $get;

}
if ($act == "set")
{


$you = "UPDATE ";
$you2 = $SQLtable;
$you3 = " SET Value = '";
$you = $you . $you2 .$you3 . $value;
$you2 = "' WHERE Username = '";
$you3 = $user;
$you4 = "'";
$query = $you . $you2 . $you3 . $you4; 
mysql_query($query);
echo "Updated";
}
                                }

mysql_close($con);
?>

also XXX is where you enter in the details for mysql

Thanks.  smile  That shows that it's the host that is maxing out on MySQL connections. If you use a different host, it should be fixed.

Offline

 

#77 2011-11-26 10:33:09

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

flashgocrazy wrote:

Dominic1 wrote:

flashgocrazy wrote:


source code? for panther project

Sorry, There's about a 0.5% chance of me releasing the source code. I need to keep the variables hidden so the chat is private.

sorry to burst your bubble, but I got the source code with all the blocks in it
I found the "modified" version of panther in the exe file
Its practically not modified at all. All you modified was adding the dev menu  tongue

No, I actually added one block. And I know that it's possible to get the full src, just PLEASE don't release how.


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#78 2011-11-26 11:08:43

Laternenpfahl
Scratcher
Registered: 2011-06-24
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

Dominic1 wrote:

Laternenpfahl wrote:

Dominic1 wrote:


Plus, it isn't even my database right now. It's jonnydean's database.

I have an app for that. Not gonna uses it tho.

app for what?

Seeing the hex code.

I could find the Passwords.


http://i46.tinypic.com/6yd4c0.png

Offline

 

#79 2011-11-26 13:10:23

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

Dominic1 wrote:

flashgocrazy wrote:

Dominic1 wrote:

Sorry, There's about a 0.5% chance of me releasing the source code. I need to keep the variables hidden so the chat is private.

sorry to burst your bubble, but I got the source code with all the blocks in it
I found the "modified" version of panther in the exe file
Its practically not modified at all. All you modified was adding the dev menu  tongue

No, I actually added one block. And I know that it's possible to get the full src, just PLEASE don't release how.

Found block, [connect to website: ________] o.O
2. Good idea I will release the source with the chat using.. MY DATABASE

Last edited by flashgocrazy (2011-11-26 13:10:51)


◕‿◕

Offline

 

#80 2011-11-26 13:36:43

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

johnnydean1 wrote:

set.php

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";
$user  = $_GET["user"];
$pass  = $_GET["pass"]; 
$value = $_GET["value"];

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";
                        if ($pass == 1)
                                {


$val = strlen($value);
if ($val > 0)
{
    echo "Acting on request";
    $act = "set";
}
else
{
    echo "Getting request";
    $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

            if(1==0)
                {

                    $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
                    mysql_query($sql,$con);
                    echo "<br />";
                    echo "Table made";
                    echo "<br />";
            
                }


    $you = "
SELECT * 
FROM Users";
$you4 = $you;

    
          $result = mysql_query($you4)
or die(mysql_error());
$n = 0;
$get = "";
$x = 0;
while($row = mysql_fetch_array($result))
  {
$x = $x + 1;
    $you = $row['Username'];
  if ($you == $user)
{
$n = $x;
if ($act == "get")
{
$get = $row['Value'];
}

}
 }



if ($n==0)
{
$you = "INSERT INTO ";
$you2 = $SQLtable;
$you3 = " (Username, Value)";
$you = $you . $you2 .$you3;
$you2 = ",";
$you3 = ")";
$you4 = "'";
$you5 = " VALUES (";
$query = $you . $you5 . $you4. $user . $you4 . $you2 . $you4. $value. $you4. $you3;
mysql_query($query);
}




                                echo "<br />";
                                echo "\n";




if ($act == "get")
{
echo $get;

}
if ($act == "set")
{


$you = "UPDATE ";
$you2 = $SQLtable;
$you3 = " SET Value = '";
$you = $you . $you2 .$you3 . $value;
$you2 = "' WHERE Username = '";
$you3 = $user;
$you4 = "'";
$query = $you . $you2 . $you3 . $you4; 
mysql_query($query);
echo "Updated";
}
                                }

mysql_close($con);
?>

How many fields do you need in the mysql table?

Last edited by flashgocrazy (2011-11-26 15:06:50)


◕‿◕

Offline

 

#81 2011-11-26 14:22:44

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

flashgocrazy wrote:

johnnydean1 wrote:

set.php

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";
$user  = $_GET["user"];
$pass  = $_GET["pass"]; 
$value = $_GET["value"];

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";
                        if ($pass == 1)
                                {


$val = strlen($value);
if ($val > 0)
{
    echo "Acting on request";
    $act = "set";
}
else
{
    echo "Getting request";
    $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

            if(1==0)
                {

                    $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
                    mysql_query($sql,$con);
                    echo "<br />";
                    echo "Table made";
                    echo "<br />";
            
                }


    $you = "
SELECT * 
FROM Users";
$you4 = $you;

    
          $result = mysql_query($you4)
or die(mysql_error());
$n = 0;
$get = "";
$x = 0;
while($row = mysql_fetch_array($result))
  {
$x = $x + 1;
    $you = $row['Username'];
  if ($you == $user)
{
$n = $x;
if ($act == "get")
{
$get = $row['Value'];
}

}
 }



if ($n==0)
{
$you = "INSERT INTO ";
$you2 = $SQLtable;
$you3 = " (Username, Value)";
$you = $you . $you2 .$you3;
$you2 = ",";
$you3 = ")";
$you4 = "'";
$you5 = " VALUES (";
$query = $you . $you5 . $you4. $user . $you4 . $you2 . $you4. $value. $you4. $you3;
mysql_query($query);
}




                                echo "<br />";
                                echo "\n";




if ($act == "get")
{
echo $get;

}
if ($act == "set")
{


$you = "UPDATE ";
$you2 = $SQLtable;
$you3 = " SET Value = '";
$you = $you . $you2 .$you3 . $value;
$you2 = "' WHERE Username = '";
$you3 = $user;
$you4 = "'";
$query = $you . $you2 . $you3 . $you4; 
mysql_query($query);
echo "Updated";
}
                                }

mysql_close($con);
?>

video tut for making it work in xtreemhost?

There aren't Video Tutorials for everything. All you do is change the settings to your database info then upload the file to xtreemhost then you run the file. If this is your site: http://scratchtest21.xtreemhost.com/set.php, then it is working fine.

Offline

 

#82 2011-11-26 14:50:25

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

Magnie wrote:

flashgocrazy wrote:

johnnydean1 wrote:

set.php

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";
$user  = $_GET["user"];
$pass  = $_GET["pass"]; 
$value = $_GET["value"];

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";
                        if ($pass == 1)
                                {


$val = strlen($value);
if ($val > 0)
{
    echo "Acting on request";
    $act = "set";
}
else
{
    echo "Getting request";
    $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

            if(1==0)
                {

                    $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
                    mysql_query($sql,$con);
                    echo "<br />";
                    echo "Table made";
                    echo "<br />";
            
                }


    $you = "
SELECT * 
FROM Users";
$you4 = $you;

    
          $result = mysql_query($you4)
or die(mysql_error());
$n = 0;
$get = "";
$x = 0;
while($row = mysql_fetch_array($result))
  {
$x = $x + 1;
    $you = $row['Username'];
  if ($you == $user)
{
$n = $x;
if ($act == "get")
{
$get = $row['Value'];
}

}
 }



if ($n==0)
{
$you = "INSERT INTO ";
$you2 = $SQLtable;
$you3 = " (Username, Value)";
$you = $you . $you2 .$you3;
$you2 = ",";
$you3 = ")";
$you4 = "'";
$you5 = " VALUES (";
$query = $you . $you5 . $you4. $user . $you4 . $you2 . $you4. $value. $you4. $you3;
mysql_query($query);
}




                                echo "<br />";
                                echo "\n";




if ($act == "get")
{
echo $get;

}
if ($act == "set")
{


$you = "UPDATE ";
$you2 = $SQLtable;
$you3 = " SET Value = '";
$you = $you . $you2 .$you3 . $value;
$you2 = "' WHERE Username = '";
$you3 = $user;
$you4 = "'";
$query = $you . $you2 . $you3 . $you4; 
mysql_query($query);
echo "Updated";
}
                                }

mysql_close($con);
?>

video tut for making it work in xtreemhost?

There aren't Video Tutorials for everything. All you do is change the settings to your database info then upload the file to xtreemhost then you run the file. If this is your site: http://scratchtest21.xtreemhost.com/set.php, then it is working fine.

its not getting the value of anything example here


◕‿◕

Offline

 

#83 2011-11-26 15:11:59

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

flashgocrazy wrote:

Dominic1 wrote:

flashgocrazy wrote:


sorry to burst your bubble, but I got the source code with all the blocks in it
I found the "modified" version of panther in the exe file
Its practically not modified at all. All you modified was adding the dev menu  tongue

No, I actually added one block. And I know that it's possible to get the full src, just PLEASE don't release how.

Found block, [connect to website: ________] o.O
2. Good idea I will release the source with the chat using.. MY DATABASE

MAKE SURE that you also change the variable names to something that:
A) Is not near the same as the ones I used
B) Don't contain iChat Global in the names because it would be a different version by you, COMPLETELY unsupported by me.


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#84 2011-11-26 15:18:01

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

Dominic1 wrote:

flashgocrazy wrote:

Dominic1 wrote:

No, I actually added one block. And I know that it's possible to get the full src, just PLEASE don't release how.

Found block, [connect to website: ________] o.O
2. Good idea I will release the source with the chat using.. MY DATABASE

MAKE SURE that you also change the variable names to something that:
A) Is not near the same as the ones I used
B) Don't contain iChat Global in the names because it would be a different version by you, COMPLETELY unsupported by me.

did you read posts #80 and #82?

Last edited by flashgocrazy (2011-11-26 15:18:27)


◕‿◕

Offline

 

#85 2011-11-26 15:36:39

Dominic1
Scratcher
Registered: 2009-07-30
Posts: 89

Re: ScratchChat--A global chat program in Panther!

flashgocrazy wrote:

Dominic1 wrote:

flashgocrazy wrote:


Found block, [connect to website: ________] o.O
2. Good idea I will release the source with the chat using.. MY DATABASE

MAKE SURE that you also change the variable names to something that:
A) Is not near the same as the ones I used
B) Don't contain iChat Global in the names because it would be a different version by you, COMPLETELY unsupported by me.

did you read posts #80 and #82?

yes, but I don't want people to create other programs that access this one's data. Can I trust you to do that?


http://i49.tinypic.com/oiwvh5.jpg

Offline

 

#86 2011-11-26 15:40:31

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

Dominic1 wrote:

flashgocrazy wrote:

Dominic1 wrote:


MAKE SURE that you also change the variable names to something that:
A) Is not near the same as the ones I used
B) Don't contain iChat Global in the names because it would be a different version by you, COMPLETELY unsupported by me.

did you read posts #80 and #82?

yes, but I don't want people to create other programs that access this one's data. Can I trust you to do that?

YES, I just need to know how to fixthis  when I set up scratch live what do I do? do you have a tut how to do that with pics explaining how?


◕‿◕

Offline

 

#87 2011-11-26 16:08:10

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

Code:

Database Connected
foo
1

Getting request

I still see nothing wrong. Do you have the right table?

It also seems that the code needs some changing anyway, I'll fix up a better set.php file.

Last edited by Magnie (2011-11-26 16:31:17)

Offline

 

#88 2011-11-26 16:25:37

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: ScratchChat--A global chat program in Panther!

flashgocrazy wrote:

Dominic1 wrote:

flashgocrazy wrote:


sorry to burst your bubble, but I got the source code with all the blocks in it
I found the "modified" version of panther in the exe file
Its practically not modified at all. All you modified was adding the dev menu  tongue

No, I actually added one block. And I know that it's possible to get the full src, just PLEASE don't release how.

Found block, [connect to website: ________] o.O
2. Good idea I will release the source with the chat using.. MY DATABASE

I told him how.
But I won't tell anyone else now that I know what he used it for XD


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#89 2011-11-26 16:51:15

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

Magnie wrote:

Code:

Database Connected
foo
1

Getting request

I still see nothing wrong. Do you have the right table?

It also seems that the code needs some changing anyway, I'll fix up a better set.php file.

Okay I've fixed up the set.php file, it should be much much cleaner:

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "127.0.0.1";
$SQLuser     = "root";
$SQLpass     = "";
$SQLdatabase = "test";
$SQLtable    = "scratchlive";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";

if ( isset($_GET['user']) ) { $user  = $_GET["user"]; } else { $user = ""; } // Since my WAMP server doesn't automatically ignore non-set data, I've added these if, else statements.
if ( isset($_GET['pass']) ) { $pass  = $_GET["pass"]; } else { $pass = ""; }
if ( isset($_GET['value']) ) { $value  = $_GET["value"]; } else { $value = ""; }

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";

if ($pass == 1) {
    $val = strlen($value);
    if ($val > 0) {
        echo "Acting on request";
        $act = "set";
    } else {
        echo "Getting request";
        $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

if(1==0)
    {
        $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
        mysql_query($sql,$con);
        echo "<br />";
        echo "Table made";
        echo "<br />";
            
    }

$result = mysql_query("SELECT * FROM ".$SQLtable." WHERE Username='$user'");
$row = mysql_fetch_array($result);
if ( $row['Username'] != "" ) { $get = $row['Value']; }
else { $get = ""; }

if ($get == "") {
    $query = "INSERT INTO ".$SQLtable." (Username, Value) VALUES ('$user', '$value')";
    mysql_query($query);
}
echo "<br />";
echo "\n";
if ($act == "get") {
    echo $get;
}

if ($act == "set") {
    $query = "UPDATE ".$SQLtable." SET Value = '".$value."' WHERE Username = '".$user."'";
    mysql_query($query);
    echo "Updated";
}

}

mysql_close($con);
?>

Remember to change the Database info.

Offline

 

#90 2011-11-27 19:58:42

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

johnnydean1 wrote:

set.php

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";
$user  = $_GET["user"];
$pass  = $_GET["pass"]; 
$value = $_GET["value"];

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";
                        if ($pass == 1)
                                {


$val = strlen($value);
if ($val > 0)
{
    echo "Acting on request";
    $act = "set";
}
else
{
    echo "Getting request";
    $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

            if(1==0)
                {

                    $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
                    mysql_query($sql,$con);
                    echo "<br />";
                    echo "Table made";
                    echo "<br />";
            
                }


    $you = "
SELECT * 
FROM Users";
$you4 = $you;

    
          $result = mysql_query($you4)
or die(mysql_error());
$n = 0;
$get = "";
$x = 0;
while($row = mysql_fetch_array($result))
  {
$x = $x + 1;
    $you = $row['Username'];
  if ($you == $user)
{
$n = $x;
if ($act == "get")
{
$get = $row['Value'];
}

}
 }



if ($n==0)
{
$you = "INSERT INTO ";
$you2 = $SQLtable;
$you3 = " (Username, Value)";
$you = $you . $you2 .$you3;
$you2 = ",";
$you3 = ")";
$you4 = "'";
$you5 = " VALUES (";
$query = $you . $you5 . $you4. $user . $you4 . $you2 . $you4. $value. $you4. $you3;
mysql_query($query);
}




                                echo "<br />";
                                echo "\n";




if ($act == "get")
{
echo $get;

}
if ($act == "set")
{


$you = "UPDATE ";
$you2 = $SQLtable;
$you3 = " SET Value = '";
$you = $you . $you2 .$you3 . $value;
$you2 = "' WHERE Username = '";
$you3 = $user;
$you4 = "'";
$query = $you . $you2 . $you3 . $you4; 
mysql_query($query);
echo "Updated";
}
                                }

mysql_close($con);
?>

do you have a .sql file of the database of scratch live? and a link to it?

Last edited by flashgocrazy (2011-11-27 19:59:15)


◕‿◕

Offline

 

#91 2011-11-27 20:54:24

cocolover76
Scratcher
Registered: 2011-10-09
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

Dominic1 wrote:

Also, for privacy reasons, the source code of ScratchChat will most likely NOT be released, as this would make it easy for people to hack into the systems.

Okay, if you don't want me and everyone else with Mac, Linux, Solaris, etc. to download it.


http://i.imgur.com/HfEPZ.gifhttp://i.imgur.com/pvKb6.png

Offline

 

#92 2011-11-28 11:31:46

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

flashgocrazy wrote:

johnnydean1 wrote:

set.php

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";
$user  = $_GET["user"];
$pass  = $_GET["pass"]; 
$value = $_GET["value"];

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";
                        if ($pass == 1)
                                {


$val = strlen($value);
if ($val > 0)
{
    echo "Acting on request";
    $act = "set";
}
else
{
    echo "Getting request";
    $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

            if(1==0)
                {

                    $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
                    mysql_query($sql,$con);
                    echo "<br />";
                    echo "Table made";
                    echo "<br />";
            
                }


    $you = "
SELECT * 
FROM Users";
$you4 = $you;

    
          $result = mysql_query($you4)
or die(mysql_error());
$n = 0;
$get = "";
$x = 0;
while($row = mysql_fetch_array($result))
  {
$x = $x + 1;
    $you = $row['Username'];
  if ($you == $user)
{
$n = $x;
if ($act == "get")
{
$get = $row['Value'];
}

}
 }



if ($n==0)
{
$you = "INSERT INTO ";
$you2 = $SQLtable;
$you3 = " (Username, Value)";
$you = $you . $you2 .$you3;
$you2 = ",";
$you3 = ")";
$you4 = "'";
$you5 = " VALUES (";
$query = $you . $you5 . $you4. $user . $you4 . $you2 . $you4. $value. $you4. $you3;
mysql_query($query);
}




                                echo "<br />";
                                echo "\n";




if ($act == "get")
{
echo $get;

}
if ($act == "set")
{


$you = "UPDATE ";
$you2 = $SQLtable;
$you3 = " SET Value = '";
$you = $you . $you2 .$you3 . $value;
$you2 = "' WHERE Username = '";
$you3 = $user;
$you4 = "'";
$query = $you . $you2 . $you3 . $you4; 
mysql_query($query);
echo "Updated";
}
                                }

mysql_close($con);
?>

do you have a .sql file of the database of scratch live? and a link to it?

If you look through the code, you will see some MySQL "CREATE TABLE" code:

Code:

CREATE TABLE Users
                    (
                    Username varchar(20),
                    Value varchar(20),
                    );

In phpMyAdmin click "SQL" or "Query" then run that code in the box and it should create the table you need.

Offline

 

#93 2011-11-28 16:41:26

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

Magnie wrote:

flashgocrazy wrote:

johnnydean1 wrote:

set.php

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";
$user  = $_GET["user"];
$pass  = $_GET["pass"]; 
$value = $_GET["value"];

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";
                        if ($pass == 1)
                                {


$val = strlen($value);
if ($val > 0)
{
    echo "Acting on request";
    $act = "set";
}
else
{
    echo "Getting request";
    $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

            if(1==0)
                {

                    $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
                    mysql_query($sql,$con);
                    echo "<br />";
                    echo "Table made";
                    echo "<br />";
            
                }


    $you = "
SELECT * 
FROM Users";
$you4 = $you;

    
          $result = mysql_query($you4)
or die(mysql_error());
$n = 0;
$get = "";
$x = 0;
while($row = mysql_fetch_array($result))
  {
$x = $x + 1;
    $you = $row['Username'];
  if ($you == $user)
{
$n = $x;
if ($act == "get")
{
$get = $row['Value'];
}

}
 }



if ($n==0)
{
$you = "INSERT INTO ";
$you2 = $SQLtable;
$you3 = " (Username, Value)";
$you = $you . $you2 .$you3;
$you2 = ",";
$you3 = ")";
$you4 = "'";
$you5 = " VALUES (";
$query = $you . $you5 . $you4. $user . $you4 . $you2 . $you4. $value. $you4. $you3;
mysql_query($query);
}




                                echo "<br />";
                                echo "\n";




if ($act == "get")
{
echo $get;

}
if ($act == "set")
{


$you = "UPDATE ";
$you2 = $SQLtable;
$you3 = " SET Value = '";
$you = $you . $you2 .$you3 . $value;
$you2 = "' WHERE Username = '";
$you3 = $user;
$you4 = "'";
$query = $you . $you2 . $you3 . $you4; 
mysql_query($query);
echo "Updated";
}
                                }

mysql_close($con);
?>

do you have a .sql file of the database of scratch live? and a link to it?

If you look through the code, you will see some MySQL "CREATE TABLE" code:

Code:

CREATE TABLE Users
                    (
                    Username varchar(20),
                    Value varchar(20),
                    );

In phpMyAdmin click "SQL" or "Query" then run that code in the box and it should create the table you need.

error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 5


◕‿◕

Offline

 

#94 2011-11-28 17:02:37

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

Magnie wrote:

flashgocrazy wrote:

johnnydean1 wrote:

set.php

Code:

<title>Scratch-Live <?php 
$title = 'Variables';
echo($title);?></title>

<?php 

$SQLhost     = "xxx";
$SQLuser     = "xxx";
$SQLpass     = "xxx";
$SQLdatabase = "xxx";
$SQLtable    = "xxx";

$con = mysql_connect($SQLhost,$SQLuser,$SQLpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Database Connected";
echo "<br />";
$user  = $_GET["user"];
$pass  = $_GET["pass"]; 
$value = $_GET["value"];

echo $user;
echo "<br />";
echo $pass;
echo "<br />";
echo $value;
echo "<br />";
                        if ($pass == 1)
                                {


$val = strlen($value);
if ($val > 0)
{
    echo "Acting on request";
    $act = "set";
}
else
{
    echo "Getting request";
    $act = "get";
    }
echo "<br />";


//**************************
//******DATABASE STUFF******
//**************************

mysql_select_db($SQLdatabase, $con);

            if(1==0)
                {

                    $sql = "CREATE TABLE" . $SQLtable. "
                    (
                    Username varchar(20),
                    Value varchar(20),
                    )";
                    mysql_query($sql,$con);
                    echo "<br />";
                    echo "Table made";
                    echo "<br />";
            
                }


    $you = "
SELECT * 
FROM Users";
$you4 = $you;

    
          $result = mysql_query($you4)
or die(mysql_error());
$n = 0;
$get = "";
$x = 0;
while($row = mysql_fetch_array($result))
  {
$x = $x + 1;
    $you = $row['Username'];
  if ($you == $user)
{
$n = $x;
if ($act == "get")
{
$get = $row['Value'];
}

}
 }



if ($n==0)
{
$you = "INSERT INTO ";
$you2 = $SQLtable;
$you3 = " (Username, Value)";
$you = $you . $you2 .$you3;
$you2 = ",";
$you3 = ")";
$you4 = "'";
$you5 = " VALUES (";
$query = $you . $you5 . $you4. $user . $you4 . $you2 . $you4. $value. $you4. $you3;
mysql_query($query);
}




                                echo "<br />";
                                echo "\n";




if ($act == "get")
{
echo $get;

}
if ($act == "set")
{


$you = "UPDATE ";
$you2 = $SQLtable;
$you3 = " SET Value = '";
$you = $you . $you2 .$you3 . $value;
$you2 = "' WHERE Username = '";
$you3 = $user;
$you4 = "'";
$query = $you . $you2 . $you3 . $you4; 
mysql_query($query);
echo "Updated";
}
                                }

mysql_close($con);
?>

do you have a .sql file of the database of scratch live? and a link to it?

If you look through the code, you will see some MySQL "CREATE TABLE" code:

Code:

CREATE TABLE Users
                    (
                    Username varchar(20),
                    Value varchar(20),
                    );

In phpMyAdmin click "SQL" or "Query" then run that code in the box and it should create the table you need.

did you read post #93?


◕‿◕

Offline

 

#95 2011-11-28 17:12:44

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

What table name did you use?

Try adding the accent character before and after the table name: `scratchlive` ( not 'scratchlive' or "scratchlice" )

Offline

 

#96 2011-11-28 17:22:29

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

Magnie wrote:

What table name did you use?

Try adding the accent character before and after the table name: `scratchlive` ( not 'scratchlive' or "scratchlice" )

1. For the code, Users. For one of the first lines in scratch live php? Users again
2. its not working #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Users'
                    (
                    Username varchar(20),
     ' at line 1
Do you have the code for the qwery?

edit: oh i frogot to add the ` but there is still an error after i add the `

Last edited by flashgocrazy (2011-11-28 21:29:18)


◕‿◕

Offline

 

#97 2011-11-28 20:13:43

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

cocolover76 wrote:

Dominic1 wrote:

Also, for privacy reasons, the source code of ScratchChat will most likely NOT be released, as this would make it easy for people to hack into the systems.

Okay, if you don't want me and everyone else with Mac, Linux, Solaris, etc. to download it.

I only use mac, so I know.  Unfortunately, if someone hacked in, they could majorly mess stuff up.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#98 2011-11-28 21:00:00

ohaiderstudios
Scratcher
Registered: 2010-10-31
Posts: 100+

Re: ScratchChat--A global chat program in Panther!

gbear605 wrote:

cocolover76 wrote:

Dominic1 wrote:

Also, for privacy reasons, the source code of ScratchChat will most likely NOT be released, as this would make it easy for people to hack into the systems.

Okay, if you don't want me and everyone else with Mac, Linux, Solaris, etc. to download it.

I only use mac, so I know.  Unfortunately, if someone hacked in, they could majorly mess stuff up.

It's actually pretty easy to hack in, so you might as well release the code.


Fork Clamor on GitHub!

Offline

 

#99 2011-11-29 14:23:07

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: ScratchChat--A global chat program in Panther!

flashgocrazy wrote:

Magnie wrote:

What table name did you use?

Try adding the accent character before and after the table name: `scratchlive` ( not 'scratchlive' or "scratchlice" )

1. For the code, Users. For one of the first lines in scratch live php? Users again
2. its not working #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Users'
                    (
                    Username varchar(20),
     ' at line 1
Do you have the code for the qwery?

edit: oh i frogot to add the ` but there is still an error after i add the `

Can you give me the code of the entire query you put in?

Offline

 

#100 2011-11-29 16:46:48

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ScratchChat--A global chat program in Panther!

Magnie wrote:

flashgocrazy wrote:

Magnie wrote:

What table name did you use?

Try adding the accent character before and after the table name: `scratchlive` ( not 'scratchlive' or "scratchlice" )

1. For the code, Users. For one of the first lines in scratch live php? Users again
2. its not working #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Users'
                    (
                    Username varchar(20),
     ' at line 1
Do you have the code for the qwery?

edit: oh i frogot to add the ` but there is still an error after i add the `

Can you give me the code of the entire query you put in?

Code:

CREATE TABLE `Users`
                    (
                    Username varchar(20),
                    Value varchar(20),
                    );

◕‿◕

Offline

 

Board footer