Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
My exact thoughts. I actually have heard of this until now, interesting.
-
Are these dates going to be entered manually or is it always *this* month? If always this month: echo abs(11-date('m'));
-
This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=333590.0
-
Haha, that's great, but why take the train when you have a perfectly good horse?
-
Fatal error: Call to a member function fetch_assoc() on a non-object
Maq replied to peter_anderson's topic in PHP Coding Help
Please start your own thread, this one is nearly 2 years old. -
Avoid using that operator as it will only cause problems, have a good design instead.
-
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
-
IMO, notices/warnings = side effects = bad.
-
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.
-
Parse error: syntax error, unexpected T_ELSEIF...
Maq replied to caryhartline's topic in PHP Coding Help
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 = ""; ?> -
Parse error: syntax error, unexpected T_ELSEIF...
Maq replied to caryhartline's topic in PHP Coding Help
In the future, please place tags around your code. -
Are you required to use IE or you just want to, and why? Heard that one a million times...
-
@loudog, in the future, please place tags around your code.
-
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.
-
You should be doing that in the command line not the mysql> prompt.
-
This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=333346.0
-
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=333348.0
-
This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=333331.0
-
Hi Tommy welcome to PHPF. We have a Website Critique section here: http://www.phpfreaks.com/forums/index.php?board=10.0
-
EDIT: This ^
-
Change this line to: mysql_select_db($dbname) or die(mysql_error());
-
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" ) );