Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. My exact thoughts. I actually have heard of this until now, interesting.
  2. Are these dates going to be entered manually or is it always *this* month? If always this month: echo abs(11-date('m'));
  3. This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=333590.0
  4. Haha, that's great, but why take the train when you have a perfectly good horse?
  5. Please start your own thread, this one is nearly 2 years old.
  6. Maq

    goto

    Avoid using that operator as it will only cause problems, have a good design instead.
  7. What part in particular are you stuck on? Do you have any existing code? To start out I would have a look at: http://us3.php.net/manual/en/reserved.variables.get.php
  8. IMO, notices/warnings = side effects = bad.
  9. More of a statement than a question. As btherl mentioned, we need some more information to go off of. Example data, code, etc. would be very helpful.
  10. Longint should suffice
  11. Formatting your code help detects issues such as this. include "./includes/config.inc.php"; include $include_path . "countries.inc.php"; //// If user is not logged in redirect to login page if (!isset($_SESSION["BPLowbidAuction_LOGGED_IN"])) { header("Location: user_login.php"); exit; } if ($_POST['action'] == "update") { //// Check data if ($_POST['TPL_email']) { if (strlen($_POST['TPL_password']) 0) { $TPL_err = 1; $TPL_errmsg = $ERR_011; } elseif (strlen($_POST['TPL_email']) $TPL_err = 1; $TPL_errmsg = $ERR_110; } elseif (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$", $_POST['TPL_email'])) { $TPL_err = 1; $TPL_errmsg = $ERR_008; } $nletter = isset($_POST['TPL_nletter']) ? $_POST['TPL_nletter'] : 0; $sql = "UPDATE BPLA_users SET email=\"" . addslashes($_POST['TPL_email']) . "\", reg_date=reg_date" . " , nletter=\"" . addslashes($_POST['TPL_nletter']); if (strlen($_POST['TPL_password']) > 0) { $sql .= "\", password=\"" . md5($MD5_PREFIX . addslashes($_POST['TPL_password'])); } $sql .= "\" WHERE nick='" . $_SESSION['BPLowbidAuction_LOGGED_IN_USERNAME'] . "'"; $res = mysql_query($sql); //$query = "select * from BPLA_users where nick='".$_SESSION['BPLowbidAuction_LOGGED_IN_USERNAME']."'"; //$result = @mysql_query($query); //if(!$result) { // MySQLError($query); // exit; //} else { // $USER = mysql_fetch_array($result); // $TPL_nick = $USER['nick']; // $TPL_email = $USER['email'];; // $TPL_nletter = $USER['nletter']; // } //} // //// Redirect user to his/her admin page $TMP_MSG = $MSG_183; $_SESSION["TMP_MSG"] = $TMP_MSG; /*Header("Location: user_menu.php"); exit; include "header.php"; include "templates/template_updated.html"; */ //include "header.php"; //include phpa_include("template_change_details_php.html"); } else { $TPL_err = 1; $TPL_errmsg = $ERR_112; elseif (($_POST['action'] != "update" || $TPL_errmsg != 1)) { //#// Retrieve user's data //$query = "select * from BPLA_users where nick='".$_SESSION['BPLowbidAuction_LOGGED_IN_USERNAME']."'"; //$result = @mysql_query($query); //if(!$result) { // MySQLError($query); // exit; //} else { // $USER = mysql_fetch_array($result); // $TPL_nick = $USER['nick']; // $TPL_email = $USER['email']; // $TPL_nletter = $USER['nletter']; //} //echo "111 "; //include "header.php"; //include phpa_include("template_change_details_php.html"); } if ($TPL_err == 1) { //include "header.php"; //include phpa_include("template_change_details_php.html"); } //// Retrieve user's data $query = "select * from BPLA_users where nick='" . $_SESSION['BPLowbidAuction_LOGGED_IN_USERNAME'] . "'"; $result = @mysql_query($query); if (!$result) { MySQLError($query); exit; } else { $USER = mysql_fetch_array($result); $TPL_nick = $USER['nick']; $TPL_email = $USER['email']; $TPL_nletter = $USER['nletter']; } include "header.php"; include phpa_include("template_change_details_php.html"); include "footer.php"; $TPL_err = 0; $TPL_errmsg = ""; ?>
  12. In the future, please place tags around your code.
  13. Are you required to use IE or you just want to, and why? Heard that one a million times...
  14. @loudog, in the future, please place tags around your code.
  15. To clarify, the database values DO NOT contain dashes? But if the user enters a code with dashes you want them to match anyway? If the above is correct then strip out the slashes in PHP and then compare to the DB.
  16. You should be doing that in the command line not the mysql> prompt.
  17. This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=333346.0
  18. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=333348.0
  19. This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=333331.0
  20. Echo, less typing.
  21. Hi Tommy welcome to PHPF. We have a Website Critique section here: http://www.phpfreaks.com/forums/index.php?board=10.0
  22. EDIT: This ^
  23. Change this line to: mysql_select_db($dbname) or die(mysql_error());
  24. You have a semi-colon and you're using weird quotes again. Change them to ' $new_date = date;( ‘Y-m-d H:i:s’, strtotime("-$day day -$hour hour" ) );
×
×
  • 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.