AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
What debugging steps have you taken? Make sure error_reporting is set to E_ALL or -1 and display_errors is set to ON or 1 It may help to post the form
-
If you are not sure what ChristianF is talking about, try googling "MVC Framework".
-
1. str_ireplace requires a string for the first parameter, not a string format. 2. Generate the URL inside of the while loop, $E_ID contains the last value from the database.
-
Wasn't a core function, there are custom functions floating around that will do it.
-
There is no core PHP function that will do the entire process for you.
-
My guess would be the "@" symbol in the password is throwing it off. I don't know the specifics of what exactly causes this, but there has been bug report(s) on it. Try changing the password for that user to a simple string and see if that works.
-
$_SERVER['PHP_SELF'] should never be used as a forms action, as it can rather easily be spoofed. Instead if you want the form to submit to itself, use action=''
-
Then no rows were found..
-
All that should need to be passed is the id, and I do not see why that would need to be hidden or encrypted.
-
If you output: echo "<pre>"; print_r($cdata); echo "</pre>"; You will get a better idea of the array structure.
-
What exactly do you mean? PHP code can only be interpreted in a php file. Mod_rewrite would allow you to change the PHP file to look like an HTML file in the URL, which addresses your initial question.
-
How is the array being generated? Post the relevant code to this thread.
-
change the query to: SELECT id FROM TABLENAME WHERE username='USER' AND password='PASSWORD' LIMIT 1 Again, single quotes can only be used a qualifiers is you configure the mysql server to accept them.
-
Place the MySQL debugging code in the login.php page and display the error(s) received. The MD5 comment applies to the entire application.
-
try foreach($_POST['calltotor'] as $toractions) { if(array_key_exists($toractions, $callstoaction)) echo $callstoaction[$toractions] . "<br>"; }
-
Trying to populate a form textarea with a PHP variable
AyKay47 replied to lwolfe63's topic in PHP Coding Help
Also, arbitrary user input data should not be inserted directly into an SQL statement. Make sure to mysql_real_escape_string the data before using it in an SQL statement. However, in this particular case since the value is an expected integer, casting the value to an (int) or using intval is sufficient. -
Unless you have mysql enabled to allow single quotes as qualifiers, that syntax is incorrect. Proper MySQL debugging should be implemented: $r = mysql_query($q) or die("Error: " . mysql_error() . "<br>Query: " . $q); 1. $errorMsg is not output anywhere in the script, nor is script execution discontinued when an error occurs. 2. Using an MD5 hash on passwords is simply not enough, as it is simple enough to crack an MD5 hashed value using brute force methods. Instead, I recommend using the crypt function with a compatible salt.
-
Getting error when trying to insert data from form
AyKay47 replied to jim.davidson's topic in PHP Coding Help
Change the error handling a bit so you can see the actual statement: $Result1 = mysql_query($insertSQL, $racc) or die("Error: " . mysql_error() . "<br>Query: " . $insertSQL); and display the results of the above. Also, if you are expecting committee_id and member_id to contain integers, %d instead of %s should be passed to printf() -
The image is being stored as a BLOB, so you need to base64 encode it and insert it into an <img> tag: echo "<img src='data:image/jpeg;base64," . base64_encode($row['image']) . "' />";
-
Dividing 0 by anything is 0, dividing by zero is undefined/error?
-
No, that statement is correct.
-
Right, but since this topic is in the context of OOP, we are talking about OOP MVC which is a little more difficult to implement correctly.
-
The thing with OOP is, it requires more resources to run and is much more time consuming then procedural. While I always want to use OOP for every project I gain, there are some that just don't warrant the time to do so. It's a case by case sort of deal.
-
No offense, but if you have not yet grasped OOP, I sincerely doubt that you have grasped MVC to its full potential. There is no simple answer to this that will be 100% correct without going into vast detail.