2

I am using PHP to POST some value to this results page. I am trying to find out what kind of error I am missing. I have been starting at this with no luck. Can anyone see what I am missing syntax wise. As far as I can tell this SHOULD be running. Sadly all I currently get is a blank webpage.

<?php
if ($totalqty == 0){?>
<tr>
    <td></td>
    <td style='text-align: right;'>You did not order anything on the previous page!</td>
</tr>
<?php}
else{?>
<?php
if ($tireqty > 0){ ?>
    <tr>
    <td></td>
    <td style='text-align: right;'><?php echo $tireqty;?></td>
    <td style='text-align: right;'><?php echo TIREPRICE;?></td>
    <td style='text-align: right;'><?php echo $tireqty;?></td>
    </tr>
<?php}

if ($oilqty > 0){ ?>
<tr>
    <td></td>
    <td style='text-align: right;'><?php echo $oilqty;?></td>
    <td style='text-align: right;'><?php echo OILPRICE;?></td>
    <td style='text-align: right;'><?php echo $oilqty;?></td>
</tr>
<?php}

if ($sparkqty > 0){ ?>
<tr>
    <td></td>
    <td style='text-align: right;'><?php echo $sparkqty;?></td>
    <td style='text-align: right;'><?php echo SPARKPRICE;?></td>
    <td style='text-align: right;'><?php echo $sparkqty;?></td>
</tr>
<?php}

if ($brakeqty > 0){ ?>
<tr>
    <td></td>
    <td style='text-align: right;'><?php echo $brakeqty;?></td>
    <td style='text-align: right;'><?php echo BRAKEPRICE;?></td>
    <td style='text-align: right;'><?php echo $brakeqty;?></td>
</tr>
<?php}
if($tuneup =='on'){ ?>
<tr>
    <td></td>
    <td style='text-align: right;'><?php echo $tunup;?></td>
    <td style='text-align: right;'><?php echo TIREPRICE;?></td>
    <td style='text-align: right;'><?php echo $TUNEUP;?></td>
</tr>
<?php}
}?>

1 Answer 1

2

PHP does not like the missing space between your braces and the <?php and ?> tags. If you put a space in there it will work.

In order to make debugging future problems easier you should enable display_errors in your dev environment.

Sign up to request clarification or add additional context in comments.

3 Comments

And yes: I was absolutely stunned about this one, as highlighting did not help here, I had a hard time to find it.
I added some of the spaces and had some results. My page is no longer blank however I still think I am doing something wrong with spaces. I have 0's ?'s and >'s that have popped up on the page. Is this still a spacing problem? This is the string: 0){ ?> 0){ ?> 0){ ?> 0){ ?>
Finally found that my odd symbol problem came from echoing out constants.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.