Jump to content

[SOLVED] Annoying Errors


Akenatehm

Recommended Posts

My php script was working before, now it is returning a bunch of errors about connecting to the mysql database.

 

Here is the script:

 

<?php

include "../connect.php";

if(isset($_POST['submit']))

{

   $username=$_POST['username'];

   $password=$_POST['password'];
   
   $email=$_POST['email'];

   if(strlen($username)<1)

   {

      print "You did not enter a username.";

   }

   else if(strlen($password)<1)

   {

      print "You did not enter a password.";

   }

   else

   {

      $insert="Insert into users (username,pass,email) values('$username','$password','$email')";

      mysql_query($insert) or die("Could not insert comment" . mysql_error());
  
  echo "User Added. <A href''<a href=\"home.html\">Click here</a> To Go Home.";
   }

  }

?>

 

and here is the connect.php include file

 

<?PHP

$db = mysql_connect ("localhost", "username", "password");

if (!$db)

	die ("No Database Found");

if (!mysql_select_db ("database",$db))

	die("No Database Selected");

?>

 

It is returning the following erros:

 

 

Warning: include(../connect.php) [function.include]: failed to open stream: No such file or directory in /home/kaurlcom/public_html/relayadmin/add_user/add_user.php on line 3

 

Warning: include(../connect.php) [function.include]: failed to open stream: No such file or directory in /home/kaurlcom/public_html/relayadmin/add_user/add_user.php on line 3

 

Warning: include() [function.include]: Failed opening '../connect.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/kaurlcom/public_html/relayadmin/add_user/add_user.php on line 3

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'username'@'localhost' (using password: NO) in /home/kaurlcom/public_html/relayadmin/add_user/add_user.php on line 37

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kaurlcom/public_html/relayadmin/add_user/add_user.php on line 37

Could not insert commentAccess denied for user 'username'@'localhost' (using password: NO)

Link to comment
https://forums.phpfreaks.com/topic/134307-solved-annoying-errors/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.