Forum Moderators: open
It works great in IE and Firefox and I get the result page within a second.
Anyone knows why Opera do no respond to my simple form.
Opera 7.54 Win32 Windows XP
Thanks
It not only hangs when the input file is blank but also when I type text in the input field which are non relevant (such as "derefere" or "deerel").
What should I do to check that the data entered in the input file are correct (such as "D:\images\try.jpg") and be sure that OPera doesn't hang when data are incorrect.
Thanks
When leaving the field blank or typing wrong path or unrelevant text in the input file, Opera just hangs.
I have even put a exit(); statement on the first line of my result page (to force it to stop parsing) but it keeps hanging.
Furthermore, it even hangs when sending a .txt or .ini documents?
Spend the all day on Google doing search but found no solution.
Thank you
Just copy and paste and run it with Opera 7.54
If you leave the field blank, send a text file, ini file or type directly in the bar a wrong path or urelevant text, it should then hangs.
<?
//VARIABLE COMING FROM INCLUDE FILES
$width="765"; $bgcol="#a05552"; $eb3=""; $eb2=""; $switch="1"; $print="0"; $brk="";?><!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'><html><head><title>Try</title>
<style type="text/css">
<!--
* {margin : 0;}
body {width:765px; background-color:#a05552; margin-top:0; margin-left:auto; margin-right:auto; border:0 none inherit; text-align : center; font-family : arial, verdana, helvetica, sans-serif;}
p {color : #cccccc; font-size : 13px; font-family : arial; margin : 0; }
-->
</style></head>
<?
// ***************
// OTHER VARIABLES
// ***************
if(isset($_POST["preview"])) {$preview=$_POST["preview"];} else {$preview="none";}
// *********
// GD LIBRARY
// *********
$sizelimit = "42000";
$wlimit = "601";
$hlimit = "471";
//**********************
//FIRST PAGE LOAD - FORM
//**********************
if ($preview=="none") {echo "<p>Send your file</p>";
echo "<form method='post' action='load_try.php' enctype='multipart/form-data'>";
echo "<input type='file' name='imagefile' class='form1'>";
echo "<input name='preview' type='hidden' value='sendpic'>";
echo " <input type='submit' name='prev' value='PREVIEW' class='form1'></form>";
echo "</p>"; }
//+++++++++++++++
//***************
//SECOND PAGE LOAD
//***************
//+++++++++++++++
if($preview=="sendpic") {
echo "<p>";
$filename=$_FILES['imagefile']['tmp_name'];
$type = $_FILES['imagefile']['type'];
$size = $_FILES['imagefile']['size'];
$sizeb = @getimagesize($filename);
$widthp = $sizeb[0];
$height = $sizeb[1];
//****************
//CHECK FILE TYPE
//****************
if ($type!= "image/jpeg" AND $type!= "image/pjpeg") {
$preview = "error";
echo "<br>The format of the file (<b>".$_FILES['imagefile']['name']."</b>) is not recognized.<br>Make sure that your file is a <b>jpg/jpeg</b> format.<br>Please, submit a correct format.<br><br>"; }
//******************
//CHECK FILE SIZE KB
//******************
elseif ($size >= $sizelimit) {
$preview = "error";
echo "<br>The file you are submitting is too heavy (<b>".GetSize($size)."</b>).<br>Make sure the file is less than <b>".GetSize($sizelimit)."</b>.<br>Please, compress your picture and submit it again.<br><br>";}
//**********************************
//CHECK FILE SIZE (WIDTH and HEIGHT)
//**********************************
elseif ($widthp >= $wlimit ¦¦ $height >= $hlimit ) {
$preview = "error";
echo "<br>The file you are submitting is too large (<b>".$widthp."x".$height." px.</b>).<br>Make sure the file is not more than <b>".$wlimit."x".$hlimit."</b> px.<br>Please, reduce the size of your picture and submit it again.<br><br>";}
else {
$preview = "confpic";
//************
//COPY PICTURE
//************
echo "<br>OK PICTURE WILL BE COPIED AND THUMBNAIL GENERATED<br>"; }
echo "</p>";
//+++++++++++++++++++++++
//***********************
//RESUBMIT BECAUSE ERRORS
//***********************
//+++++++++++++++++++++++
if ($preview == "error") {
echo "<p>RE-Send your file</p>";
echo "<form method='post' action='load_try.php' enctype='multipart/form-data'>";
echo "<input type='file' name='imagefile' class='form1'>";
echo "<input name='preview' type='hidden' value='sendpic'>";
echo " <input type='submit' name='prev' value='PREVIEW' class='form1'></form>";
echo "</p>";
}
if($preview == "confpic") {
echo $brk;
echo "<br>OK PICTURE WILL BE COPIED AND THUMBNAIL GENERATED<br>";
} }
echo "</body></html>";
[edited by: tomda at 2:12 pm (utc) on Nov. 22, 2004]
if ($preview=="none") {echo "<p>Send your file</p>";
echo "<form method='post' action='load_try.php' enctype='multipart/form-data'>";
echo '<input type="hidden" name="MAX_FILE_SIZE" value="30000" />';
echo "<input type='file' name='imagefile' class='form1'>";
echo "<input name='preview' type='hidden' value='sendpic'>";
echo " <input type='submit' name='prev' value='PREVIEW' class='form1'></form>";
echo "</p>"; }
Try that and see what you get.
Regards
else {
$preview = "confpic";
//************
//COPY PICTURE
//************
echo "<br>OK PICTURE WILL BE COPIED AND THUMBNAIL GENERATED<br>"; }echo "</p>";
//+++++++++++++++++++++++
//***********************
//RESUBMIT BECAUSE ERRORS
//***********************
//+++++++++++++++++++++++
if ($preview == "error") {
echo "<p>RE-Send your file</p>";
echo "<form method='post' action='load_try.php' enctype='multipart/form-data'>";
echo "<input type='file' name='imagefile' class='form1'>";
echo "<input name='preview' type='hidden' value='sendpic'>";
echo " <input type='submit' name='prev' value='PREVIEW' class='form1'></form>";
echo "</p>";
}if($preview == "confpic") {
echo $brk;
echo "<br>OK PICTURE WILL BE COPIED AND THUMBNAIL GENERATED<br>";
} }
That last two if($preview == ...) bits need to be outside of the the last else block. see, $preview will always == error in that block because you set it just after the else. I know that didn't make much sense :) Just try moving the last two if blocks outside of the last else.
else {
$preview = "confpic";
//************
//COPY PICTURE
//************
echo "<br>OK PICTURE WILL BE COPIED AND THUMBNAIL GENERATED<br>"; }echo "</p>";
}
//+++++++++++++++++++++++
//***********************
//RESUBMIT BECAUSE ERRORS
//***********************
//+++++++++++++++++++++++
if ($preview == "error") {
echo "<p>RE-Send your file</p>";
echo "<form method='post' action='load_try.php' enctype='multipart/form-data'>";
echo "<input type='file' name='imagefile' class='form1'>";
echo "<input name='preview' type='hidden' value='sendpic'>";
echo " <input type='submit' name='prev' value='PREVIEW' class='form1'></form>";
echo "</p>";
}if($preview == "confpic") {
echo $brk;
echo "<br>OK PICTURE WILL BE COPIED AND THUMBNAIL GENERATED<br>";
}
I cannot confirm this is definitely the case, but I read about it once for sure.
I have answered you
>> I don't know if it's of any help, but there is a known problem when submitting forms in Opera.
I am aware that they are known problem in form, especially with enctype='multipart/form-data due to security flaw. I know for example that when left blank, the value by default in Opera is 'none'
>> This often happens when posting a comment on sites like A List Apart - it can hang for ages. It's not Opera's fault though, but the server's.
I do not think that Opera hang due my server's fault. I presume it is really Opera which do not respond.
>> It should be sending back a specific code, but a lot of servers don't send the correct code.
Which code are talking about?