Problem creatign scripts

Status
Not open for further replies.

xevell

Member
Messages
39
Reaction score
0
Points
6
I have a question.

I am trying to create a php script that contains no html tags or anything similar

I create a new blank document and put just php tags but when I upload it to the server and run it even though I didnt put any html tags if you right click and select view source you will see html tags like something put them there. I want to know if this is automatic from the server or what.

Thanks
Vic
 

xevell

Member
Messages
39
Reaction score
0
Points
6
But look, here is the code and I dont have any kind of outputs.

Code:
<?php
	//Function Pge.

	//MySQL server information.
	$MySQLInfo  = array (
		"Server" => "l",
		"DBName" => "",
		"Username" => "",
		"Password" => ""
		);

	$CoreSettings = array  (
		"TimeZone" => "America/New_York"
		);

	$UserSettings = array  (
			"MaxPunches" => 2,
			"UserLength" => 30,
			"PwdLength" => 7
			);

	function safe($value){ 
		// Stripslashes 
		if (get_magic_quotes_gpc()) { 
			$value = stripslashes($value); 
		}
		// Quote if not integer 
		if (!is_numeric($value)) { 
			$value = mysql_escape_string($value); 
		}
		return $value; 
	}

	function sql($query){
		mysql_connect("","","");
		mysql_select_db("");
		$result = mysql_query($query);
		mysql_close();
		return $result;
	}

	function encryption($password,$seed){
		$result = md5($password).md5($seed);
		$encrypted = md5($result);
		return $encrypted;
	}

	function authentication($username,$password){
		$result = sql("SELECT Passwd FROM SCAccounts WHERE UserName='".$username."'");
		if(mysql_num_rows($result) < 1){
			return 1; ##If user does not exist 
		}else{
			$row = mysql_fetch_array($result);
			if($row['Passwd'] == $password){
				return 2; ##If user and password matches
			}else{
				return 3; //If username does not match with password.
			}
		}
	}

	function checkstatus($username){
		$result = sql("SELECT ID,UserName FROM SCTimeBook WHERE UserName ='".$username."' ORDER BY ID DESC LIMIT 1"); //DESC Means descending in MySQL.
		if(mysql_num_rows($result) == 0){
			return 0;
		}

		$row = mysql_fetch_array($result);
		$TimeStampIn = $row['TimeStampIn'];
		$TimeStampOut = $row['TimeStampOut'];

		if($TimeStampIn == NULL){
			return 0;
		}else{
			return 1;
		}
	}

	function gettotalpunches($username){
		$result = sql("SELECT TimeStampOut FROM SCTimeBook WHERE UserName ='".$username."' AND GET_FORMAT(FROM_UNIXTIME(TimeStampOut),'ISO') = CURDATE()  ");
		return mysql_num_rows($result);
	}

	//function signin($username){
//		if(gettotalpunches($username) <= $UserSettigns["MaxPunches"]){
//			sql("INSERT INTO SCTimeBook(UserName, TimeStampIn) VALUES('".$username."',".time().")");
//			return header('Location: index.php?Msg=SignInOk');
//		}else{
//			return header('Location: index.php?Msg=MaxPunchesExceed');
//		}
//	}
?>
 
Status
Not open for further replies.
Top