that is what i have done on the first place..
I will just post my asstoticket.php so you can understand more..
Here is where i must post my MISPIC but after the page reloaded my value for $_POST['MISPIC'] get a empty value..
PHP Code:
<?php
session_start();
if(isset($_SESSION['username'])){
include_once("conn.php");
echo$_SESSION['MISPIC']=$_POST['MISPIC'];
$pend=mssql_fetch_assoc(mssql_query("Select * from tblTicket where TickNo='$_SESSION[assignticketno]'"));
$img=mssql_fetch_assoc(mssql_query("Select * from tblattachment where TicketNo='$_SESSION[assignticketno]'"));
$image1=trim($img['image1']);
$image2=trim($img['image2']);
$image3=trim($img['image3']);
?>
<html>
<head>
<script src="jquery/jquery.min.js"></script>
<script type="text/javascript" src="jquery/jquery.validate.js"></script>
<script>
$(document).ready(function(){
$.validator.addMethod("noSpecialChars", function(value, element) {
return this.optional(element) || /^[a-z0-9\_]+$/i.test(value);
}, "<br/><font size='3' color='#FF0000'>Username must contain only letters, numbers, or underscore.</font>");
$("#msg").validate({
rules: {
description:"required",
severity:"required"
}
});
});
</script>
<script>
function textCounter(field, countfield, maxlimit)
{
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else
countfield.value = maxlimit - field.value.length;
}
function textcount(field,mlimit)
{
field.value = field.value.substring(0, mlimit);
}
</script>
</head>
<body onload="document.msg.description.focus();">
<table BORDERCOLOR="#0B0B0B" border='1' bgcolor="#F5F5FA" width="80%" align='center'>
<tr>
<td width="100%" align="left" valign="middle">
<img src='img/assignto.png'>
</td>
</tr>
<td width="100%" align="center" >
<?php
date_default_timezone_set("Asia/Hong_Kong");
$dateassign=date("Y-m-d");
if(isset($_POST['Save'])){
$pend=mssql_fetch_assoc(mssql_query("Select * from tblTicket where TickNo='$_SESSION[assignticketno]'"));
$img=mssql_fetch_assoc(mssql_query("Select * from tblattachment where TicketNo='$_SESSION[assignticketno]'"));
$image1=trim($img['image1']);
$image2=trim($img['image2']);
$image3=trim($img['image3']);
if ($_FILES['images']['size'] <= 2 * 1024 * 1024){
$filename=basename( $_FILES['images']['name']);
$add = "upload/".$filename;
$original_name=$filename;
if(!empty($filename))
{
if(file_exists($add))
{
$filename = rand().$original_name;
$add = "upload/".$filename;
}
if(copy($_FILES['images']['tmp_name'], $add))
{
chmod("$add",0777);
}
}
echo "send";
}else{
echo "<font color='#FF000'><p align='center'>(File not send.Attach File exceeds the file limit.)</p></font>";
}
}
?>
<table align='center' BORDERCOLOR="#0B0B0B">
<form name='msg' id='msg' action='asstoticket.php' method='post' enctype="multipart/form-data">
<table align='center'>
<input type='text' value='<?php echo $_SESSION['MISPIC'];?>' name='assto'>
<tr>
<td><strong><label>Ticket No : </label></strong><?php echo $pend['TickNo'];?> </td>
</tr>
<tr>
<td><strong><label>Create By : </label></strong><?php echo $pend['UserName'];?> </td>
<td><b>Assign to : </b><?php echo echo$_SESSION['MISPIC'];?></td>
</tr>
<tr>
<td><strong>Date Create : </strong><?php echo $pend['DateCreate'] ;?></td>
<td><strong>Date to be Assign: </strong><?php echo $dateassign;?></td>
<tr>
<tr>
<td><strong>Category : </strong><?php echo $pend['Category'];?></td>
<td><strong>Sub-Category : </strong><?php echo $pend['Subcat'];?></td>
</tr>
<tr>
<td>
<strong>File Attachment : </strong>
<?php
if(!empty($image1))
{
echo "<a href='DLfile.php?download_file=$image1'>File 1</a>  ";
}
if(!empty($image2))
{
echo "<a href='DLfile.php?download_file=$image2'>File 2</a>  ";
}
if(!empty($image3))
{
echo "<a href='DLfile.php?download_file=$image3'>File 3</a>  ";
}
?>
</td>
<td ><b>Severity <font color=red>*</font>: </b>
<select class='severity' name='severity' tabindex='2'>
<option></option>
<option name='low'>Low</option>
<option name='Midium'>Medium</option>
<option name='High'>High</option>
<option name='Critical'>Critical</option>
</select>
</td>
</tr>
<tr>
<tr>
<td><strong>MIS Attachment : </strong>
<td>
<?php
$att=mssql_query("Select * from tblattachassign where tblattachassign.TicketNo='$id'");
while($row1=mssql_fetch_assoc($att))
{ $img=trim($row1['Image']);
if(!empty($img))
{
echo "Date: ".$row1['Date']. " <a href='DLfile.php?download_file=$img'>Attach File</a> <br/>";
}
}
?>
</td>
</td>
</tr>
</tr>
<tr><td><strong>Description : </strong><?php echo wordwrap($pend['Description'],70,"\n",true);?></td></tr>
<tr>
<td align='left'>
<a href="#" onclick="document.getElementById('showattach').style.display=(document.getElementById('showattach').style.display== 'block')?'none':'block';">Attachment</a>
</td>
</tr>
<tr>
<td align='left'>
<div align='left' name='showattach' id='showattach' class='showattach' style="display: none">
<input align='left' type='file' name='images'>Max File Size 2mb
</div>
</td>
</tr>
<br/>
<table align='center'>
<tr>
<td>
<tr>
<td align='left'><b>Comment's/Solution <font color=red>*</font> :</td>
</tr>
<tr>
<td align='left'><textarea rows="7" cols="50" name="description" onKeyDown="textCounter(this.form.description,this.form.remLen,500);" onKeyUp="textCounter(this.form.description,this.form.remLen,500);" >
</textarea><br><input readonly type=text name=remLen size=3 maxlength=3 value="500"> characters left.</font></td>
</tr>
<tr>
<td align='left'>
<input type='submit' value='Submit' name='Save' onClick="javascript: var x=window.confirm('Send this message?');if (!x) return(false);" title='Submit a Message'>
<input type='Reset' value='Reset' name='reset' title='Reset'>
</td>
</tr>
</td>
</tr>
</table>
</form>
<br/>
</tr>
</td>
</table>
</body>
</html>
<?php
}else{
header('location:login.php');
}
?>
Bookmarks