WordPress.org

Ready to get started?Download WordPress

Forums

Allow PHP in Posts and Pages
will not work with for loop (2 posts)

  1. santiazpi
    Member
    Posted 3 years ago #

    It took me very long to figure it out (by installing another plugin, shortcode exec php), but for some reason it is not able do deal with for for loops...

    Start of my code up to were it broke:

    $answers = array (
    	"A" => "XX",
    	"B" => "YY",
    	"C" => "ZZ",
    	"D" => "WW",
    	"E" => "UU"
    	);
    $questions = $_GET["q"];
    //Only run if we get the q(uestions) parameter
    if ( $questions > 0 ) {
    	for ($i	= 1; $i <= $questions; $i++) {
    
    		$responses = $_GET[$i][0];
    		}
    	//Return array

    The code would throw an eval error right after for ($i = 1; saying it was missing a ;. :(

    http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/

  2. roncsak
    Member
    Posted 2 years ago #

    I have the same problem!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic