JJohnsenDK Posted February 13, 2007 Share Posted February 13, 2007 Hey i got some problems with pear. I get this error when i try to run a dbquery() function: Fatal error: Call to undefined function dbquery() in C:\Programmer\xampp\xampp\htdocs\test\login\login.php on line 52. To me it seems like the script doesnt know that pear is installed. I have a login.php and a config.php file. login.php looks like this: <?php include('config.php'); ?> <form action="<?=$_SERVER['PHP_SELF']?>" method="POST"> <p> Brugernavn*<br /> <input type="text" name="usern" /> </p> <p> Password*<br /> <input type="password" name="passw" /> </p> <p> Gentag password*<br /> <input type="password" name="passw_again" /> </p> <p> Email*<br /> <input type="text" name="email" /> </p> <p> Hjemmeside<br /> <input type="text" name="website" /> </p> <p> Skal din email vises for alle brugere?<br /> <select name="show_mail"> <option value="1" selected="selected">Ja</option> <option value="0">Nej</option> </select> </p> <p><input type="submit" name="submit" value="Register bruger" /></p> </form> <?php //Tjekker om der er blevet trykket på submit if(isset($_POST['submit'])){ //Tjekker om der er blevet skrevet noget i felterne mærkeret med en *. if(!$_POST['usern'] || !$_POST['passw'] || !$_POST['passw_again'] || !$_POST['email']){ echo "Du har ikke udfyldt et eller flere af felterne mærkeret med en *. Udfyld dem venligst for at fortsætte.<br />"; } $result = dbquery("SELECT * FROM users WHERE username='$usern'"); if (dbrows($result) != 0) echo "Bruger ikke tilgængelig<br>\n"; } ?> And config.php looks like this: <?php set_include_path('../../../php/pear/'); include ('DB.php'); $type = "mysql"; $host = "localhost"; //mySQL server $user = "user"; //mySQL brugernavn $pass = "pass"; //mySQL kodeord $database = "db"; //mySQL database //Åbner Forbindelsen til mysql serveren og vælger database $dsn = "$type://$user:$pass@$host/$database"; $dbconn = DB::connect($dsn); if (DB::isError($dbconn)) { die($dbconn->getMessage()); } ?> And folder structure looks like this: Pear: webserver/php/pear/DB.php Htdocs: webserver/htdocs/ Hope someone can help. Link to comment https://forums.phpfreaks.com/topic/38297-how-to-install-or-use-pear/ Share on other sites More sharing options...
arianhojat Posted February 13, 2007 Share Posted February 13, 2007 since its a pear function doesnt it also need a DB::dbquery("SELECT * FROM users WHERE username='$usern'"); ??? Link to comment https://forums.phpfreaks.com/topic/38297-how-to-install-or-use-pear/#findComment-183639 Share on other sites More sharing options...
JJohnsenDK Posted February 13, 2007 Author Share Posted February 13, 2007 Nope, that doesnt work either :/... anyone who have any ohter suggentions? Link to comment https://forums.phpfreaks.com/topic/38297-how-to-install-or-use-pear/#findComment-183685 Share on other sites More sharing options...
JJohnsenDK Posted February 13, 2007 Author Share Posted February 13, 2007 Anyone who could help me out here?? Link to comment https://forums.phpfreaks.com/topic/38297-how-to-install-or-use-pear/#findComment-183751 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.