Jump to content

How to Access sha1() Function?


phummon

Recommended Posts

Hi everyone,

 

  Full disclosure:  I'm an experienced programming who is relatively new to PHP.  Unfortunately, I'm also in a bit of a jam.  In short, my boss gave me some PHP code and said, "You have to get this working by Friday."  I don't have the luxury to do the proper tutorials, otherwise I wouldn't be rushing to this forum in a bit of a panic.

 

  Here's the problem.  The code I'm working with has this line:

   

$variable1 = sha1("12345678".$user.$passwd);

When I execute, the compiler gives me this result...

<br>
<b>Fatal error</b>:  Call to undefined function:  sha1() in <b>/export/qhome/dude1/script1.php</b> on line <b>38</b><br>

...which I'm interpreting to mean "I don't know what this sha1() command is!"  If this were C++ code (my home turf), I'd just "man sha1," figure out which library I need to add, and then pop in the needed "#include ______" statement at the top of my code.  That didn't work for in this case.

 

  Does anyone have any insight?

 

            Many, many thanks in advance!

                        -P

 

Link to comment
https://forums.phpfreaks.com/topic/208464-how-to-access-sha1-function/
Share on other sites

Ah.  I see from phpinfo() that the current version I'm running is PHP Version 4.0.3pl1, which sounds pretty ancient.  Phooey.  That sure explains why sha1() doesn't work, though.

 

Many thanks to all who helped - this was great for me!

                  -P

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.