Jump to content

Should be simple


NotSureILikePHP

Recommended Posts

I might have figured this out by the time I get a response but then again maybe not. I am trying to dynamically add hyperlinks to a grid that I am populating. Here is the code:

 

 

<?php
        if ($count) {
            $ids= ($errors && is_array($_POST['ids'])) ? $_POST['ids'] : null;
               foreach ($custs as $cust) {
                $id = $cust->getId();
                $name = $cust->getName();
                ?>
            <tr id="<?php echo $id; ?>">
                <td width=7px>
                  <input type="checkbox" class="ckb" name="ids[]"
                  value="<?php echo $id; ?>"
                  <?php echo $sel? 'checked="checked"' : ''; ?>
                  <?php echo $default? 'disabled="disabled"' : ''; ?> >
                </td>
                <td><a href="customers.php?t=customer&id=<?php $id ?>"><?php echo $name; ?></a></td>
            </tr>
            <?php
            } //end of foreach.
        } ?>

[/]

 

It builds the link customers.php?t=customer&id=

 

However, when I echo out the $id it displays. I'm sure there's something simple I'm not doing here but not sure what it is.

Link to comment
https://forums.phpfreaks.com/topic/297383-should-be-simple/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.