Tuck Posted November 19, 2009 Share Posted November 19, 2009 this is my code i have no idea why it errors <?php if ((isset($_GET['U'])) && (isset($_GET['P'])) && (isset($_GET['ID'])) && (Logins($_GET['U'],$_GET['P']))) { echo = "1"; $referer = $_SERVER['HTTP_REFERER']; if (isset($referer)) { $con = mysql_connect('link', 'db', 'pw'); if (!$con) { die('Error: ' . mysql_error()); } mysql_select_db('db', $con); mysql_query("DELETE FROM `Bump` WHERE `ID`='" . $_GET['ID'] . "'"); mysql_close($con); header("Location: " . $referer); } else { die("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r<HTML><HEAD>\r<TITLE>403 Forbidden</TITLE>\r</HEAD><BODY>\r<H1>Forbidden</H1>\rYou don't have permission to access \rthis server.<P>\r</BODY></HTML>"); } } else { die("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r<HTML><HEAD>\r<TITLE>403 Forbidden</TITLE>\r</HEAD><BODY>\r<H1>Forbidden</H1>\rYou don't have permission to access \rthis server.<P>\r</BODY></HTML>"); } function Logins($Username,$Password) { if (strtoupper($Username) == strtoupper("js")) { if (strtoupper($Password) == strtoupper("uhg")) { return 1; } } if (strtoupper($Username) == strtoupper("blah")) { if (strtoupper($Password) == strtoupper("bahf")) { return 1; } } return 0; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/182181-unknown-php-error-oo/ Share on other sites More sharing options...
taquitosensei Posted November 19, 2009 Share Posted November 19, 2009 It would help if we had the error message. This is the equivalent of..."It don't work" Quote Link to comment https://forums.phpfreaks.com/topic/182181-unknown-php-error-oo/#findComment-961241 Share on other sites More sharing options...
rajivgonsalves Posted November 19, 2009 Share Posted November 19, 2009 you have used way too many braces (Causes lots of confusion) also you had a syntax error here is some code which should work <?php if (isset($_GET['U']) && isset($_GET['P']) && isset($_GET['ID']) && Logins($_GET['U'],$_GET['P'])) { $referer = $_SERVER['HTTP_REFERER']; if (isset($referer)) { $con = mysql_connect('link', 'db', 'pw'); if (!$con) { die('Error: ' . mysql_error()); } mysql_select_db('db[b][/b]', $con); mysql_query("DELETE FROM `Bump` WHERE `ID`='" . $_GET['ID'] . "'"); mysql_close($con); header("Location: " . $referer); } else { die("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r<HTML><HEAD>\r<TITLE>403 Forbidden</TITLE>\r</HEAD><BODY>\r<H1>Forbidden</H1>\rYou don't have permission to access \rthis server.<P>\r</BODY></HTML>"); } } else { die("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r<HTML><HEAD>\r<TITLE>403 Forbidden</TITLE>\r</HEAD><BODY>\r<H1>Forbidden</H1>\rYou don't have permission to access \rthis server.<P>\r</BODY></HTML>"); } function Logins($Username,$Password) { if (strtoupper($Username) == strtoupper("js")) { if (strtoupper($Password) == strtoupper("uhg")) { return 1; } } if (strtoupper($Username) == strtoupper("blah")) { if (strtoupper($Password) == strtoupper("bahf")) { return 1; } } return 0; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/182181-unknown-php-error-oo/#findComment-961243 Share on other sites More sharing options...
Tuck Posted November 19, 2009 Author Share Posted November 19, 2009 It would help if we had the error message. This is the equivalent of..."It don't work" white screen no html source happy? you have used way too many braces (Causes lots of confusion) also you had a syntax error here is some code which should work <?php if (isset($_GET['U']) && isset($_GET['P']) && isset($_GET['ID']) && Logins($_GET['U'],$_GET['P'])) { $referer = $_SERVER['HTTP_REFERER']; if (isset($referer)) { $con = mysql_connect('link', 'db', 'pw'); if (!$con) { die('Error: ' . mysql_error()); } mysql_select_db('db[b][/b]', $con); mysql_query("DELETE FROM `Bump` WHERE `ID`='" . $_GET['ID'] . "'"); mysql_close($con); header("Location: " . $referer); } else { die("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r<HTML><HEAD>\r<TITLE>403 Forbidden</TITLE>\r</HEAD><BODY>\r<H1>Forbidden</H1>\rYou don't have permission to access \rthis server.<P>\r</BODY></HTML>"); } } else { die("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r<HTML><HEAD>\r<TITLE>403 Forbidden</TITLE>\r</HEAD><BODY>\r<H1>Forbidden</H1>\rYou don't have permission to access \rthis server.<P>\r</BODY></HTML>"); } function Logins($Username,$Password) { if (strtoupper($Username) == strtoupper("js")) { if (strtoupper($Password) == strtoupper("uhg")) { return 1; } } if (strtoupper($Username) == strtoupper("blah")) { if (strtoupper($Password) == strtoupper("bahf")) { return 1; } } return 0; } ?> could you atlest tell me what syntax error and stuff >_> Quote Link to comment https://forums.phpfreaks.com/topic/182181-unknown-php-error-oo/#findComment-961245 Share on other sites More sharing options...
merylvingien Posted November 19, 2009 Share Posted November 19, 2009 white screen no html source happy? And you actually expect a reply? Quote Link to comment https://forums.phpfreaks.com/topic/182181-unknown-php-error-oo/#findComment-961248 Share on other sites More sharing options...
rajivgonsalves Posted November 19, 2009 Share Posted November 19, 2009 echo is a language construct you cannot assign 1 to it echo = "1"; Quote Link to comment https://forums.phpfreaks.com/topic/182181-unknown-php-error-oo/#findComment-961249 Share on other sites More sharing options...
Tuck Posted November 19, 2009 Author Share Posted November 19, 2009 white screen no html source happy? And you actually expect a reply? if i knew how to debug php i would but php sucks so much if 1 error it all errors.. and dosent tell anything about it >_> <?php if (isset($_GET['U']) && isset($_GET['P']) && isset($_GET['ID']) && Logins($_GET['U'],$_GET['P'])) { echo = "<html></html>"; $referer = $_SERVER['HTTP_REFERER']; if (isset($referer)) { $con = mysql_connect('', 'virus_clan_net', ''); if (!$con) { die('Error: ' . mysql_error()); } mysql_select_db('virus_clan_net', $con); mysql_query("DELETE FROM `Bump` WHERE `ID`='" . $_GET['ID'] . "'"); mysql_close($con); header("Location: " . $referer); } else { die("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r<HTML><HEAD>\r<TITLE>403 Forbidden</TITLE>\r</HEAD><BODY>\r<H1>Forbidden</H1>\rYou don't have permission to access \rthis server.<P>\r</BODY></HTML>"); } } else { die("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r<HTML><HEAD>\r<TITLE>403 Forbidden</TITLE>\r</HEAD><BODY>\r<H1>Forbidden</H1>\rYou don't have permission to access \rthis server.<P>\r</BODY></HTML>"); } function Logins($Username,$Password) { if (strtoupper($Username) == strtoupper("Tuck")) { if (strtoupper($Password) == strtoupper("")) { return 1; } } if (strtoupper($Username) == strtoupper("Jonny")) { if (strtoupper($Password) == strtoupper("")) { return 1; } } return 0; } ?> the code code dosent work still :/ Quote Link to comment https://forums.phpfreaks.com/topic/182181-unknown-php-error-oo/#findComment-961251 Share on other sites More sharing options...
rajivgonsalves Posted November 19, 2009 Share Posted November 19, 2009 your using echo wrong way echo = "<html></html>"; it should be echo "<html></html>"; Quote Link to comment https://forums.phpfreaks.com/topic/182181-unknown-php-error-oo/#findComment-961256 Share on other sites More sharing options...
j0n Posted November 19, 2009 Share Posted November 19, 2009 if i knew how to debug php i would but php sucks so much if 1 error it all errors.. and dosent tell anything about it >_> at the top of your script, try this: ini_set('display_errors', 1); Don't be so rude to people trying to help you, or you'll find your threads quickly go unanswered. Quote Link to comment https://forums.phpfreaks.com/topic/182181-unknown-php-error-oo/#findComment-961258 Share on other sites More sharing options...
Tuck Posted November 19, 2009 Author Share Posted November 19, 2009 if i knew how to debug php i would but php sucks so much if 1 error it all errors.. and dosent tell anything about it >_> at the top of your script, try this: ini_set('display_errors', 1); Don't be so rude to people trying to help you, or you'll find your threads quickly go unanswered. i'm mad at php not any person >_> but thanks will try @thanks with the echo answer btw Quote Link to comment https://forums.phpfreaks.com/topic/182181-unknown-php-error-oo/#findComment-961262 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.