Is it possible to have an onclick"" in an applett's parameters? I need a paramater to run a script that you guys helped me with before on a piece of freeware code:
<param name="cgi" value="functions.php?mode=picsaveo&edit=<?=$edit?>&edittimes=<?=time()?>">
thats the parameter (i think) where it would need to go. Ive already tried just whacking it on the end before the last ">" but it had no effect.
The section of functions.php that it calls is:
if($mode=="picsave"
{
include('dbconn.php');
$p = strpos($HTTP_RAW_POST_DATA, "\r"
;
$size = strlen($HTTP_RAW_POST_DATA);
if( $p === false) {
print "Content-type: text/plain\n\n";
print "error $size\n";
} else {
if(isset($edit)){
unlink($image_filename);
$fp = fopen($image_filename,'wb');
$edittime2 = time() - $edittimes;
$result2 = mysql_query("UPDATE ".$OekakiPoteto_Prefix."oekakidta SET edittime=(edittime + $edittime2) WHERE PIC_ID='$edit'"
;
mysql_close();
$resno = $edit;
} else {
$result = mysql_query("UPDATE ".$OekakiPoteto_Prefix."oekakimisc set miscvalue=miscvalue+1 where miscname='piccount'"
;
$result = mysql_query("SELECT miscname, miscvalue FROM ".$OekakiPoteto_Prefix."oekakimisc where miscname='piccount'"
;
$row = mysql_fetch_array($result);
$resno = $row[miscvalue];
//check if the picture is archived or not before saving
$awrite = "false";
while($awrite == "false"
{
$result = mysql_query("SELECT * FROM ".$OekakiPoteto_Prefix."oekakidta WHERE PIC_ID=".$resno);
$row = mysql_fetch_array($result);
if($row[archive] == "1"
{
//go to the next number
$result = mysql_query("UPDATE ".$OekakiPoteto_Prefix."oekakimisc set miscvalue=miscvalue+1 where miscname='piccount'"
;
$result = mysql_query("SELECT miscname, miscvalue FROM ".$OekakiPoteto_Prefix."oekakimisc where miscname='piccount'"
;
$row = mysql_fetch_array($result);
$resno = $row[miscvalue];
} else {
$awrite = "true";
}
}
}
$image_filenamejpg = $OPpics.'/'.$resno.".jpg";
$image_filename = $OPpics.'/'.$resno.".png";
unlink($image_filename);
$fp = fopen($image_filename,'wb');
if ($fp) {
fwrite($fp,substr($HTTP_RAW_POST_DATA,$p+2));
fclose($fp);
if($jpgcompression == "yes"
{
//convert to JPEG
$img = imagecreatefrompng($image_filename);
imagejpeg($img,$image_filenamejpg, $jpgcompressqual);
}
if(!isset($edit)){
$result = mysql_query("DELETE from ".$OekakiPoteto_Prefix."oekakicmt where PIC_ID='$resno'"
;
$result = mysql_query("DELETE from ".$OekakiPoteto_Prefix."oekakidta where PIC_ID='$resno'"
;
$thetime = time() - $edittimes;
//insert the picture into the database
$inserted = "false";
while($inserted == "false"
{
$result = mysql_query("INSERT into ".$OekakiPoteto_Prefix."oekakidta SET usrname='$username',hostname='$hostname', PIC_ID='$resno', IP='$REMOTE_ADDR', postdate=NOW(), edittime='$thetime'"
;
$result = mysql_query("SELECT count(*) as rowcount FROM ".$OekakiPoteto_Prefix."oekakidta WHERE PIC_ID='$resno'"
;
$r_rows = mysql_fetch_array($result);
if($r_rows[rowcount] == 1){
$inserted = "true";
}
}
}
mysql_close();
} else {
mysql_close();
fclose($fp);
print "Content-type: text/plain\n\n";
print "error $size\n";
}
}
echo "Content-type: text/plain\n\n";
echo "ok";
}
?>
Clearly thats waaaay too long so I doubt any1s gonna look at that BUT i dont think its neccessary anyway, I just posted it incase any one was curious.
Is there any way i can make the applett parameter (button thingy) use an onclick attribute? If not is there any sneaky way I could add a hidden submit button to do the same job?
Thanks
~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."
<param name="cgi" value="functions.php?mode=picsaveo&edit=<?=$edit?>&edittimes=<?=time()?>">
thats the parameter (i think) where it would need to go. Ive already tried just whacking it on the end before the last ">" but it had no effect.
The section of functions.php that it calls is:
if($mode=="picsave"
include('dbconn.php');
$p = strpos($HTTP_RAW_POST_DATA, "\r"
$size = strlen($HTTP_RAW_POST_DATA);
if( $p === false) {
print "Content-type: text/plain\n\n";
print "error $size\n";
} else {
if(isset($edit)){
unlink($image_filename);
$fp = fopen($image_filename,'wb');
$edittime2 = time() - $edittimes;
$result2 = mysql_query("UPDATE ".$OekakiPoteto_Prefix."oekakidta SET edittime=(edittime + $edittime2) WHERE PIC_ID='$edit'"
mysql_close();
$resno = $edit;
} else {
$result = mysql_query("UPDATE ".$OekakiPoteto_Prefix."oekakimisc set miscvalue=miscvalue+1 where miscname='piccount'"
$result = mysql_query("SELECT miscname, miscvalue FROM ".$OekakiPoteto_Prefix."oekakimisc where miscname='piccount'"
$row = mysql_fetch_array($result);
$resno = $row[miscvalue];
//check if the picture is archived or not before saving
$awrite = "false";
while($awrite == "false"
$result = mysql_query("SELECT * FROM ".$OekakiPoteto_Prefix."oekakidta WHERE PIC_ID=".$resno);
$row = mysql_fetch_array($result);
if($row[archive] == "1"
//go to the next number
$result = mysql_query("UPDATE ".$OekakiPoteto_Prefix."oekakimisc set miscvalue=miscvalue+1 where miscname='piccount'"
$result = mysql_query("SELECT miscname, miscvalue FROM ".$OekakiPoteto_Prefix."oekakimisc where miscname='piccount'"
$row = mysql_fetch_array($result);
$resno = $row[miscvalue];
} else {
$awrite = "true";
}
}
}
$image_filenamejpg = $OPpics.'/'.$resno.".jpg";
$image_filename = $OPpics.'/'.$resno.".png";
unlink($image_filename);
$fp = fopen($image_filename,'wb');
if ($fp) {
fwrite($fp,substr($HTTP_RAW_POST_DATA,$p+2));
fclose($fp);
if($jpgcompression == "yes"
//convert to JPEG
$img = imagecreatefrompng($image_filename);
imagejpeg($img,$image_filenamejpg, $jpgcompressqual);
}
if(!isset($edit)){
$result = mysql_query("DELETE from ".$OekakiPoteto_Prefix."oekakicmt where PIC_ID='$resno'"
$result = mysql_query("DELETE from ".$OekakiPoteto_Prefix."oekakidta where PIC_ID='$resno'"
$thetime = time() - $edittimes;
//insert the picture into the database
$inserted = "false";
while($inserted == "false"
$result = mysql_query("INSERT into ".$OekakiPoteto_Prefix."oekakidta SET usrname='$username',hostname='$hostname', PIC_ID='$resno', IP='$REMOTE_ADDR', postdate=NOW(), edittime='$thetime'"
$result = mysql_query("SELECT count(*) as rowcount FROM ".$OekakiPoteto_Prefix."oekakidta WHERE PIC_ID='$resno'"
$r_rows = mysql_fetch_array($result);
if($r_rows[rowcount] == 1){
$inserted = "true";
}
}
}
mysql_close();
} else {
mysql_close();
fclose($fp);
print "Content-type: text/plain\n\n";
print "error $size\n";
}
}
echo "Content-type: text/plain\n\n";
echo "ok";
}
?>
Clearly thats waaaay too long so I doubt any1s gonna look at that BUT i dont think its neccessary anyway, I just posted it incase any one was curious.
Is there any way i can make the applett parameter (button thingy) use an onclick attribute? If not is there any sneaky way I could add a hidden submit button to do the same job?
Thanks
~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."