-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
^^^ Why are you using basename() after you have formed your upload path? ^^^
-
Your two queries (on the same table by the way) have nothing in them to relate the results from the first query to the second query and in fact you are re-executing the second query every time you fetch a row from the first query's result set. You need to execute ONE query that gets all the data you want and then simply loop though that data and display it.
-
login.php not validating registered user
PFMaBiSmAd replied to travelkind's topic in PHP Coding Help
$SCRIPT_NAME was depreciated some time in the year 2002 and is probably the reason for your browser error (do a 'view source' to see what the HTML of your form does look like.) To cause a form to submit to the same page you should just use an empty string in the action="" attribute. Also, remove the two session_register() statements. They were also depreciated in 2002 and your two $_SESSION[] = ... statements accomplish what you need your script to do. -
Each header line must be terminated by a \r\n (inside of double-quotes). Also, your From: header must be an actual email address and it must be hosted at the sending mail server. The Reply-to: header must be an email address (it's not clear from the code you posted.)
-
You are apparently passing the file() statement an empty filename. You would need to troubleshoot why your code is doing that.
-
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_str-to-date
-
If you make the folder(s) using a php script, php should have ownership and the necessary permissions to access the folder(s).
-
It trims a string consisting of a single space and returns a empty string. The character must be something else or your code has an error in it and it is not using the actual value being returned.
-
Yes, $key will be the form field name="..." (logo, image1, image2) and $value (or $file in your existing code) will have the ['error'], ['tmp_name'], ['name'], ['type'] elements.
-
Actually, here is a query that will work (the above one won't) - SELECT * from huge_email_list WHERE email IN (SELECT email FROM huge_email_list GROUP BY email HAVING ( COUNT(email) > 1 ))
-
You would need to use the HAVING query as a subquery - SELECT * from huge_email_list WHERE id IN (SELECT id FROM huge_email_list GROUP BY email HAVING ( COUNT(email) > 1 )) ORDER BY email
-
For the first one, if id is a unique index, your groups will only have one row in each of them and the count() will never be greater-than one.
-
Your code probably has a logic error in it that is assigning a value instead of comparing a value (i.e using one = instead two == in a comparison.) You might also have a header redirect without an exit; statement after it and the code on the rest of the page is setting or changing the value. You might also be using your own session save handler and it contains an error or makes an assumption about values. You could also have register_globals on and same name post/get/cookie/program variable is overwriting your session variable. Without specific information about the code that exhibits the problem, it is just a guessing game as to what is causing it.
-
Unknown collum 'u.id' .. id does exist in table users?
PFMaBiSmAd replied to TeddyKiller's topic in PHP Coding Help
Just remove all of the back-ticks ``. Back-ticks are only needed when an identifier needs special handling (you must like typing extra characters.) If you want to use them, it would be `u`.`id`because they go around identifiers (i.e. database, table, and column names.) -
Ummm... Is your database server hosted on the mysite.com IP address or does it actually have some other host name or IP address?
-
Revise a MySQL record with PHP form contents
PFMaBiSmAd replied to inosent's topic in PHP Coding Help
Your form has no method="..." attribute and the default method is GET, so none of your $_POST data exists. Add method="post" to your <form tag... -
What do the server logs show as the cause of the 'crash'? You cannot fix a problem until you identify the cause of the problem.
-
The only way someone can tell you what is wrong with your current code is if you post it.
-
That would indicate that you introduced a php syntax error into the code.
-
Your query failed due to some error and returned a FALSE value. If you echo mysql_error() on the next line after the mysql_query() statement, it will tell you why it failed.
-
HELP Create a dynamic variable by joining two together PHP 5
PFMaBiSmAd replied to Alex C's topic in PHP Coding Help
I have seen benchmarks that indicate that using an array is 3x faster than using variable variables. -
$today = date("Y-m-d"); $age = substr($today, 0, 4) - substr($dob, 0, 4) - (substr($today, 5,5) < substr($dob, 5,5)); echo "DOB: $dob, Age: $age<br />"; You can also do this directly in your query using the same logic.
-
A) You did not state what it does do when you try it (to narrow down which of the dozen or so possible things could prevent it from working.) B) If you were developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini, you would know that your code produces a fatal parse error on line 94 due to a missing ). Edit: C) If you formed your query in a variable and then just put that variable into the mysql_query() statement, the error in B) would be easier to find because your php code/syntax needed to execute the query would be separate from your sql syntax making up the query. Edit2: D) Because you are going to need to work on the sql syntax (missing single-quotes around string values.) Edit3: E) And the NULL keyword should not be enclosed in single-quotes. F) And you have at least three form fields being referenced that don't exist and your date variable name does not match between where it is set and where it is used. **** Most of the above problems were detected by trying the code on a system with error_reporting set to E_ALL and display_errors set to ON.
-
The easiest method is if you put your form processing code and your form on one page. The easiest method, if you are using two different pages, would be to use $_SESSION variables so that the values are available between pages.