| | |
HELP: Undefined variable
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2008
Posts: 1
Reputation:
Solved Threads: 0
Help!
I keep getting the following error:
<b>Notice</b>: Underfined variable: theHash in <b>C:\wamp\www\HelloSeanThisIsForYourMyFriend.php</b>on line<b>46</b><br/>
f5bd6294083c680ec4a0e05bf1dbce38
From file:
Is there a simple fix to this please?
I keep getting the following error:
<b>Notice</b>: Underfined variable: theHash in <b>C:\wamp\www\HelloSeanThisIsForYourMyFriend.php</b>on line<b>46</b><br/>
f5bd6294083c680ec4a0e05bf1dbce38
From file:
PHP Syntax (Toggle Plain Text)
<?php /*-------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - -- - // $theMD5 = md5("ayht" . $_POST["rn"] . "thy", 1); $hexArr[0] = "0"; $hexArr[1] = "1"; $hexArr[2] = "2"; $hexArr[3] = "3"; $hexArr[4] = "4"; $hexArr[5] = "5"; $hexArr[6] = "6"; $hexArr[7] = "7"; $hexArr[8] = "8"; $hexArr[9] = "9"; $hexArr[10] = "A"; $hexArr[11] = "B"; $hexArr[12] = "C"; $hexArr[13] = "D"; $hexArr[14] = "E"; $hexArr[15] = "F"; for($i=0;$i<strlen($theMD5);$i++) { $tmp1 = ord($theMD5[$i]) / 16; $tmp2 = ord($theMD5[$i]) % 16; $theHash = $theHash. $hexArr[$tmp1] . $hexArr[$tmp2]; } $theHash = strtolower($theHash); echo $theHash; ?>
Is there a simple fix to this please?
Last edited by mattbaker; Dec 31st, 2008 at 9:46 am.
Set $theHash equal to empy before the for loop.
Also, I think you'll want to poulate $theHash like this:
Also, I think you'll want to poulate $theHash like this:
php Syntax (Toggle Plain Text)
$theHash=""; for($i=0;$i<strlen($theMD5);$i++) { $tmp1 = ord($theMD5[$i]) / 16; $tmp2 = ord($theMD5[$i]) % 16; $theHash.= $hexArr[$tmp1] . $hexArr[$tmp2]; }
Lost time is never found again.
- Benjamin Franklin
- Benjamin Franklin
![]() |
Similar Threads
- send email Undefined variable: (PHP)
- Undefined variable: oCustRes (PHP)
- undefined variable error (PHP)
- undefined variable although register_session done (PHP)
- Variable scope/declaration/assignment query (PHP)
- Undefined variable: PHP_SELF (PHP)
Other Threads in the PHP Forum
- Previous Thread: Get an html tags name or id attribute?
- Next Thread: image capture from flash is not working properly
| Thread Tools | Search this Thread |
# 5.2.10 action address apache api array auto autoincrement beginner binary broken cakephp checkbox class classes cms code cron curl database date dehasher destroy display dissertation domain dynamic echo echo$_get[x]changingitintovariable... email error errorlog fatalerror file files folder form forms function functions google href htaccess html if-else image images include insert ip javascript joomla legislation limit link load login mail masterthesis menu mlm multiple mysql mysqlquery oop open paypal pdf persist php popup problem query radio random record recursion remote script search server sessions sms sockets source space sql syntax system table tutorial update upload url validator variable video web youtube





