Jump to content

... Whats wrong here


Xyphon

Recommended Posts

My error_report() isnt working so I dont know the error.. I looked through looked like nothing was wrong..

<?PHP
error_reporting(E_ALL);
ini_set('display_errors','On');
includejavascript:document.forms['EditForm'].screen.value=3;document.forms['EditForm'].submit();('Connect.php');
include('top.php');
$ID= $_COOKIE['UserID'];

$Chuunin_Result= mysql_query("SELECT * FROM Chuunin_Exams WHERE ID='$ID'");
$Chuunin_Rows= mysql_fetch_array($Chuunin_Result);
if(!isset($ID))
{
echo "Sorry, you must be logged in to view this page.";
include('bottom.php');
exit;
}
$ID= mysql_real_escape_string($ID);
$Chuunin1= $Chuunin_Rows['Chuunin_1'];
$Chuunin2= $Chuunin_Rows['Chuunin_2'];
$Chuunin3= $Chuunin_Rows['Chuunin_3'];
$Submit1= $_POST['Submit1'];
$Submit2= $_POST['Submit2'];
$Submit3= $_POST['Submit3'];
if($Chuunin1=="")
{
if(!isset($Submit1)
{
echo "Hello. these are the Chuunin Exams. You must battle 3 people to pass the exams. The recommended level is 20 for these exams.";
echo "<form method='POST'><input type='submit' name='Submit 1' value='First Battle!'></form>";
}
else
{
mysql_query("DELETE FROM Battle_Information WHERE ID='$ID'");
$Enemy_ID="0";
$Enemy_ID= mysql_real_escape_string($Enemy_ID);
$Enemy_Name="Chuunin Enemy 1";
$Enemy_Name= mysql_real_escape_string($Enemy_Name);
$Enemy_Element="Fire";
$Enemy_Element= mysql_real_escape_string($Enemy_Element);
$Enemy_Weapon="Kunai";
$Enemy_Weapon= mysql_real_escape_string($Enemy_Weapon);
$Enemy_Taijutsu="Punch";
$Enemy_Taijutsu= mysql_real_escape_string($Enemy_Taijutsu);
$Enemy_Ninjutsu="Fire Ball Jutsu";
$Enemy_Ninjutsu= mysql_real_escape_string($Enemy_Ninjutsu);
$Enemy_Genjutsu="Substitute";
$Enemy_Genjutsu= mysql_real_escape_string($Enemy_Genjutsu);
$Enemy_Clan="None";
$Enemy_Clan= mysql_real_escape_string($Enemy_Clan);
$Enemy_Chakra="27";
$Enemy_Chakra= mysql_real_escape_string($Enemy_Chakra);
$Enemy_HP="2219";
$Enemy_HP= mysql_real_escape_string($Enemy_HP);
$Enemy_Level="18";
$Enemy_Level= mysql_real_escape_string($Enemy_Level);
$Enemy_Ninjutsu_Power="0";
$Enemy_Ninjutsu_Power= mysql_real_escape_string($Enemy_Ninjutsu_Power);
$Enemy_Genjutsu_Power="0";
$Enemy_Genjutsu_Power= mysql_real_escape_string($Enemy_Genjutsu_Power);
$Enemy_Taijutsu_Power="0";
$Enemy_Taijutsu_Power= mysql_real_escape_string($Enemy_Taijutsu_Power);
$Enemy_Weapon_Power="2219";
$Enemy_Weapon_Power= mysql_real_escape_string($Enemy_Weapon_Power);
mysql_query("INSERT INTO Battle_Information (Enemy_ID, Enemy_Name, Enemy_Element, Enemy_Weapon, Enemy_Taijutsu, Enemy_Ninjutsu, Enemy_Genjutsu, Enemy_Clan, Enemy_HP, Enemy_Max_HP, Enemy_Chakra, Enemy_Max_Chakra, Enemy_Level, Enemy_Ninjutsu_Power, Enemy_Taijutsu_Power, Enemy_Genjutsu_Power, Enemy_Power, ID) VALUES('$Enemy_ID', '$Enemy_Name', '$Enemy_Element', '$Enemy_Weapon', '$Enemy_Taijutsu', '$Enemy_Ninjutsu', '$Enemy_Genjutsu', '$Enemy_Clan', '$Enemy_HP', '$Enemy_HP', '$Enemy_Chakra', '$Enemy_Chakra', '$Enemy_Level', '$Enemy_Ninjutsu_Power', '$Enemy_Taijutsu_Power', '$Enemy_Genjutsu_Power', '$Enemy_Weapon_Power', '$ID')") or die(mysql_error());
header ('Location: battle.php');
}
}
include('bottom.php');
?>

whats going on here?

 

Link to comment
Share on other sites

includejavascript:document.forms['EditForm'].screen.value=3;document.forms['EditForm'].submit();('Connect.php');

 

this line? i dont get it, what do you want to include? or do ou mean to echo the javascript?

 

EDIT:

 

I see:

 

change it to this:

include('Connect.php');

Link to comment
Share on other sites

<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
include('Connect.php');
include('top.php');
$ID= $_COOKIE['UserID'];

// CHECK ID
echo $ID;

// ADDED MYSQL_ERRORS
$Chuunin_Result= mysql_query("SELECT * FROM Chuunin_Exams WHERE ID='$ID'") or die(mysql_error());
$Chuunin_Rows= mysql_fetch_array($Chuunin_Result);
if(!isset($ID))
{
echo "Sorry, you must be logged in to view this page.";
include('bottom.php');
exit;
}
$ID= mysql_real_escape_string($ID);
$Chuunin1= $Chuunin_Rows['Chuunin_1'];
$Chuunin2= $Chuunin_Rows['Chuunin_2'];
$Chuunin3= $Chuunin_Rows['Chuunin_3'];
$Submit1= $_POST['Submit1'];
$Submit2= $_POST['Submit2'];
$Submit3= $_POST['Submit3'];
if($Chuunin1=="")
{
if(!isset($Submit1)
{
echo "Hello. these are the Chuunin Exams. You must battle 3 people to pass the exams. The recommended level is 20 for these exams.";
echo "<form method='POST'><input type='submit' name='Submit 1' value='First Battle!'></form>";
}
else
{
mysql_query("DELETE FROM Battle_Information WHERE ID='$ID'") or die(mysql_error());
$Enemy_ID="0";
$Enemy_ID= mysql_real_escape_string($Enemy_ID);
$Enemy_Name="Chuunin Enemy 1";
$Enemy_Name= mysql_real_escape_string($Enemy_Name);
$Enemy_Element="Fire";
$Enemy_Element= mysql_real_escape_string($Enemy_Element);
$Enemy_Weapon="Kunai";
$Enemy_Weapon= mysql_real_escape_string($Enemy_Weapon);
$Enemy_Taijutsu="Punch";
$Enemy_Taijutsu= mysql_real_escape_string($Enemy_Taijutsu);
$Enemy_Ninjutsu="Fire Ball Jutsu";
$Enemy_Ninjutsu= mysql_real_escape_string($Enemy_Ninjutsu);
$Enemy_Genjutsu="Substitute";
$Enemy_Genjutsu= mysql_real_escape_string($Enemy_Genjutsu);
$Enemy_Clan="None";
$Enemy_Clan= mysql_real_escape_string($Enemy_Clan);
$Enemy_Chakra="27";
$Enemy_Chakra= mysql_real_escape_string($Enemy_Chakra);
$Enemy_HP="2219";
$Enemy_HP= mysql_real_escape_string($Enemy_HP);
$Enemy_Level="18";
$Enemy_Level= mysql_real_escape_string($Enemy_Level);
$Enemy_Ninjutsu_Power="0";
$Enemy_Ninjutsu_Power= mysql_real_escape_string($Enemy_Ninjutsu_Power);
$Enemy_Genjutsu_Power="0";
$Enemy_Genjutsu_Power= mysql_real_escape_string($Enemy_Genjutsu_Power);
$Enemy_Taijutsu_Power="0";
$Enemy_Taijutsu_Power= mysql_real_escape_string($Enemy_Taijutsu_Power);
$Enemy_Weapon_Power="2219";
$Enemy_Weapon_Power= mysql_real_escape_string($Enemy_Weapon_Power);
mysql_query("INSERT INTO Battle_Information (Enemy_ID, Enemy_Name, Enemy_Element, Enemy_Weapon, Enemy_Taijutsu, Enemy_Ninjutsu, Enemy_Genjutsu, Enemy_Clan, Enemy_HP, Enemy_Max_HP, Enemy_Chakra, Enemy_Max_Chakra, Enemy_Level, Enemy_Ninjutsu_Power, Enemy_Taijutsu_Power, Enemy_Genjutsu_Power, Enemy_Power, ID) VALUES('$Enemy_ID', '$Enemy_Name', '$Enemy_Element', '$Enemy_Weapon', '$Enemy_Taijutsu', '$Enemy_Ninjutsu', '$Enemy_Genjutsu', '$Enemy_Clan', '$Enemy_HP', '$Enemy_HP', '$Enemy_Chakra', '$Enemy_Chakra', '$Enemy_Level', '$Enemy_Ninjutsu_Power', '$Enemy_Taijutsu_Power', '$Enemy_Genjutsu_Power', '$Enemy_Weapon_Power', '$ID')") or die(mysql_error());
header ('Location: battle.php');
}
}
include('bottom.php');
?>

 

Does that return anything?

Link to comment
Share on other sites

Could anything in the other two scripts cause it to die/exit?

include('Connect.php');

include('top.php');

 

Check it by changing:

error_reporting(E_ALL);
ini_set('display_errors','On');

to:

error_reporting(E_ALL);
ini_set('display_errors','On');
echo 'test';

 

Link to comment
Share on other sites

ok since you cannot use error_reporting (really bad sign of webhost, i can PM you a much better free webhost ive used before);

 

you are guna have to debug it yourself, use the exit() function.

 

first, put exit("DOES THIS OUTPUT"); at the very top of the page.

 

if it shows then move it down a line, if not then you know its what ever is including that file, or a misconfiguration.

 

keep moving it down a line until it does not show, then whatever is between the line it did show on, and the line it didn't is the problem.

 

hope this helps,

Link to comment
Share on other sites

I don't know if this would help you or not, but you should look into XAMPP. I've been using it for about 5 months now and I love it. Easy installer, installs apache, mysql, and php on your computer. Therefore you don't have to upload anything. Just save your files in the xampp/htdocs/ folder, and your good to go.

 

Does anyone else use XAMPP? What is everyone's thoughts on it?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.