help to fix

Started on the old forum in June 2018 · view the original in the archive · old links redirect here

16 replies · 249 views · started 8 years ago · 1 min read

2 participants
SoBia2 Junior · 14 posts #1

hello help me to plz fix it nick enter eror

something else Fellow · 2,296 posts #3

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:

$nick = $_GET['nick'];

on in.php

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)

SoBia2 Junior · 14 posts #4

i d0nt kn0w where is adding this c0de u help me

SoBia2 Junior · 14 posts #5

iam attechd in in.php plz fix it

Attachments: in.php
something else Fellow · 2,296 posts #6

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
///////////////////////////////////////
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

you will also need to do this with all the other form inputs and links also, so doing this alone will not make your script work.

Please note some forms will use method="POST" in which case you will need to change $nick = $_GET['nick']; to $nick = $_POST['nick'];

SoBia2 Junior · 14 posts #7

ya i undarstand bt iam new in chat script wml xhtml so i c,nt undarstand where is isue so plz i requst to u fix script i give u script link

SoBia2 Junior · 14 posts #8

here is link </t/11452-funzchat-script>

something else Fellow · 2,296 posts #9

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 //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); } } ```
SoBia2 Junior · 14 posts #10

iam added code but n,t working pteam.php and in.php help me

something else Fellow · 2,296 posts #11

Your options:

  1. Give up
  2. Get a better script
  3. Try fixing it yourself with $nick = $_GET['nick']; + the many other similar lines of code needed
  4. 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)
  5. 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)
  6. 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)
  7. Find someone who will fix it for you for free ?!? (good luck with this option, but you never know)
SoBia2 Junior · 14 posts #12

you fix it script plz i req to u

something else Fellow · 2,296 posts #13

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: Click here

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.

SoBia2 Junior · 14 posts #14

Here is in.php plz u add code and fix iam try bt n,t fix

<?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();
SoBia2 Junior · 14 posts #15

Plz you fix it iam try many bt n,t fix it

SoBia2 Junior · 14 posts #17

something else you fix in.php plz i d0nt undarstand where is isue plz plz i requst to u many time plz sloved in.php plz

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close