How to develope and add new user functions to php
| From: | Allen Zhao | Date: | Tue, 09 Jan 2001 16:19:06 +0000 |
| Subject: | How to develope and add new user functions to php | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-43572@lists.php.net to get a copy of this message | ||
Hi all,
I am PHP develope newbie. I now meet a problem. What I want is, when someone
call my function, it will get the toppest caller's name/path and check its
MD5SUM and create time, if they are legal, I will return the the secret data
they want.
For example, someone visit the url: http://mydomain.com/test.php
in test.php,
include ("func.inc")
in func.inc,
call_user_function load_name <== this is the function I want
this function will check the md5sum and create time of the script test.php,
if they match the condition, it will return the "value" according to the
parameter "name"
I think this function should not be a script. Because if it is script, any
hacker can remove the authtication in this function and call the decrypt
function to get my secret data directly.
So in this case, if a hacker intrudes my website, he can change anything,
but he can't get something like database passwords. This is exactly what I
want.
Actually I never develped any php lib or extention before. Can anybody give
me a suggestion? I really don't know how to do that. I just know what I
want.
Here is my question:
Is there any easy way to do that? e.g. call an external program. But how to
pass the top caller's name to the external program?
How to develpe and add a lib or extension or user function to php. I want to
make things easy. The idea case is, I don't need to change my current php,
just add the new module to the current php.
How to get the top caller's name in a extension or lib or user function. (I
use language C)
Allen Zhao