adamriley Posted May 14, 2010 Share Posted May 14, 2010 hi how can you add php in a heredoc e.g <?php $adam = <<<phpcode <?php $adam = $_POST['hello']; ?> phpcode; ?> Link to comment https://forums.phpfreaks.com/topic/201767-heredoc-php/ Share on other sites More sharing options...
kenrbnsn Posted May 14, 2010 Share Posted May 14, 2010 You would have to use eval on the variable. Why would you want to do this? What are you trying to accomplish? Ken Link to comment https://forums.phpfreaks.com/topic/201767-heredoc-php/#findComment-1058369 Share on other sites More sharing options...
adamriley Posted May 14, 2010 Author Share Posted May 14, 2010 main <?php // Some varibles for the football game card $Free_Games = Free; // the games are free e.g "Free" = free games "Pay" = Pay $Paypal = <<<paying <form target="PayPal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="business" value="*********"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="item_name" value="Football card | Stockport"> <input type="hidden" name="item_number" value=""> <input type="hidden" name="amount" value=""> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="shipping" value="1"> <input type="hidden" name="shipping2" value="0"> <input type="hidden" name="handling" value="0"> <input type="hidden" name="return" value="http://localhost/Game/Continue.php"> <input type="hidden" name="cancel_return" value="http://localhost/Game/Failed.php"> <input type="hidden" name="undefined_quantity" value="0"> <input type="hidden" name="receiver_email" value="***************************************************"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="no_note" value="1"> <input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/x-click-but6.gif" alt="Make payments with PayPal, it's fast, free, and secure!"> </form> paying; $link = <<<free <font style="font-size:27px" color="#000000" face="Arial"><b><a href="Continue.php">Continue</a></b></font> free; $message_free = <<<message_free Nobody has requested this slot if you wish to <br> Click the text below to continue! message_free; $message_pay = <<<message_pay Nobody has requested this slot if you wish to <br> Use the following image to buy it! message_pay; ?> What i would be doing is updating this file using another one Link to comment https://forums.phpfreaks.com/topic/201767-heredoc-php/#findComment-1058377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.