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…
$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//

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

<title>Ticket Information</title>

while ($row=mssql_fetch_array($results)) {
while ($row=mssql_fetch_array($query)) {

<table border=1 >

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

<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 align=‘left’>
<td>Email Address</td> <td><?php echo $email ?> </td> <td>Sub-Category</td><td><?php echo$SubCat?></td>

<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>

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

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.




$err=‘Insert a Username’;

$err=‘Insert a Password’;

header(“location: login-form.php”);

$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[‘logged’] = $uname;
// 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!