When a user clicks on a button I’d like a popup to open and when I click the accept button in the popup the popup closes. But when it closes, I want to change the button on which the user clicked to open the popup. I have used images instead of buttons. Please advise how can i do it.
Its not working for me.I think you dont get my question.”I am clicking on image then popup window opens after accepting whaterver in that popup window again it will show previous window,then that image should change” what should I do for that? Iam sending you updated code here:
<?php
session_start();
if($_SESSION['typeimagedis']=='image/gif')
$namedis=$_SESSION['typeimagenamedis'];
else
$namedis=$_SESSION['typeimagenamedis'];
if ($_POST['hidcropimg'] == 'hidcropimg')
{
if(file_exists('images/'.$_SESSION['typeimagenamedis']))
{
unlink('images/'.$_SESSION['typeimagenamedis']);
}
$targ_w =$_POST['w'];$targ_h = $_POST['h'];
$jpeg_quality = 20;
if(($_POST['typeimage'] == "image/gif"))
{
$src='upload/'.$_SESSION['typeimagenamedis'];
$img_r = imagecreatefromgif($src);
}
if(($_POST['typeimage'] == "image/jpg")|| ($_POST['typeimage'] == "image/jpeg")|| ($_POST['typeimage'] == "image/pjpeg"))
{
$src='upload/'.$_SESSION['typeimagenamedis'];
$img_r = imagecreatefromjpeg($src);
}
$dst_r = ImageCreateTrueColor( $targ_w, $targ_h );
@imagecopyresampled($dst_r,$img_r,0,0,$_POST['x'],$_POST['y'],
$targ_w,$targ_h,$_POST['w'],$_POST['h']);
$yes=1;
if(($_POST['typeimage'] == "image/gif"))
{
$name=$_SESSION['typeimagenamedis'];
imagegif($dst_r,'images/'.$name,$jpeg_quality);
}
if(($_POST['typeimage'] == "image/jpg")|| ($_POST['typeimage'] == "image/jpeg") || ($_POST['typeimage'] == "image/pjpeg"))
{
$name=$_SESSION['typeimagenamedis'];
imagejpeg($dst_r,'images/'.$name,$jpeg_quality);
}
}
if($_POST['subacc']=='Accept')
{
copy('images/'.$_SESSION['typeimagenamedis'],'crop/'.$_SESSION['typeimagenamedis']);
setcookie ("cronimagename", $_SESSION['typeimagenamedis'], time()+60*60*24*30,'/','iphoneid.com');}
?>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'>
function closewin(){
window.close();
$('#openimg',opener.document).attr('src','/v/vspfiles/photoutility/images/clickheretoTHK_off.gif');
//alert('openimg');
}
</script>
<?php
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="../js/jquery.min.js"></script>
<script src="../js/jquery.Jcrop.js"></script>
<link rel="stylesheet" href="../css/jquery.Jcrop.css" type="text/css" />
<link rel="stylesheet" href="demo_files/demos.css" type="text/css" />
<? if($_GET['ref']==1){?>
<META HTTP-EQUIV="refresh" CONTENT="0; URL=http://serverl.iphoneid.com/demos/croped.php?ProductCode=<?=$_GET['ProductCode']?>">
<? }?>
</head>
<body>
<div id="outer">
<div class="jcExample" style="width: 802px;height: 1344px;">
<table width="151" align="center" style="padding-right:65px;" >
<tr><td width="54"><form id="frmacc" name="frmacc" method="post" action=""><input type="submit" id="subacc" name="subacc" value="Accept" onClick="closewin();" /></form></td><td width="238">
<form id="frmcancel" name="frmcancel" method="post" action="crop.php?ref=1&ProductCode=<?=$_GET['ProductCode']?>" ><input type="submit" id="subcancel" name="subcancel" value="Select Again" /></form></td></tr></table>
<div class="article" style="position:relative; margin:70px 0 0 230px;">
<? if($_GET['ref']==1){
?>
<img src="wait.gif" width="200px" height="75px" >
<?
}else{ ?>
<div style="float:left; height:530px; padding:0px 0 0 0px; width:580px; background:url(<? if($_GET['ProductCode']=='IPBB'){?>black.png<? }elseif($_GET['ProductCode']=='IPBR'){?>red.png<? }elseif($_GET['ProductCode']=='IPBW'){?>white.png<? }?>) no-repeat; position:relative; z-index:999999999999">
</div><!--style="padding-top:<?=$padding?>px"-->
<div align="center" style=" height: 148px; width: 148px; position:absolute; top:161px; left:61px; z-index:1" ><img src="images/<?=$namedis?>" height="148" width="148" /></div>
<? }?>
</div>
</div>
</div>
</body>
</html>
To change the background image of your button from the pop up window use this :