• λ我爱Aspx >> C#.Net >> PHP 留言簿(带Oracle数据库分页的显示功能)_PHP实例
  • PHP 留言簿(带Oracle数据库分页的显示功能)_PHP实例

  • :aspxer  Դ:internet  :2007-4-28 23:46:00  ؼ:数据库,数据
  • 下面的程式是将使用者的留言资讯加到 guestbook 留言资料表中。若要设定使用者认证功能,可在程式刚开始时检查,发留言者就可以确认身份,而读取留言就不必身份检查。这种设定可以防止不当发言,却又不会让留言功能只有少数人使用。

    <?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);

    Ҷƪл˵?
  • һƪVisualInterDev6.0七种实现分页显示的方法_ASP技巧
    һƪ用PHP实现ODBC数据分页显示一例_PHP技巧