|
-
May 7th, 2011, 12:49 PM
#1
md5:may insert plain strings, and mysql convert them
Please answer these Questions came from reading a PHP textbook(Stobart, cengage):
A]
I GET IN MY SCRIPT
Strict Standards: Declaration of square::resize() should be compatible with that of shape::resize() in C:\xampp\htdocs\Stobart2008\ch17\square.php on line 17
WELL WHY IF USE
error_reporting(E_ALL);
THIS MESSAGE IS REMOVED?
THIS is warning And MUST BYPASSED? How correctly, I can bypass warnings?
Code:
<?php
// File: example17-5.php
error_reporting(E_ALL);
function __autoload($class_name) {
require_once $class_name . '.php';
}
$objRectangle = new rectangle(100,50, "rectangle.gif");
$objSquare = new square(100, "square.gif");
$objTriangle = new triangle(50,100, "triangle.gif");
$objEllipse = new ellipse(50,100, "ellipse.gif");
$arrShapes = array ($objRectangle,$objSquare,$objTriangle,$objEllipse);
foreach ($arrShapes as $objShape){
$objShape->display();
$objShape->area();
}
?>
B]
WHEN: globals=on, in php.ini =>
<input type="hidden" name="intOkay" value="1"/> = $intOkay
And when is of is not equal and must have:
<input type="hidden" name="intOkay" value="1"/> = $_POST[“intOkay”]
(or GET or REQUEST)
this is correct?
C]
To store md5 strings[actually passwords] to MySQL I must convert them from PHP or may insert plain strings, and mysql convert them?
Md5 code conversion of passwords are the same independently of website [url], or ver of PHP or ver of mysql, ALL are the same?
-
May 7th, 2011, 03:47 PM
#2
Re: md5:may insert plain strings, and mysql convert them
1. Place a @ before the object throwing the error.
2. Having globals turned on requires more resources. It also can make reading where variables came from much more difficult. Always use POST or GET. You should stay away from using REQUEST because it doesn't know what to do with duplicate names for POST and GET variables.
3. MySQL has no MD5 library built into it. You must use PHP before inserting or updating.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
May 8th, 2011, 03:41 PM
#3
Re: md5:may insert plain strings, and mysql convert them
If apply md5 from any site i get same result?
-
May 8th, 2011, 03:44 PM
#4
Re: md5:may insert plain strings, and mysql convert them
warnings like
Strict Standards: Declaration of square::resize() should be compatible with that of shape::resize() in C:\xampp\htdocs\Stobart2008\ch17\square.php on line 17
must bypassed...? In PHP Polymorphism scripts like this warning must bypassed, hence is common and not fatal error?
-
May 8th, 2011, 04:15 PM
#5
Re: md5:may insert plain strings, and mysql convert them
1. MD5 has a specific standard method of hashing. It will be 100% the same anywhere you try it.
2. I already answered your question about warning suppression. (#1 in my first post)
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
May 10th, 2011, 09:16 AM
#6
Re: md5:may insert plain strings, and mysql convert them
md5 function exists in mysql
http://dev.mysql.com/doc/refman/5.0/...l#function_md5
Just for testing :
mysql> SELECT MD5('Super Moderator');
+----------------------------------+
| MD5('Super Moderator') |
+----------------------------------+
| c08b301cfbac693539756d1898cd98c5 |
+----------------------------------+
1 row in set (0.00 sec)
-
May 10th, 2011, 12:49 PM
#7
Re: md5:may insert plain strings, and mysql convert them
Correct. I was thinking back to MySQL 4.x days...which, unfortunately, many big web hosts still have as the default.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|