Parse error: syntax error, unexpected T_VARIABLE in

this is my code…It seems it is good.and i dont know why i get this error…
<?php
$to="mnl_mishelpdesk@ph.nykline.com";
$subject=“Email confirmation”;
$message=“Your job Order has been sent to MIS”;
mail($to, $subject, $message);
?>

That is quite strange! If you try this code by itself? Still the error?

yup…and i to re-write the code it seems ok…but i just want to know why this error occur…i tried to change the format that i found on the other forum…the error still appear.

Can you post the rest of the script?

//this form confirms the JO//
<?php
include_once(“conn.php”);
$ticket=$_POST[‘ticket’];

$results=mssql_query(“Select * from tblTicket”);//=‘$ticket’");
$query=mssql_query(“Select * from tblUser”);
?>

<html>
<head>
<title>Ticket Information</title>
</head>
<body>
<?php

while ($row=mssql_fetch_array($results)) {
		$tick=$row['TickNo'];
		$uname=$row['UserName'];
		$Tdate=$row['TickDate'];
		$Cat=$row['Category'];
		$SubCat=$row['Subcat'];
		$Desc=$row['Description'];
		$img1=$row['image1'];	
		$img2=$row['image2'];
		$img3=$row['image3'];
		$Cday=$row['DateCreate'];
		$Ttime=$row['TimeCreate'];
	}
	
while ($row=mssql_fetch_array($query)) {
		$dept=$row['Dept'];
		$email=$row['Email'];
			
}

?>
<table border=1 >

<tr align=‘left’>
<td>Ticket Number</td><th><?php echo $tick?></th> <td>Time</td><td><?php echo $Ttime?></td>

</tr>
<tr align=‘left’>
<td>User Name</td><td><?php echo $uname?></td> <td>Status</td><td>Open</td>
<tr align=‘left’>
<td>Date</td><td><?php echo $Cday?></td> <td>Category</td><td><?php echo$Cat?></td>
</tr>
<tr align=‘left’>
<td>Email Address</td> <td><?php echo $email ?> </td> <td>Sub-Category</td><td><?php echo$SubCat?></td>
</tr>

<tr align=‘left’>

<td>Department</td> <td><?php echo $dept ?> </td> <td>File attachment</td><td><?php echo “<a href=‘DLfile.php?download_file=$img1’>File1</a> &nbsp” ; echo "<a href=‘DLfile.php?download_file=$img2’>File2</a>&nbsp " ; echo “<a href=‘DLfile.php?download_file=$img3’>File3</a>&nbsp”; ?> </td>
</td>

<tr align=‘left’>
<td>Description</td>
<td><?php echo $Desc?></td>
</tr>
<table>
<form action=‘mailconfirmation.php’ method=‘post’>
<tr><input type=‘submit’ value=‘Send to MIS’></tr>
</form>
</table>
</body>
</html>

your top mail script compiles here with no error.

But you should be specifying a From: address otherwise your server may not send the mail.

thx.i realize my mistake on my previous script.there is a missing semi colon.
sometimes it ishard to debug an error in php.

where was the missing semicolon ?

actually it works now…mistake on my part that i didn’t see my error… the eero is on my previous script.

by the way i have another question regarding on multiple upload…i can upload a multiple file…but i want to view the file whether it is single or multiple file…

i have attach my script…i much appreciate your help.Thanks.

I cant see you code as it takes time to approve.

normally Id do this by passing a variable from the form used to upload the files.

For example, say a form used to load images into a gallery.

The upload form would ask “how many images to upload” on a select box format. Say the user submits 5, the upload form would produce 5 fileupload boxes, and also a hidden field set to 5.

My recieving script now just reads the hidden field and processes that number of files.

basically that is the main idea…Thx…

Hey do you have any idea how to create a login page with access level…i;m stuck in this…i have created a login but i don have any idea how to with a access level.

you need to add a field to your database of users that holds the access level of each user, then just read that value from the database when your user logs on and pass this to a session variable.

You can then check this variable before allowing certain pages or code routines to be accessed.

i’am still stuck in this…can you show me a example how to create using a session…much appreciated.thx

The same way you would use any PHP array except its called $_SESSION and can be used to store variables between http calls.

this is my code…where would i put that.thx.

<?php
session_start();
include_once(“conn.php”);

$err=array();
$flag=false;

$uname=stripslashes($_POST[‘username’]);
$pass=stripslashes($_POST[‘pass’]);

if(empty($uname)){
$err=‘Insert a Username’;
$flag=true;
}

if(empty($pass)){
$err=‘Insert a Password’;
$flag=true;
}

if($err){
$_session[‘err’]=$err;
session_write_close();
header(“location: login-form.php”);
exit();
}

$qry=mssql_query(“SELECT * FROM tblUser WHERE UserName = ‘$uname’ and Pass =‘$pass’ and UserLevel=‘Admin’”);

// Check username and password match
if ($row=mssql_fetch_array($qry)) {
// Set username session variable
session_regenerate_id();
$_SESSION[‘logged’] = $uname;
$_SESSION[‘uname’]=$_POST[‘username’];
// Jump to secured page
header(‘Location: home.php’);
}

else {
// Jump to login page
header(‘Location: login-form.php’);

}

?>

That depends where you want to use it and what your logic flow is.

Down near the bottom though you’re already using $_SESSION so I don’t understand why you’re asking?

You have already set $_SESSION[“logged”] and $_SESSION[“uname”] so what are you still having a problem with? Perhaps you are not able to see the session values set once the header refreshes the page?
Elaborate a little!