atrum Posted November 26, 2009 Share Posted November 26, 2009 Hello all, I have been tinkering around with building my own dynamic website using php, and I have run into a very odd error. Basically I am attempting to place my functions into a config file, and call that file using an includes statement. I am really stumped as to why this is breaking . Any assistance is appreciated. The URL is [ http://electissimus.com/index.php?section=auth&page=login ] Here are the errors I get when I try to use includes. Warning: include(/auth/inc/config.auth.php) [function.include]: failed to open stream: No such file or directory in /home/cdorris/www/electissimus.com/auth/login.php on line 2 Warning: include() [function.include]: Failed opening '/auth/inc/config.auth.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/cdorris/www/electissimus.com/auth/login.php on line 2 Here is my code for the login script. <?php session_start(); /* config file contains functions vital to security */ include("/inc/config.auth.php"); $uname=$_POST['txt_uname']; $passwd=sha1($_POST['txt_passwd']); if($uname&&$passwd) { $dbu = "dbuser"; $dbp = "*********"; $dbh = "localhost"; $dbd = "db_test"; $dbt = "ts_membership"; $sqlconn=mysql_connect($dbh,$dbu,$dbp); if(!$sqlconn) { die('Could not conect: '.mysql_error()); } else { mysql_select_db($dbd,$sqlconn); $query=mysql_query("SELECT * FROM ".$dbt." WHERE mUserName='".$uname."'"); $numrows=mysql_num_rows($query); if($numrows!=0) { while($rows = mysql_fetch_assoc($query)) { $dbmUID = $rows['mUID']; $dbuname = $rows['mUserName']; $dbpasswd = $rows['mPassword']; } if($uname==$dbuname&&$passwd==$dbpasswd) { $_SESSION['Uname']=$dbuname; $_SESSION['UID']=$dbmUID; ck_role(); } else { header('Location: /index.php?section=auth&page=login&err=err1'); } } else { header('location: /index.php?section=auth&page=login&err=err2'); } } } else { header('Location: /index.php?section=auth&page=login&err=err1'); } /*end of if($uname&&$passwd)*/ ?> Thanks, Atrum Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted November 26, 2009 Share Posted November 26, 2009 it's saying that the system cannot find the config.auth.php file located at path '/inc/config.auth.php' you just need to make sure and set that path correctly as per your directory structure. Quote Link to comment Share on other sites More sharing options...
atrum Posted November 26, 2009 Author Share Posted November 26, 2009 That's the odd thing. it is setup to correspond to the directory structure of my site, and the file exists in the path specified. but still Same error. That is whats causing me to pull my hair out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.