#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    51
    Rep Power
    14
    Hi there !!!

    Is it possible to assign a whole function or block to a variable ???

    eg.
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <? if (db_num_rows($qid_p) == 0) { ?>
    <li>No
    <? } ?>
    <? while ($prod = db_fetch_object($qid_p)) { ?>
    <p><b><a href="product_details.php?id=<?=$prod->id?>"><? pv($prod->name) ?></a></b>
    <br><? pv($prod->description) ?>
    <br>$<? pv($prod->price) ?>
    <br>[<a href="cart_add.php?id=<?=$prod->id?>">+ Add to Cart</a>]
    <? } ?>

    [/code]

    How to assign this code to a unique variable ???


    Regards,

    marcoBR
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,642
    Rep Power
    4476
    Don't quite understand what you're asking. Why not just use functions?

    ---JH

IMN logo majestic logo threadwatch logo seochat tools logo