Jump to content

How to access the database


Steven Zhang

Recommended Posts

Posted

I create a  my.php  and  put it on the server's  'public_html'  directory.

 

my.php  code:

<?php
require "init.php";
header("content-Type: text/html; charset=Utf-8");
if(!empty($_POST['sub'])){
    $name=$_POST['name'];
    $pass=$_POST['pass'];
    //$value =array('auth'=> $name,'password'=> $pass);
    $member = \IPS\Member::load( $name );
    $member1 = new \IPS\Member;
    var_dump($member);
    ?><br>
    <?php
    var_dump($member1);
    echo ".....................................";
}
?>
<form action="my.php" accept-charset="utf-8" method="post">
    name: <input type="text" name="name">
    pass: <input type="password" name = "pass">
    <input type="submit" name="sub" value="发表">
</form>

why  I'can  access the database ,

$member = \IPS\Member::load( $name );

this  $member  is always  null.

that means I can't access the ddatabase through   \IPS\Member::load($name);

someone tell me why ?  please .

 

   

 

Posted

I want to create a login handler use my php ,then I can though  this to  create accounts or use accounts  log into ISP. why I can't  access the database   use this code : ISP\Member::load();

Archived

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...