|
<?php file://--------------------------- // 新增留言程序 addmsg.php // Author: Wilson Peng // Copyright (C) 2000 file://--------------------------- // // 可自行在这儿加入身份检查功能 // if (($alias!="") and ($msg!="")) { putenv("ORACLE_SID=WWW"); putenv("NLS_LANG=american_taiwan.zht16big5"); putenv("ORACLE_HOME=/home/oracle/product/7.3.2"); putenv("LD_LIBRARY_PATH=/home/oracle/product/7.3.2/lib");
putenv("ORA_NLS=/home/oracle/product/7.3.2/ocommon/nls/admin/data");
putenv("ORA_NLS32=/home/oracle/product/7.3.2/ocommon/nls/admin/data");
$handle=ora_logon("user38@WWW","iam3849") or die; $cursor=ora_open($handle); ora_commitoff($handle);
$serial=md5(uniqid(rand())); $ref=""; $id=$PHP_AUTH_USER; $ip=$REMOTE_ADDR; $msg=base64_encode($msg); $flag="1"; $query="INSERT into guestbook(serial, ref, id, alias, ip, msgdate, email, msg, flag) values('$serial', '$ref', '$id', '$alias', '$ip', sysdate, '$email', '$msg', '$flag')";
ora_parse($cursor, $query) or die; ora_exec($cursor);
ora_close($cursor); ora_logoff($handle);
Header("Location: ./index.php"); exit;
} else { ?> <html> <head> <title>填写留言</title> </head> <body bgcolor=ffffff> <form method=POST action="<? echo $PHP_SELF; ?>"> <table border=0 cellpadding=2 width=395> <tr> <td nowrap><font color=004080>代号小名</font></td> <td width=20%><input type=text name=alias size=8></td> <td nowrap><font color=004080>电子邮件</font></td> <td width=50%><input type=text name=email size=18></td> </tr> <tr> <td nowrapvalign=top><font color=004080>内容</font></td> <td width=80% colspan=3><textarea rows=5 name=msg cols=33></textarea></td> </tr> <tr> <td width=100% colspan=4 align=center> <input type=submit value="送出留言"> <input type=reset value="擦掉留言"> </td> </tr> </table> </form> </body> </html> <?php } ?> |