Angelous
10-10-2009, 11:49 PM
Hi I need to figure out how to do the following:
I need to use two arrays to output two sets of variables into my website's echo content:
CODE:
<?
$giftCertificates = array("gift-certs-funny_0002", "gift-certs-funny_0003", "gift-certs-funny_0004"); /*ARRAY 1*/
$products = array("funny (2)", "funny (3)", "funny (4)") /*ARRAY 2*/
foreach ($giftCertificates as $key=>$details)
/*HOW DO I ADD IN THE SECOND ARRAY SO I CAN PUT $PRODUCTS IN THE SAME 'FOREACH' AS THE
$giftCertificates
*/
{
echo "<div id='certificate".$key."'>\n";
echo "<div class='lefthandpanel'>\n";
echo " <img src='images/certificates/".$details.".jpg'>\n";
echo "</div>\n";
echo "<div class='righthandpanel'>\n";
echo " <div class='shopEntry'>\n";
echo " <h3>A Gift Certificate from Mylastrequest.ie</h3>\n";
echo " <p>A personalised Gift Certificate from My Last Request and a Subscription to the website.</p>\n";
/*THIS IS WHERE I WANT THE SECOND ARRAY TO GO*/
echo " <p>Includes Free Updates 24/7<br>Product Code:$prod </p>\n";
/*THIS IS WHERE I WANT THE SECOND ARRAY TO GO*/
echo " <form action='https://www.paypal.com/cgi-bin/webscr' method='post'>";
echo " <input type='hidden' name='cmd' value='_s-xclick'>";
echo " <input type='hidden' name='hosted_button_id' value='8777643'>";
echo " <table>";
echo " <tr><td><input type='hidden' name='on0' value='Subscription Type'>Subscription Type</td></tr><tr><td><select name='os0'>";
echo " <option value='1 Year'>1 Year €19.99";
echo " <option value='3 Years'>3 Years €29.99";
echo " <option value='Life Time'>Life Time €49.99";
echo " </select> </td></tr>";
echo " </table>";
echo " <input type='hidden' name='currency_code' value='EUR'>";
echo " <input type='image' src='https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif' border='0' name='submit' alt='PayPal - The safer, easier way to pay online!'>";
echo " <img border='0' src='https://www.paypal.com/en_US/i/scr/pixel.gif' width='1' height='1'>";
echo " </form>";
echo " </div>\n";
echo " </div>\n";
echo " <br clear='all'>\n";
echo "</div>\n";
echo "<p> </p>\n";
}
?>
I need to use two arrays to output two sets of variables into my website's echo content:
CODE:
<?
$giftCertificates = array("gift-certs-funny_0002", "gift-certs-funny_0003", "gift-certs-funny_0004"); /*ARRAY 1*/
$products = array("funny (2)", "funny (3)", "funny (4)") /*ARRAY 2*/
foreach ($giftCertificates as $key=>$details)
/*HOW DO I ADD IN THE SECOND ARRAY SO I CAN PUT $PRODUCTS IN THE SAME 'FOREACH' AS THE
$giftCertificates
*/
{
echo "<div id='certificate".$key."'>\n";
echo "<div class='lefthandpanel'>\n";
echo " <img src='images/certificates/".$details.".jpg'>\n";
echo "</div>\n";
echo "<div class='righthandpanel'>\n";
echo " <div class='shopEntry'>\n";
echo " <h3>A Gift Certificate from Mylastrequest.ie</h3>\n";
echo " <p>A personalised Gift Certificate from My Last Request and a Subscription to the website.</p>\n";
/*THIS IS WHERE I WANT THE SECOND ARRAY TO GO*/
echo " <p>Includes Free Updates 24/7<br>Product Code:$prod </p>\n";
/*THIS IS WHERE I WANT THE SECOND ARRAY TO GO*/
echo " <form action='https://www.paypal.com/cgi-bin/webscr' method='post'>";
echo " <input type='hidden' name='cmd' value='_s-xclick'>";
echo " <input type='hidden' name='hosted_button_id' value='8777643'>";
echo " <table>";
echo " <tr><td><input type='hidden' name='on0' value='Subscription Type'>Subscription Type</td></tr><tr><td><select name='os0'>";
echo " <option value='1 Year'>1 Year €19.99";
echo " <option value='3 Years'>3 Years €29.99";
echo " <option value='Life Time'>Life Time €49.99";
echo " </select> </td></tr>";
echo " </table>";
echo " <input type='hidden' name='currency_code' value='EUR'>";
echo " <input type='image' src='https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif' border='0' name='submit' alt='PayPal - The safer, easier way to pay online!'>";
echo " <img border='0' src='https://www.paypal.com/en_US/i/scr/pixel.gif' width='1' height='1'>";
echo " </form>";
echo " </div>\n";
echo " </div>\n";
echo " <br clear='all'>\n";
echo "</div>\n";
echo "<p> </p>\n";
}
?>