Jump to content

how to set the server up and running


shiva86

Recommended Posts

Hi,

 

actually the problem is i have been modifying a website, which has been already built and working. so i have all the code and everything, i need to keep it running to make changes. But i m facing problems like above

 

Warning: require_once(../../global-inc.php) [function.require-once]: failed to open stream: No such file or directory in C:\\Apache2.2\htdocs\login.php on line 2

 

Fatal error: require_once() [function.require]: Failed opening required '../../global-inc.php' (include_path='.;C:\php5\pear') in C:\\Apache2.2\htdocs\login.php on line 2

 

 

please let me know what to do ...

 

and the other thing is i need to execute the entire file of code at a time .....can u plz tell me the process of doing it ..........

 

 

thanks in advance

 

shiva

 

shiva

Link to comment
https://forums.phpfreaks.com/topic/233580-how-to-set-the-server-up-and-running/
Share on other sites

ya ofcourse

 


<?php
require_once('../../global-inc.php');

if(isset($_POST) && isset($_POST['username']))
{
$username = $_POST['username'];
$password = $_POST['password'];

/************finding user type***********/

$queryUserType  = "SELECT UserType from tblADMUsers where UserName='".$username."' and Password = '".md5($password)."'";
$resUserType    = array();
$resUserType    = $objApDb->ExecuteExternalQuery($queryUserType);
$resultUserType = $objApDb->FetchExternalObject($resUserType);
//print_r($resultUserType);die;
/************end**************************/
//echo $resultUserType->UserType;die;
if(isset($resultUserType->UserType) && $resultUserType->UserType==1)
{
  $query = "SELECT * from tblADMUsers where UserName='".$username."' and Password = '".md5($password)."' and UserType = '1'";
	  $res = array();
$res = $objApDb->ExecuteExternalQuery($query);
$result = $objApDb->FetchExternalObject($res);
	  if($result)
	  {
			$errormessage = "";
			$_SESSION['GLOBAL_ADMIN_MEM_INFO'] = array();
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["UserId"] = $result->AdminUserId;
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["UserName"] = $result->UserName;
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["FirstName"] = $result->FirstName;
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["EmailId"] = $result->EmailId;
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["SESSION_TYPE"] = 'Admin';
			if(isset($_POST['redirect_url']) && $_POST['redirect_url'] !='') {
				$red_url = $_POST['redirect_url'];
				//echo $red_url;
				//header("Location:".$red_url);
				header("Location: ../index.php?act=wel");
			}
			else { 
				header("Location: ../index.php?act=wel");
			}
			exit();
	}
	else
	{
	  $errormessage = "Incorrect Username or Password" ;
	}
}
else
{
  $query = "SELECT * from tblCONContributor where UserName='".$username."' and Password = '".md5($password)."'";
  $res = array();
  $res = $objApDb->ExecuteExternalQuery($query);
  $result = $objApDb->FetchExternalObject($res);
  //print_r( $result);die;
  if($result)
	  {
			$errormessage = "";
			$_SESSION['GLOBAL_ADMIN_MEM_INFO'] = array();
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["UserId"] = $result->ContributorId;
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["UserName"] = $result->UserName;
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["FirstName"] = $result->FirstName;
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["BusinessName"] = $result->BusinessName;
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["EmailId"] = $result->EmailId;
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["ACCOUNT_TYPE"] = $result->AccountType;
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["SESSION_TYPE"] = 'USER';
			$_SESSION['GLOBAL_ADMIN_MEM_INFO']["SESSION_TYPE"] = 'USER';
			$_SESSION['lastUserId']=$result->ContributorId;
			$_SESSION['accountType']=ucfirst($result->AccountType);
			if(isset($_POST['redirect_url']) && $_POST['redirect_url'] !='') {

				$red_url = $_POST['redirect_url'];
				echo $red_url;
				header("Location:".$red_url);
			}
			else { 
				header("Location: ../index.php");
			}
			exit();
	}
	else
	{
	  $errormessage = "Incorrect Username or Password" ;
	}
}


}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Administrator</title>
<link href="<?php print CSS_PATH;?>/style.css" type="text/css" rel="stylesheet" />
</head>
<body class="login">
<table width="100%" border="0" cellspacing="0" cellpadding="10">
  <tr>
    <td align="center">
<a href="/">
<img src="<?php print IMAGES_PATH;?>/u-do-logo.jpg" alt="U-Do" />
</a>
</td>
  </tr>
  <tr>
    <td align="center"><div class="LoginBlock">
        <div class="LoginBlockInnner">
          <form action="" method="post">
	  <?php if(isset($errormessage) && !empty($errormessage)) { ?> 
		 <div style="margin-left:60px;" class="error"><?php echo $errormessage; ?></div>
	   <?php }?>
		<input type ="hidden" name="redirect_url" value="<?php
		if(isset($_GET['_url'])) {
			$decode_url = urldecode($_GET['_url']);
			if(isset($decode_url) && $decode_url!='') { 
				echo $decode_url; 
			}
		}
		?>" />
            <table width="100%" border="0" cellspacing="0" cellpadding="5">
              <tr>
                <td align="right" width="35%">Username:</td>
                <td align="left"><input type="text" name="username" size="30" /></td>
              </tr>
              <tr>
                <td align="right">Password:</td>
                <td align="left"><input type="password" name="password" size="30" /></td>
              </tr>
              <tr>
                <td align="right"> </td>
                <td align="left"><input type="submit" name="loginsubmit" value="Login" class="button" />   <a href="/admin/login/forgot.php" class="underline">Forgot Password</a></td>
              </tr>
		   <td align="right"> </td>
                <td align="left"><a href="/" class="underline">Go to site home page</a></td>
		   
            </table>
          </form>
        </div>
      </div></td>
  </tr>
</table>
</body>
</html>

 

and the other thing is i need to execute the entire file of code at a time .....can u please tell me the process of doing it ..........

 

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.