Wednesday 15 August 2012

php - include and function not working -


Hello, I still can not understand why these codes are not working and I did not create any errors It is, though I have tested and it has worked.

These codes are: securedlogin.php

  & lt ;? Php include_once '/../toggleFirePHP.php'; // Fix // Start here ......................................... ...... ........................ function connected ($ database) {$ firephp- & gt; Group ("in securedlogin.php, debugging begins"); $ Firephp- & gt; Information ("Information: Building Parameter Building and Database Before Login"); / *** mysql hostname *** / $ hostname = 'localhost'; / *** mysql user name *** / $ username = 'root'; / *** mysql password *** / $ password = ''; / *** mysql database *** / $ firephp- & gt; Logs ("Log: Hostname =". Hostname ".", Username = ". $ Username.", Password = ". $ Password.", Database = ". $ Database); Try {$ Dbh = New PDO ("mysql: host = $ hostname; dbname = $ database", $ username, $ password); Copy 'Connect' $ Database. 'Database' "
" $ Firephp- & gt; Warning ("Warn: Login and Connect to Database database is successful!"); } Hold (PDOException $ E) {$ shorterr = $ e- & gt; GetMessage (); $ Alertsmax = $ shorter; Included 'alertmessage.php'; $ Shorterr echo "& Lt; br / & gt;"; $ Firephp- & gt; Error ("Error: Login and associated with database is not successful! See below:"); $ Firephp- & gt; Error ("Error: $ Shutter"); } $ Firephp- & gt; Group end (); }? & Gt;

toggleFirePHP.php

  & lt; Php require_once ($ _ server ['document_ROOT']. '/ Firephp_include.php'); $ Firephp- & gt; SetEnabled (TRUE); ? & Gt;   

main.php

  & lt ;? Php include_once '/toggleFirePHP.php'; // Fix // Start here ......................................... ...... ........................ include_once 'safe / secure' login.php '; $ Firephp- & gt; Group ("in main.php, debugging begins"); $ Database = 'testdata1970_05'; $ Firephp- & gt; Logs ("log: include securedlogin.php and use $ database"); Connect ($ Database); $ Firephp- & gt; GroupEnd (); ? & Gt;   

So what went wrong in these codes? Your help will be fully appreciated. Clement

If / first, you include a file from the root fs

Use

  include_once './../toggleFirePHP.php';   

and

  include_once 'toggleFirePHP.php'; // OK    

No comments:

Post a Comment