Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Means your query is probably failing. Change this line to 1 line: $query = "SELECT header, body, header2, body2 FROM index"; And this line to: $mysql_stuff = mysql_query($query, $mysql_link) or die(mysql_error()); Tell me what the output is.
  2. Doh! That's what I was thinking because your syntax was correct.
  3. What exactly happens? Do you get any errors? Does it always INSERT even if you're not logged in? Here's your code fixed up: include("config.php"); if(isset($_POST['add_suggestion'])) { if(isset($_SESSION['myusername'])) { $Suggestion_username=$_SESSION['myusername']; $Suggestion_avatar=$_SESSION['myavatar']; $Suggestion_comment=$_POST['Suggestion_comment']; $sql="INSERT INTO Admin_suggestionsT (Suggestion_username, Suggestion_comment, Suggestion_avatar)VALUES('$Suggestion_username', '$Suggestion_comment', '$Suggestion_avatar')"; $result=mysql_query($sql); if($result) { echo "Thanks for your feedback, AdMiN!"; } else { echo "Ops, try again !"; } mysql_close(); } else { header("location:login.php"); } } ?> </pre> <form method="post" action="#"> "> Hear at weloveweed mansion we appreciate your feedback, so feel free to add your comments and dont fucking abuse it </form
  4. Sure np, do you mind sharing what it was? Please mark topic solved, thanks.
  5. Even though your SQL syntax is correct, change your query to: $result = mysql_query($query) or die(mysql_error()); It should display any errors. You can also echo out your $query to see what exactly you're passing through.
  6. Yep, you don't need any parentheses. So this is solved?
  7. 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
  8. $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?
  9. From updated code: (Line 46) There is no starting curly brace for your IF statement. if($numrows == 0) { //need this
  10. Do you mean all records for that field? You can do: UPDATE table SET field = field - 1
  11. If all the fields are checked, and you want to have a button appear, then you need to use JS, this is a client side action where PHP does not exist.
  12. You can do this with javascript, moving there...
  13. Look at chr. All these functions I find are in the manual, I suggest you take a look.
  14. Maq

    Array

    Or, use array_sum. I did not know that one. Thanks for the heads up Maq. The function itself probably does what you suggested, loops through and adds the element values. But there's no need to write it yourself.
  15. Maq

    Array

    Or, use array_sum.
  16. Look at ord.
  17. You resurrected a thread from over a year ago... congratulations.
  18. haha, that would be funny and sad at the same time. It would also indicate to say no to drugs, at least more often...
  19. I think nrg_alpha covered this in his post (not sure about the dash): http://www.phpfreaks.com/forums/index.php/topic,251852.msg1182619.html#msg1182619
  20. You output to the browser before you call the header redirect. You can call ob_flush or you can use a meta redirect.
  21. What happens? Are there any errors? Please use tags around code.
  22. I assume this is a MySQL question. jack is correct, it's 'AND'. I suggest you read up on basic MySQL syntax.
  23. Please re-read my very first post.
  24. So what did it output when you echoed the query statement?
  25. You coded something and don't have permissions to it?
×
×
  • 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.