hello help me to plz fix it nick enter eror
help to fix
Collapse
X
-
This is a GLOBALS problem, php version 5.4.0 or over GLOBALS have been completely removed due to security issues.
To fix this properly you need to add:
Code:$nick = $_GET['nick'];
how ever you will find that this problem will occur on every single form and link in the script which means you have to add a lot of $_GET and $_POST
If you wish to quickly fix this and not worry about the security issues then you can either change your php version to below 5.4.0 or alternatively you can add this function in your script: http://coding-talk.com/forum/main-fo...gister_globals (add it to pteam.php)Last edited by something else; 23.06.18, 10:53.
Comment
-
If you want to run php scripts then the only way you will learn is by editing them yourself.
here is an example of what you need to do:
PHP Code:<?php
///////////////////////////////////////
session_start();
$nick = $_GET['nick']; // This gets the variable called nick from the url and stores it in the variable called $nick
// eg: http://site.con/nick=SoBia2
Please note some forms will use method="POST" in which case you will need to change $nick = $_GET['nick']; to $nick = $_POST['nick'];
Comment
-
It would take way more time than I am willing to spend on it to fix the whole script.
So...
Create a new line on pteam.php after the line:
<?php
and add this code:
PHP Code://GLOBALS OFF WORK ROUND
if (!ini_get('register_globals')) {
$reg_globals = array($_POST, $_GET, $_FILES, $_ENV, $_SERVER, $_COOKIE);
if (isset($_SESSION)) {
array_unshift($reg_globals, $_SESSION);
}
foreach ($reg_globals as $reg_global) {
extract($reg_global, EXTR_SKIP);
}
}
Comment
-
Your options:
- Give up
- Get a better script
- Try fixing it yourself with $nick = $_GET['nick']; + the many other similar lines of code needed
- Pay someone else to fix the code for you (Its doubtful anyone will do it for free as it is a lot of lines of code in every php file)
- Change your php version in your control panel to below version 5.4.0 (if this is not possible in the settings you may have to ask the host but it is doubtful they will as you are using a free account)
- Ask the creator of the script to fix it (which is doubtful they will fix as the script is old and they more than likely not in use)
- Find someone who will fix it for you for free ?!? (good luck with this option, but you never know)
Comment
-
You can fix this yourself if you try
Here is some examples to show you how $_GET and $_POST work
example 1: (Using method GET in a form)
anyPage.php:
<form action="somePage.php" method="GET">
Name:<input type="text" name="nick"/>
Password: <input type="password" name="pass"/>
<input type="submit" value="Go"/>
</form>
somePage.php:
<?php
$nick = $_GET["nick"];
$pass = $_GET["pass"];
?>
example 2: (Using method POST in a form)
anyPage.php:
<form action="somePage.php" method="POST">
Name:<input type="text" name="nick"/>
Password: <input type="password" name="pass"/>
<input type="submit" value="Go"/>
</form>
somePage.php:
​​​​​​​<?php
$nick = $_POST["nick"];
$pass = $_POST["pass"];
?>
example 3: (Using a link... (link is always GET))
​​​​​​​anyPage.php:
<a href="somePage.php?nick=Sobia2&pass=12345">Click here</a>
somePage.php:
<?php
$nick = $_GET["nick"];
$pass = $_GET["pass"];
?>
The difference between GET and POST is that POST will not show in your address bar of your browser.
Comment
-
Here is in.php plz u add code and fix iam try bt n,t fixPHP Code:<?php
///////////////////////////////////////
session_start();
$_SESSION['csskey'] = "hello";
include "./pteam.php";
{
$t=sha1($_REQUEST["tcaptcha"]);
if($t==$_SESSION['captcha'])
{
$c1="0";
}
if($t != $_SESSION['captcha'])
{
$c1="1";
}
//header('Location: index.php');
}
if($issue!="0")
$online = mysql_fetch_array(mysql_query("SELECT COUNT(`id`) FROM chat_users WHERE ltime>'".intval(time()-$offline)."'"));
$TimeZone="0";
$New_Time = time() + ($TimeZone * 60 * 60);
$_time=date("H:i",$New_Time);
///////////////////////////////////////
header('Content-type:text/html; charset=utf-8');
echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">';
echo'<html>';
echo'<head>';
echo "<meta http-equiv="Pragma" content="no-cache" />";
echo "<meta http-equiv="no-cache" content="no-cache" />";
echo "<meta http-equiv="Cache-Control" content="no-cache" />";
echo"<title>FunzChat.ML | Enter $_time</title>";
echo'<link rel="stylesheet" href="style.css" type="text/css"/>';
echo"<link rel='shortcut icon' href='fevicon.ico' />";
echo'</head>';
echo'<body>';
echo"<div class='logo' align='center'><b>FunzChat.ML</b></div>";
if ($c1 == "1")
{
echo "<div class=errnotice>* Capcha Not Match.!</div>";
echo "<div class='body'><a href="index.php">Re Enter</a></div>";
}
if ($c1 == "0")
{
if (preg_match("/[^A-Za-z0-9\!]/", $nick))
{
echo "<div class='errnotice'><b>Invalid Characters!</b></div>";
echo"<div class='body'>Please use A-Z/0-9 Characters in Nick Special Symbol not Allowed.</div>";
}
else {
if(strlen($nick)<11)
{
echo "<div class='errnotice'>Use minimum 4 charactor in nick</div>";
}
else
{
if (isset($_COOKIE["inactive"]))
{
echo" <div class='errnotice'><b>YOUR IP NAME BLOCKED FOR 6 DAYS DUE TO ABUSING AND SPAMING!!</b></div>";
}
else
{
if($nick!=="") {
$update = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM `".$px.$utable."` WHERE nick ='".$nick."'"));
if($update[0]!=="0") {
echo "<div class='errnotice'>Plz Take a Diffrent Nick</div>";
echo "<div class='body'><a href="index.php">Re Enter</a></div>"; } else {
if($g=="m") { $gg=Male; } else { $gg=Female; }
if($sm=="1") { $smm=Yes; } else { $smm=No; }
@mysql_query("insert into `".$px.$utable."` values(0,'$nick','$sm','$g','$a','".time()."','$room','".getenv(HTTP_USER_AGENT)."','0','$c','".$_SERVER["REMOTE_ADDR"]."','$ci');");
echo "<div class='inmenubox'>Welcome To FunzChat.ML</div>";
echo"<div class='inbox'>";
echo "<div class='body2'><img src='enter.gif' alt='enter'><B>$nick</b></div>";
echo "<div class='body2'>Age: $a<img src='ok.gif' alt='ok'></div>";
echo "<div class='body2'>Gender: $gg<img src='ok.gif' alt='ok'></div>";
echo "<div class='body2'>Smilies: $smm<img src='ok.gif' alt='ok'></div>";
echo "<table><tr><td class='cp'><a href="./room.php?nick=$nick"><b>Enter</b></a></td></tr></table>";
echo"</div>";
} } else { echo "<div class='errnotice'>Plz Enter Any Nick 1st.</div><div class='body'><a href="index.php">Re Enter</a></div>"; }
}
}
}
}
echo"<div class='ptn'><a href='index.php'>» Home</a></div>";
echo"<div class='pw' align='center'><b>© FunzChat.ML ™</b></div>";
echo"</body>";
echo"</html>";
@mysql_close();
Comment
Comment