Hello, I have a small snippet of code that isn't functioning the way I expected it to, after migrating the website from a Linux box to a windows server with PHP 5.2.5. Below is that snippet of code:
<?php
...code that is working ok...
for($i = 0; $i <= $numberOfDays; $i++){
$thisDiv = microtime();
?>
<!-- BEGIN ARRAY ITEMS-->
<div class="boundingBox" id="bb<?= $thisDiv ?>">
<!-- -->
<label for="hotelID">Sleeping Room</label>
<input type="hidden" name="hotelID[]" value="hotelroom" />
<!-- -->
<!-- -->
<label for="date">Day and Date:</label>
<input type="text" name="stayDate[]" value=<?php echo $getNextDay ?> />
<!-- -->
<!-- -->
<label for="date">number of Rooms:</label>
<input type="text" name="numberOfRooms[]" value="1" />
<!-- -->
<a href="javascript:greyOut('bb<?= $thisDiv ?>')">X</a>
<!-- END ARRAY ITEMS -->
</div>
<?php
$dateItem = explode("/", $getNextDay);
$getNextDay = Date_Calc::nextDay($dateItem[1],$dateItem[0],$dateItem[2],'%m/%d/%Y');
}
?>
The line in particular that is giving me trouble is the <a href="javascript:greyOut('bb<?= $thisDiv ?>')">X</a> line. This is supposed to remove or greyOut the box by clicking on the X, but what it does is when I click on the first one, it deletes it, but when I click on the second one, the first one re-appears. It's quite odd. Does anyone know what may be causing this?
Thanks,
Sheel Shah
<?php
...code that is working ok...
for($i = 0; $i <= $numberOfDays; $i++){
$thisDiv = microtime();
?>
<!-- BEGIN ARRAY ITEMS-->
<div class="boundingBox" id="bb<?= $thisDiv ?>">
<!-- -->
<label for="hotelID">Sleeping Room</label>
<input type="hidden" name="hotelID[]" value="hotelroom" />
<!-- -->
<!-- -->
<label for="date">Day and Date:</label>
<input type="text" name="stayDate[]" value=<?php echo $getNextDay ?> />
<!-- -->
<!-- -->
<label for="date">number of Rooms:</label>
<input type="text" name="numberOfRooms[]" value="1" />
<!-- -->
<a href="javascript:greyOut('bb<?= $thisDiv ?>')">X</a>
<!-- END ARRAY ITEMS -->
</div>
<?php
$dateItem = explode("/", $getNextDay);
$getNextDay = Date_Calc::nextDay($dateItem[1],$dateItem[0],$dateItem[2],'%m/%d/%Y');
}
?>
The line in particular that is giving me trouble is the <a href="javascript:greyOut('bb<?= $thisDiv ?>')">X</a> line. This is supposed to remove or greyOut the box by clicking on the X, but what it does is when I click on the first one, it deletes it, but when I click on the second one, the first one re-appears. It's quite odd. Does anyone know what may be causing this?
Thanks,
Sheel Shah