File size: 1.36Kb
<?
include "config_inc.php";
$channel = $_GET['channel'];
$nickname = $_GET['nickname'];
?>
<?
$query = "INSERT INTO wapchat_messages (nick, message, time, channel) VALUES('Information','$nick goes to privat','$laikas', '$channel')";
$result = mysql_query($query) or die("Error1");
//-------------------------------------------------
//set the random id length
$random_id_length = 6;
//generate a random id encrypt it and store it in $rnd_id
$rnd_id = crypt(uniqid(rand(),1));
//to remove any slashes that might have come
$rnd_id = strip_tags(stripslashes($rnd_id));
//Removing any . or / and reversing the string
$rnd_id = str_replace(".","",$rnd_id);
$rnd_id = strrev(str_replace("/","",$rnd_id));
//finally I take the first 10 characters from the $rnd_id
$rnd_id = substr($rnd_id,0,$random_id_length);
$channel = $rnd_id;
//-----------------------------------------------
$laikas = $laikas + 300;
$query = "INSERT INTO wapchat_privatusers (timeout, invite, forwho, channel, ats) VALUES('$laikas','$nick','$nickname', '$channel', '1')";
$result = mysql_query($query) or die("Error1");
echo "<meta http-equiv=\"refresh\" content=\"30; chat.php?nick=$nick&pass=$pass&channel=$channel\">";
echo "
<p align=\"center\">Creating private chat<br/>Please wait";
?>
<?
mysql_close($db);
include "bottom_inc.php";
?>