Advertisement
Advertisement
| 05.14.2008 at 04:53AM PDT, ID: 23401004 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: |
**********************
mysql.php
*********************
<?php
// MySql Class and its properties
class MySql
{
/**
* MySql Server Host name
* @access private
*@var string
*/
var $host;
/**
* Mysql username
*@access private
*@var string
*/
var $dbUser;
/**
* MySql user's password
*@access private
*@var String
*/
var $dbPass;
/**
* Name of the database to use
* @access private
* @var String
*/
var $dbName;
/**
*MySql resorce link identifier stored here
*@access private
*@var STring
*/
var $dbConn;
/**Store Error message for connection Errors
*@access private
*@var String
*/
/**
* Mysql Constructor
*@param string host (Mysql server host name)
*@param String dbUser( Mysql user name)
*@param String dbPass ( Mysql user password)
*@param String dbName( Database to select)
*@access public
*/
public function MySql ($host,$dbUser,$dbPass,$dbName)
{
$this->host =$host;
$this->dbUser = $dbUser;
$this->dbPass = $dbPass;
$this->dbName = $dbName;
$this->connectTodb();
}
/**
*Establish Connection to Mysql database and select a database
*@return void
*@access private
*/
private function connectToDB()
{
// Make Connection to the Server
if (!$this->dbConn = @mysql_connect($this->host,$this->dbUser,$this->dbPass))
{
trigger_error ('Could not connect to server');
$this->connectError = true;
}
// Select Database
elseif (!@mysql_select_db($this->dbName,$this->dbConn))
{
trigger_error ('could not Select Database');
$this->connectError = true ;
}
else
echo("Connected to the Server");
echo("<br>");
echo( "You are Connected to:"); echo ( $this->dbName );
}
/**
*Checks for MySql Error
*@Return boolean
*access public
*/
public function isError()
{
if($this->connectError)
{
return true;
}
$error = mysql_error ($this->dbConn);
if (empty($error))
{
return false;
}
else
{
return true;
}
}
}
?>
***********************
index.php
**********************
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="test,diagnosis,repair,service,electronic,manufacturer,photocopier,fax,scanner,printer,starwriter,monitor,crt,tft,vending,warranty,retrofit,refurbish" />
<meta name="description" content="Electroversal is a provider of electronic service and repair solutions for copier,fax,scanner,printer,monitor,vending,EPOS,power supply" />
<title> > Home</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="shortcut icon" href="favicon.ico" />
</head>
<body><div id="wrap">
<?php
include('menu.inc.php');
?>
<div id="content">
<?php
// Include the MySQL class
require_once('DBClass/MySQL.php');
require_once ('DBClass/ConnectionString.php');
// Connect to MySQL
$db = & new MySQL($host,$dbUser,$dbPass,$dbName);
?>
<!-- Bellow code is to create html base form to get username and password -->
<form action="" method="post">
<table>
<tr>
<td>Username</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Login!"></td>
</tr>
</table>
</form>
</div>
<br />
<div id="footer">©<?=date("Y");?> Calyx Group</div>
</div>
</body>
</html>
|