Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#4

Re: [PHP] Instanz zurückgeben

  Alt 15. Mär 2007, 21:05
Hab alle includiert

Hier ist mal der komplette Quelltext...

Delphi-Quellcode:
<?
include('smarty/Smarty.class.php');

function InitializeSmarty()
{
    $smarty = new Smarty;
    $smarty->template_dir = 'templates';
    $smarty->compile_dir = 'templates/build';
    return  $smarty;
}


$DatabaseHost = XXXX;
$DatabaseUser = XXXX;
$DatabasePassword = XXXX;
$Database = XXXX;
$Tab = "`User`";

$DatabasePointer = mysql_connect($DatabaseHost, $DatabaseUser, $DatabasePassword);

mysql_select_db($Database, $DatabasePointer);

$mysmarty = InitializeSmarty();

$mysmarty->assign('name', 'Michael');
$mysmarty->assign('address', 'DelphiPraxis');

$query = "SELECT * FROM $Tab WHERE Username='" .$_POST['user'] . "AND Password='".$_POST['pw']."'";
if(mysql_num_rows(mysql_query($query, $DatabasePointer))==1)
{
  session_start();
  $smarty->display('index.tpl');
}

 else
 {
   echo "Falsches Kennwort!";
}

?>
Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat