facelessuser wrote:If you are talking about stray <div> tags under a PHP if else statement, then yes, BH is going to have a hard time with that. BH also has a hard time with similar things with compiler switches in C/C++ when people do wacky #if statements. This is a problem, because of 1. how BH tackles matching brackets and 2. the unpredictable places you can put the PHP if statements in the middle of HTML. If I added a whole lot more complexity, I could catch such things, but I don't plan on doing that.
Of course, I have no idea if your problem is because of what I described above. Please post an example and explain the issue you are having so I can properly evaluate whether it is something I can and want to fix.
-----------------------------------------------
Fair enough. I don't think that is the case here and I'm happy to post example. Not sure best way to do that so I'm pasting the whole page here (if you want something else let me know). THANKS!
<?php
if (isset($_FILES['imgselect'])) {
if (preg_match('/[.](jpg)|(gif)|(png)$/', $_FILES['fupload']['name'])) {
$filename = $_FILES['fupload']['name'];
$source = $_FILES['fupload']['tmp_name'];
$target = $path_to_image_directory . $filename;
echo "You selected: " . $filename;
// move_uploaded_file($source, $target);
// createThumbnail($filename);
}
}
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
<script src="myscript.js"></script>
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' }).val();
});
</script>
</head>
<body>
<div id="all">
<div id="content">
<h1>Artist's Inventory</h1>
<div id="floatcontain">
<?php
include('topmenu.html');
?>
<div id="center">
<!-- Add your site or application content here -->
<form name="additem" action="commit_itemdata.php" onsubmit="return validateForm();" method="post">
<!-- <label>Inventory ID:</label> <input class="inp" type="text" name="inventoryid" id="inventoryid" value="To Be Assigned"><br> -->
<label>Title:</label> <input class="inp" type="text" name="title" ><br>
<label>Medium:</label> <input class="inp" type="text" name="medium" ><br>
<label>Subject:</label> <input class="inp" type="text" name="subject" ><br>
<label>Created: </label> <input class="inp" type="text" id='datepicker' name="created_date"><br>
<label>Dimensions: </label> <input class="inp" type="text" name="dimensions" ><br>
<label>Sale Price:</label><input class="inp" type="text" name="sellingprice" ><br>
<label>Description:</label><input class="inp" type="text" name="description" id="description" ><br>
<!-- <label>Location:</label><input class="inp" type="text" name="location" id="location" ><br> -->
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
require_once('dbconfig.php');
$query = "select idlocation, location_name from location";
// echo "<br />".$allquery;
$result = mysqli_query($link, $query) or die('Unable to run query:' . mysql_error());
//$Pieces = mysqli_num_rows($result);
// echo " (Number of Pieces: $Pieces)</h1>";
if (!$result) {
echo "bad result";
echo mysql_errno($link) . ": " . mysql_error($link) . "\n";
}
echo "<select class='inp' name='location'>";
while ($row = mysqli_fetch_assoc($result)) {
echo "<option value=\"{$row['idlocation']}\">{$row['location_name']}</option>";
}
echo "</select>";
?>
<label>Venue:</label>
<input type="button" value="Add Venue" class="button_menu" onclick="addloc();"/> <br>
<label>Notes:</label> <textarea class="inp" rows="8" cols="40" name="notes" id="notes"></textarea><br>
</div> <!-- end div center -->
<div id="right">
<h2>Image File:</h2>
<div id="FileUpload">
<input type="file" id="BrowserHidden" name="image_file" onchange="getElementById('FileField').value = getElementById('BrowserHidden').value;" />
<div id="BrowserVisible"><input type="text" id="FileField" /></div>
</div> <!-- end div FileUplad -->
<!-- <input type="submit" value="SUBMIT" /> -->
<input type="button" value="Submit" class="button_menu sbtn" onclick="vsubmit();"/>
</form> <br>
</div> <!-- end div right -->
<div id="footer">
Bruce Norman 2013
</div>
</div> <!-- end div floatcontain -->
</div> <!-- end div content -->
</div> <!-- end div all -->
</body>
</html>