chris270 Posted May 15, 2009 Share Posted May 15, 2009 well ive tryid everything. and i cant get a sulution.. can some of your guys find it? thanks <?php /* Please leave all the credits. */ include "config/config.php"; function shitChecker($str) { $var = preg_match('/[^a-zA-Z]/', $str); return $var; } function shitCheckerNum($str) { $var = preg_match('/[^a-zA-Z0-9]/', $str); return $var; } if(isset($_POST['submit'])) { //User entered account name $account = $_POST['account']; $apassword = $_POST['password']; } //Connect to accounts db // we connect to example.com and port 3306 { $con = mysql_connect($aHost.":".$aPort,$aUsername,$aPass) or die(mysql_error()); // Enter your information here!! mysql_select_db($aDatabase) or die(mysql_error()); //remove bullshit characters $account = mysql_real_escape_string(html_entity_decode(htmlentities($account))); } //check for non-alphanumeric characters if(shitCheckerNum($account) == 1) { die("Error: Account contains invalid characters!"); } { //Get email and password from account $query = "SELECT (login, password, email, url, nextpay, lastpay, space, band, emails,) FROM accounts WHERE (login='$account' AND password='$apassword'); $result = mysql_query($query) or die(mysql_error()); $result2 = mysql_query($query2) or die (mysql_error()); $numrows = mysql_num_rows($result); $numrows2 = mysql_num_rows($result2); //If no rows, account doesnt exist, die. if($numrows == 0) $row = mysql_fetch_array($result); $row2 = mysql_fetch_array($result2); $account = mysql_real_escape_string(htmlentities($row[0])); $password = mysql_real_escape_string(htmlentities($row[1])); //Change this body message to whatever you wish. echo "Your Site Url: $query[url]"; echo "<br />"; echo "Next Payment: $query[nextpay]"; echo "<br />"; echo "Last Payment: $query[lastpay]"; echo "<br />"; echo "Total Space: $query[space]"; echo "<br />"; echo "Total Bandwith: $query[band]"; echo "<br />"; echo "Total Emails: $query[emails]"; echo "<br />"; mysql_close(); } else { echo "<form name='myform' method='post' action='bancheck.php'>"; echo "<center><h1>Account Checker</h1></center>"; echo "<center>"; echo "<br />"; echo "<tr><td width='125'>Account: </td><td><input type='text' name='account' value=''></td></tr>"; echo "<br />"; echo "<tr><td width='125'>Password: </td><td><input type='password' name='password' value=''></td></tr>"; echo "<br />"; echo "<tr><td colspan='2' align='center'><br><input type='submit' name='submit' value='Submit'></td></tr>"; echo "</form>"; echo "</center>"; } echo "<center>"; echo "</table>"; echo "<br />"; echo "<br />"; echo "<small>Created by Chris270"; echo "<br />"; echo "<br />"; echo " "; echo "<br />"; echo "</center>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/ Share on other sites More sharing options...
ohdang888 Posted May 15, 2009 Share Posted May 15, 2009 We need more info than that... Are you getting an errors? Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834814 Share on other sites More sharing options...
chris270 Posted May 15, 2009 Author Share Posted May 15, 2009 error: Parse error: syntax error, unexpected T_STRING in /www/hostse.com/z/a/h/zahlio/htdocs/user/bancheck.php on line 60 Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834815 Share on other sites More sharing options...
BobcatM Posted May 15, 2009 Share Posted May 15, 2009 $result2 = mysql_query($query2) or die (mysql_error()); I do not see a $query2 in your code? Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834817 Share on other sites More sharing options...
chris270 Posted May 15, 2009 Author Share Posted May 15, 2009 well cant still find it, code chanced to: <?php /* Please leave all the credits. */ include "config/config.php"; function shitChecker($str) { $var = preg_match('/[^a-zA-Z]/', $str); return $var; } function shitCheckerNum($str) { $var = preg_match('/[^a-zA-Z0-9]/', $str); return $var; } if(isset($_POST['submit'])) { //User entered account name $account = $_POST['account']; $apassword = $_POST['password']; } //Connect to accounts db // we connect to example.com and port 3306 { $con = mysql_connect($aHost.":".$aPort,$aUsername,$aPass) or die(mysql_error()); // Enter your information here!! mysql_select_db($aDatabase) or die(mysql_error()); //remove bullshit characters $account = mysql_real_escape_string(html_entity_decode(htmlentities($account))); } //check for non-alphanumeric characters if(shitCheckerNum($account) == 1) { die("Error: Account contains invalid characters!"); } { //Get email and password from account $query = "SELECT (login, password, email, url, nextpay, lastpay, space, band, emails,) FROM accounts WHERE (login='$account' AND password='$apassword'); $result = mysql_query($query) or die(mysql_error()); $numrows = mysql_num_rows($result); //If no rows, account doesnt exist, die. if($numrows == 0) $row = mysql_fetch_array($result); $account = mysql_real_escape_string(htmlentities($row[0])); $password = mysql_real_escape_string(htmlentities($row[1])); //Change this body message to whatever you wish. echo "Your Site Url: $query[url]"; echo "<br />"; echo "Next Payment: $query[nextpay]"; echo "<br />"; echo "Last Payment: $query[lastpay]"; echo "<br />"; echo "Total Space: $query[space]"; echo "<br />"; echo "Total Bandwith: $query[band]"; echo "<br />"; echo "Total Emails: $query[emails]"; echo "<br />"; mysql_close(); } else { echo "<form name='myform' method='post' action='bancheck.php'>"; echo "<center><h1>Account Checker</h1></center>"; echo "<center>"; echo "<br />"; echo "<tr><td width='125'>Account: </td><td><input type='text' name='account' value=''></td></tr>"; echo "<br />"; echo "<tr><td width='125'>Password: </td><td><input type='password' name='password' value=''></td></tr>"; echo "<br />"; echo "<tr><td colspan='2' align='center'><br><input type='submit' name='submit' value='Submit'></td></tr>"; echo "</form>"; echo "</center>"; } echo "<center>"; echo "</table>"; echo "<br />"; echo "<br />"; echo "<small>Created by Chris270"; echo "<br />"; echo "<br />"; echo " "; echo "<br />"; echo "</center>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834820 Share on other sites More sharing options...
Maq Posted May 15, 2009 Share Posted May 15, 2009 From updated code: (Line 46) There is no starting curly brace for your IF statement. if($numrows == 0) { //need this Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834821 Share on other sites More sharing options...
chris270 Posted May 15, 2009 Author Share Posted May 15, 2009 did not help new code: <?php /* Please leave all the credits. */ include "config/config.php"; function shitChecker($str) { $var = preg_match('/[^a-zA-Z]/', $str); return $var; } function shitCheckerNum($str) { $var = preg_match('/[^a-zA-Z0-9]/', $str); return $var; } if(isset($_POST['submit'])) { //User entered account name $account = $_POST['account']; $apassword = $_POST['password']; } //Connect to accounts db // we connect to example.com and port 3306 { $con = mysql_connect($aHost.":".$aPort,$aUsername,$aPass) or die(mysql_error()); // Enter your information here!! mysql_select_db($aDatabase) or die(mysql_error()); //remove bullshit characters $account = mysql_real_escape_string(html_entity_decode(htmlentities($account))); } //check for non-alphanumeric characters if(shitCheckerNum($account) == 1) { die("Error: Account contains invalid characters!"); } { //Get email and password from account $query = "SELECT (login, password, email, url, nextpay, lastpay, space, band, emails,) FROM accounts WHERE (login='$account' AND password='$apassword'); $result = mysql_query($query) or die(mysql_error()); $numrows = mysql_num_rows($result); //If no rows, account doesnt exist, die. if($numrows == 0) { $row = mysql_fetch_array($result); $account = mysql_real_escape_string(htmlentities($row[0])); $password = mysql_real_escape_string(htmlentities($row[1])); //Change this body message to whatever you wish. echo "Your Site Url: $query[url]"; echo "<br />"; echo "Next Payment: $query[nextpay]"; echo "<br />"; echo "Last Payment: $query[lastpay]"; echo "<br />"; echo "Total Space: $query[space]"; echo "<br />"; echo "Total Bandwith: $query[band]"; echo "<br />"; echo "Total Emails: $query[emails]"; echo "<br />"; mysql_close(); } else { echo "<form name='myform' method='post' action='bancheck.php'>"; echo "<center><h1>Account Checker</h1></center>"; echo "<center>"; echo "<br />"; echo "<tr><td width='125'>Account: </td><td><input type='text' name='account' value=''></td></tr>"; echo "<br />"; echo "<tr><td width='125'>Password: </td><td><input type='password' name='password' value=''></td></tr>"; echo "<br />"; echo "<tr><td colspan='2' align='center'><br><input type='submit' name='submit' value='Submit'></td></tr>"; echo "</form>"; echo "</center>"; } echo "<center>"; echo "</table>"; echo "<br />"; echo "<br />"; echo "<small>Created by Chris270"; echo "<br />"; echo "<br />"; echo " "; echo "<br />"; echo "</center>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834823 Share on other sites More sharing options...
Maq Posted May 15, 2009 Share Posted May 15, 2009 $query = "SELECT (login, password, email, url, nextpay, lastpay, space, band, emails,) FROM accounts WHERE (login='$account' AND password='$apassword'); You need the closing quote here as well. But that won't solve your problem. You really need to format your code and learn how to properly indent... Now what line is the error, after you fix the quote issue? Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834826 Share on other sites More sharing options...
Ken2k7 Posted May 15, 2009 Share Posted May 15, 2009 Maq... Edit - sorry. Maq beat me twice in this topic. Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834828 Share on other sites More sharing options...
chris270 Posted May 15, 2009 Author Share Posted May 15, 2009 well i havent worked that much with php so.. Parse error: parse error, unexpected T_STRING in bancheck.php on line 56 Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834832 Share on other sites More sharing options...
Maq Posted May 15, 2009 Share Posted May 15, 2009 Try: /* Please leave all the credits. */ include "config/config.php"; function shitChecker($str) { $var = preg_match('/[^a-zA-Z]/', $str); return $var; } function shitCheckerNum($str) { $var = preg_match('/[^a-zA-Z0-9]/', $str); return $var; } if(isset($_POST['submit'])) { //User entered account name $account = $_POST['account']; $apassword = $_POST['password']; } //Connect to accounts db // we connect to example.com and port 3306 $con = mysql_connect($aHost.":".$aPort,$aUsername,$aPass) or die(mysql_error()); // Enter your information here!! mysql_select_db($aDatabase) or die(mysql_error()); //remove bullshit characters $account = mysql_real_escape_string(html_entity_decode(htmlentities($account))); //check for non-alphanumeric characters if(shitCheckerNum($account) == 1) { die("Error: Account contains invalid characters!"); } //Get email and password from account $query = "SELECT (login, password, email, url, nextpay, lastpay, space, band, emails,) FROM accounts WHERE (login='$account' AND password='$apassword'"); $result = mysql_query($query) or die(mysql_error()); $numrows = mysql_num_rows($result); //If no rows, account doesnt exist, die. if($numrows == 0) { $row = mysql_fetch_array($result); $account = mysql_real_escape_string(htmlentities($row[0])); $password = mysql_real_escape_string(htmlentities($row[1])); //Change this body message to whatever you wish. echo "Your Site Url: $query[url]"; echo " "; echo "Next Payment: $query[nextpay]"; echo " "; echo "Last Payment: $query[lastpay]"; echo " "; echo "Total Space: $query[space]"; echo " "; echo "Total Bandwith: $query[band]"; echo " "; echo "Total Emails: $query[emails]"; echo " "; mysql_close(); } else { echo "</pre> <form name="'myform'" method="'post'" action="'bancheck.php'">"; echo "Account Checker"; echo ""; echo " "; echo "Account: "; echo " "; echo "Password: "; echo " "; echo " "; echo "</form>";<br> echo "";<br>}<br><br>echo "<center>"; echo ""; echo " "; echo " "; echo "Created by Chris270"; echo " "; echo " "; echo " "; echo " "; echo "</center>";<br><br Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834838 Share on other sites More sharing options...
chris270 Posted May 15, 2009 Author Share Posted May 15, 2009 Parse error: parse error, unexpected ')' in bancheck.php on line 43 Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834839 Share on other sites More sharing options...
chris270 Posted May 15, 2009 Author Share Posted May 15, 2009 THANKS! deleted the ) on one of the lines and its solved now!! thanks man!! Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834840 Share on other sites More sharing options...
BobcatM Posted May 15, 2009 Share Posted May 15, 2009 $query = "SELECT (login, password, email, url, nextpay, lastpay, space, band, emails,) FROM accounts WHERE (login='$account' AND password='$apassword'"); Is it the comma after emails? Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834842 Share on other sites More sharing options...
Ken2k7 Posted May 15, 2009 Share Posted May 15, 2009 No it was the ) at the end. Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834843 Share on other sites More sharing options...
Maq Posted May 15, 2009 Share Posted May 15, 2009 No it was the ) at the end. Yep, you don't need any parentheses. So this is solved? Quote Link to comment https://forums.phpfreaks.com/topic/158280-well-i-cant-find-whats-wrong/#findComment-834846 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.