moprpg/message.php

64 lines
1.3 KiB
PHP
Raw Normal View History

2017-10-22 18:15:11 -07:00
<?php
include("config.php");
$credsYo=$_COOKIE['mrpg-ethbnd'];
$credsYo=explode("@seperator@", $credsYo);
$u=strtolower($credsYo[0]);
$p=strtolower($credsYo[1]);
2017-10-22 20:39:20 -07:00
if($u=="") {
header("Location: index.php?login");
exit;
2017-10-22 18:15:11 -07:00
}
$result = mysql_query("SELECT * FROM mrpg_users WHERE name='$u'");
2017-10-22 20:39:20 -07:00
while($row = mysql_fetch_array($result)) {
if($row['password']!=$p) {
header("Location: index.php");
exit;
2017-10-22 18:15:11 -07:00
}
}
$sql="SELECT * FROM mrpg_users WHERE name='$u'";
$result = mysql_query($sql);
2017-10-22 20:39:20 -07:00
while($row = mysql_fetch_array($result)) {
$char['id']=$row['id'];
$char['mode']=$row['mode'];
2017-10-22 18:15:11 -07:00
}
if($char['mode']!="message") {
2017-10-22 20:39:20 -07:00
header("Location: actions.php");
exit;
2017-10-22 18:15:11 -07:00
}
$sql="SELECT * FROM mrpg_message WHERE id=" . $char['id'] . ";";
$result = mysql_query($sql);
2017-10-22 20:39:20 -07:00
while($row = mysql_fetch_array($result)) {
$confirm['q']=$row['q'];
$confirm['x']=$row['x'];
$confirm['y']=$row['y'];
2017-10-22 18:15:11 -07:00
}
if($_SERVER['QUERY_STRING']=="") {
2017-10-22 20:39:20 -07:00
echo "<center><br><h4><font color='white'>" . $confirm['q'] . "</font></h4><br><br>
2017-10-22 18:15:11 -07:00
<h5><a href='message.php?yes'>Continue</a></h5>";
} else if($_SERVER['QUERY_STRING']=="yes") {
2017-10-22 20:39:20 -07:00
$sql="UPDATE mrpg_users SET mode='norm', x=" . $confirm['x'] . ", y=" . $confirm['y'] . " WHERE id=" . $char['id'] . ";";
mysql_query($sql);
2017-10-22 18:15:11 -07:00
2017-10-22 20:39:20 -07:00
header("Location: actions.php");
exit;
2017-10-22 18:15:11 -07:00
2017-10-22 20:39:20 -07:00
}
2017-10-22 18:15:11 -07:00
2017-10-22 20:39:20 -07:00
?>