Hi,

I am new for PHP Developing, I have develop one online application for Visitor management system, I have use one webcam for take snapshot. its working in localhost very well, But in Domain its not working please help me.. It is most urgent...

My code is ....

index.php
<?php session_start();
if(!isset($_SESSION['user']))
{
header("location:logout.php");
}

include("db.php");
error_reporting(1);


if(isset($_POST['submit'])){


if(isset($_REQUEST['eid'])){

if(isset($_FILES['photo']) && $_FILES['photo']['size'] > 0 && file_exists("image/" . $_FILES["file"]["name"])) {
move_uploaded_file($_FILES["photo"]["tmp_name"],"image/" . $_FILES["photo"]["name"]);
"Stored in: " . "image/" . $_FILES["photo"]["name"];
$image="image/".$_FILES['photo']['name'];
}else{
$sNewestFile = null;
$iNewestTime = 0;
foreach (glob('image/*.jpeg') AS $files){
$iFileTime = filemtime($files);
if ($iFileTime > $iNewestTime){
$sNewestFile = $files;
$iNewestTime = $iFileTime;
$image=$sNewestFile;
}
}
}


$updateemp=mysql_query("UPDATE employee set empname='$_POST[name]',mobile='$_POST[mobile]',landline='$_POST[landline]',
extension='$_POST[extension]',email='$_POST[email]',deptid='$_POST[department]',companyid='$_POST[company]',
desid='$_POST[designation]',status='$_POST[status]',username='$_POST[username]',password='$_POST[password]',
address='$_POST[address]',photo='$image',gender='$_POST[gender]' where empid='$_GET[eid]'")
or die("Query Failedupdate".mysql_error().$updateemp);

if($updateemp){
?>
<script type="text/javascript">
alert("<?php echo $_POST['name']; ?> Details Updated Successfully");
window.location="employee.php";
</script>
<?php
}

}else{

if(isset($_FILES['photo']) && $_FILES['photo']['size'] > 0 && file_exists("image/" . $_FILES["file"]["name"])) {
move_uploaded_file($_FILES["photo"]["tmp_name"],"image/" . $_FILES["photo"]["name"]);
"Stored in: " . "image/" . $_FILES["photo"]["name"];
$image="image/".$_FILES['photo']['name'];
}else{
$sNewestFile = null;
$iNewestTime = 0;
foreach (glob('image/*.jpeg') AS $files){
$iFileTime = filemtime($files);
if ($iFileTime > $iNewestTime){
$sNewestFile = $files;
$iNewestTime = $iFileTime;
$image=$sNewestFile;
}
}
}
//insert employee
$insertemp=mysql_query("insert into employee(empname,mobile,landline,extension,email,deptid,companyid,desid,status,username,
password,address,photo,gender)values('$_POST[name]','$_POST[mobile]','$_POST[landline]','$_POST[extension]','$_POST[email]',
'$_POST[department]','$_POST[company]','$_POST[designation]','$_POST[status]','$_POST[username]','$_POST[password]',
'$_POST[address]','$image','$_POST[gender]')")or die("Query Failed".mysql_error().$insertemp);
if($insertemp){
?><script type="text/javascript">
alert("<?php echo $_POST['name']; ?> Added Successfully");
window.location="employee.php";
</script>
<?php }
}
}

<FORM name="myform" action="" method="POST" onSubmit="return validation(this.value);" enctype="multipart/form-data" id="myFormId">

<table class="" cellpadding="5" cellspacing="1" align="center" style="width:0 auto;">
<tr>
<td>Employee ID</td>
<td><input type="text" name="empid" size="20" maxlength="65" title="Enter Employee ID" readonly="true"
value="<?php echo $id; ?>"> </td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="name" id="name" size="20" maxlength="65" title="Enter Employee Name"
value="<?php if(isset($_GET['eid'])){echo $name;}?>"></td>
<td>Mobile</td>
<td>
<input type="text" name="mobile" id="mobile" size="20" maxlength="10"
value="<?php if(isset($_GET['eid'])){echo $mobile;}?>" title="Enter Mobile Name"></td>
</tr>
<tr>
<td>Landline</td>
<td><input type="text" name="landline" id="landline" size="20"
value="<?php if(isset($_GET['eid'])){echo $landline;}?>" maxlength="12" title="Enter Employee Landline"></td>
<td>Extension</td>
<td ><input type="text" name="extension" id="extension" size="20"
value="<?php if(isset($_GET['eid'])){echo $extension;}?>" maxlength="12" title="Enter Employee Extension"></td>
</tr>
<tr>
<td>E- Mail ID </td>
<td><input type="text" name="email" id="email" onKeyUp="echeck(this.myform.email)"value="<?php if(isset($_GET['eid'])){echo $email;}?>" size="30"title="Enter E-Mail ID"></td> <td>Company</td>
<td><select name='company'> <option value="0">Select Company</option>
<?php $selcom=mysql_query("select * from company")or die("query failed".mysql_error().$selcom);
while($rowcom=mysql_fetch_array($selcom)){ ?>
<option value="<?php echo $rowcom['companyid'];?>" <?php if(isset($_GET['eid'])){
if($companyid == $rowcom['companyid']) { echo "SELECTED"; } }?>><?php echo $rowcom['company']; ?></option>
<?php } ?>
</select> </td>
</tr>
<tr>
<td>Department</td>
<td><select name='department'> <option value="0">Select Department</option>
<?php $seldept=mysql_query("select * from department")or die("query failed".mysql_error().$seldept);
while($rowdept=mysql_fetch_array($seldept)){ ?>
<option value="<?php echo $rowdept['deptid']; ?>" <?php if(isset($_GET['eid'])){
if($deptid == $rowdept['deptid']) { echo "SELECTED"; } }?>><?php echo $rowdept['deptname']; ?></option>
<?php } ?>
</select> </td>
<td>Designation</td>
<td><select name='designation'> <option value="0">Select Designation</option>
<?php $seldesi=mysql_query("select * from designation")or die("query failed".mysql_error().$seldesi);
while($rowdesi=mysql_fetch_array($seldesi)){ ?>
<option value="<?php echo $rowdesi['desid'];?>" <?php if(isset($_GET['eid'])){
if($desid == $rowdesi['desid']) { echo "SELECTED"; } }?>><?php echo $rowdesi['designation']; ?></option>
<?php } ?>
</select> </td>
</tr>
<tr>
<td>Gender</td>
<td><select name='gender'>
<option value="0">Select Gender</option>
<option value='FEMALE'<?php if(isset($_GET['eid'])){ if($gender=='FFMALE') { ?> selected="selected"<?php } }?>>FEMALE</option>
<option value='MALE'<?php if(isset($_GET['eid'])){if($gender=='MALE'){?> selected="selected"<?php }} ?>>MALE</option>
</select></td>
<td>Status</td>
<td><input type="radio" name="status" id="status" value="Active" title="Select Active" <?php
if(isset($_GET['eid'])){if($status == "Active"){echo "checked";} }?>>Active
<input type="radio" name="status" id="status" value="Inactive" title="Select Inactive"<?php
if(isset($_GET['eid'])){ if($status == "Inactive"){echo "checked";} }?>>Inactive</td>
</td>
</tr>
<tr>
<td> Residential Address</td>
<td><textarea name="address" id="address" rows="4" cols="20" title="Address of Employee"
onKeyDown="limitText(this.form.address, this.form.countdown1, 150)"
onKeyUp="limitText(this.form.address, this.form.countdown1, 150)">
<?php if(isset($_GET['eid'])){ echo htmlentities($address); } ?></textarea>
<br/><font size="1">(Max characters)</font><input readonly type="text" name="countdown1" size="3" value="150"/></td>
<td>Browse Image</td>
<td><input name="photo" id="photo" type="file" size="15" title="Select Your Image!"/></td>
</tr>
<tr class="trh"> <td colspan="1"><font face="Arial, Helvetica, sans-serif" color="#0099FF" size="3">Login Details</font><hr size="2" color="#000000" /></td>
</tr>
<tr>
<td>User Name</td>
<td><input type="text" name="username" id="username" size="20"
value="<?php if(isset($_GET['eid'])){ echo $username; }?>" maxlength="65" title="Enter Employee UserName"></td>
<td>Password</td>
<td><input type="password" name="password" id="password" size="20"
value="<?php if(isset($_GET['eid'])){ echo $password; }?>" maxlength="65" title="Enter Employee Password"></td>
</tr>
<tr>
<td></td>
<td></td>
<td><?php if(isset($_GET['eid'])){?>Photo<?php } ?></td><td colspan="2"rowspan="2">
<?php if(isset($_GET['eid'])){?><img src="<?php echo $photo1;?>"width="150" height="150"/><?php }?></td>
</tr>
<tr>
<td>Take Snapshot</td>
</tr>
<tr>
<td colspan="5"><object width="800" height="800">
<param name="movie" value="file.swf">
<embed src="CapturePhoto.swf" width="710" height="365"> </embed>
</object></td>
</tr>
<tr>
<td colspan="5" align="center"><input type="submit" name="submit" value="Submit" /><input type="reset" name="reset" value="Reset" onClick="clearText(); " /></td>
</tr>
</table>
</div>
</form>


and my SAVE.PHP


<?php session_start();
//This application is developed by www.webinfopedia.com
//Visit www.webinfopedia.com for more examples and demos


//Now get the encoded image form flash through HTTP_RAW_POST_DATA
if(isset($GLOBALS["HTTP_RAW_POST_DATA"])){
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
$img = $_GET["img"];


//image Directory
$filename = "image/"."img". mktime(). ".jpeg";
file_put_contents($filename, $jpg);




} else{
//show error if image is not recived
echo "Encoded JPEG information not received.";
}
?>