Jump to content

Object Not Found Error 404


Diether

Recommended Posts

Good day ,, can someone help me with this?.. i encounter this upon submission of username and password.

it says that my object was not found. although i have it in my directory. thanks in advance.

 

error:

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404

localhost

Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7

 

the code use:

//home.php
<?php include("storeAdmin/admin_login.php");
doLogin()
?>

 

//admin_login.php
<?php
function doLogin()
{
 // if we found an error save the error message in this variable
	 $errorMessage = '';	
$userName = mysql_real_escape_string(!empty( $_POST['txtUsername'])) ? $_POST['txtUsername'] : '' ;
$passWord = mysql_real_escape_string(!empty( $_POST['txtPassword'])) ? $_POST['txtUsername'] : '' ;
 // first, make sure the username & password are not empty
 if ($userName == '') {
	 $errorMessage = 'You must enter your username';
 } else if ($password == '') {
	 $errorMessage = 'You must enter the password';
 } else {
	 // check the database and see if the username and password combo do match
	 $sql = "SELECT id
			 FROM user
			 WHERE username = '$userName' AND password = '$password'";
	 $result = dbQuery($sql);

	 if (dbNumRows($result) == 1) {
		 $row = dbFetchAssoc($result);
		 $_SESSION['plaincart_user_id'] = $row['id'];

		 // log the time when the user last login
		 $sql = "UPDATE user
				 SET user_last_login = NOW()
				 WHERE id = '{$row['id']}'";
		 dbQuery($sql);

		 // now that the user is verified we move on to the next page
		 // if the user had been in the admin pages before we move to
		 // the last page visited
		 if (isset($_SESSION['login_return_url'])) {
			 header('Location: ' . $_SESSION['login_return_url']);
			 exit;
		 } else {
			 header('Location:index.php');
			 exit;
		 }
	 } else {
		 $errorMessage = 'Wrong username or password';
	 }	

 }

 return $errorMessage;
}
?>
<html>
	 <form id="form1" name="form1" method="post" action="admin_login.php">
		 <p align="center">username:<input type="text" name="txtUsername" id="username" />
		 </p>
		 <p align="center">password:<input type="password" name="txtPassword" id="password" />
		 </p>
		 <p align="center"> </p>
		 </blockquote>
		 <p align="center">
		 <input type="submit" name="log_in" id="log_in" value="Log in" />
		 </p>
	 </form>
</html>


 

My folder structure:

1695181567ffadbaf87141eefe22c8c1bf68ea8e.jpg

Edited by Diether
Link to comment
Share on other sites

ah i see.. i know now the error came from:

localhost/online/admin_login.php which is not existed

but my url location is to be like this:

localhost/online/storeadmin/admin_login.php

my question is where to put that in my code? how to be in that directory when i submit?

Edited by Diether
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.