• Hello Team

    Actually I am trying to include the PHP code into above page using the “Insert PHP Code Snippet” plugin. All other includes working properly, but when I am trying to add the following code into same plugin & try to include by PHP code snippets some fatal error is occurs.

    Code I am Using in “Insert PHP Code Snippet” plugin –

    <?php
    include_once($_SERVER['DOCUMENT_ROOT'].'/offerbox/curl-xml.php');
    $flights =  new flightDetails('https://book.emailflights.com/remoteOfferGroup.php?groupid=217&password=xxxxx');
    echo '<table class="offerbox-table">';   
    foreach($flights->getOffers(6) AS $flight){
    echo '<tr><td class="offerbox-flightcol"><span class="offerbox-from" style="font-weight:bold;text-transform:uppercase">'.$flight['to'].'</span></td>
    <td class="offerbox-pricecol"> from <span class="offerbox-price" style="font-weight:bold">'.$flight['price'].'</span>
    <img height="10" width="10" src="/offerbox/icon-live.gif" alt="live-price" />
    </td></tr>';}
    echo '</table>';
    ?>

    ————————————————————–

    What error I am getting –

    Fatal error: Uncaught Error: Class 'flightDetails' not found in /home/emailh9/public_html/wp-content/plugins/php-code-for-posts/Classes/Shortcode.php(81) : eval()'d code:3 Stack trace: #0 /home/emailh9/public_html/wp-content/plugins/php-code-for-posts/Classes/Shortcode.php(81): eval() #1 /home/emailh9/public_html/wp-content/plugins/php-code-for-posts/Classes/Shortcode.php(38): PhpCodeForPosts_Shortcode::do_shortcode(Object(PhpCodeForPosts_Snippet), Array) #2 /home/emailh9/public_html/wp-includes/shortcodes.php(319): PhpCodeForPosts_Shortcode::handle_shortcode(Array, '', 'php') #3 [internal function]: do_shortcode_tag(Array) #4 /home/emailh9/public_html/wp-includes/shortcodes.php(197): preg_replace_callback('/\\[(\\[?)(php)(?...', 'do_shortcode_ta...', '[php snippet=1]...') #5 /home/emailh9/public_html/wp-includes/class-wp-hook.php(286): do_shortcode('[php snippet=1]...') #6 /home/emailh9/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters('[php snippet=1]...', Array) #7 /home/emailh9/public_html/wp-includes/po in /home/emailh9/public_html/wp-content/plugins/php-code-for-posts/Classes/Shortcode.php(81) : eval()'d code on line 3

    ——————————————————————-
    Can you please assist on the same.
    Yhank you in advanced.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Where is Class 'flightDetails' defined?

    Note: You have a password in that code. I’ve removed it but you way want to contact whoever you’re hooked up to and change passwords and api keys.

    Thread Starter mayurkg

    (@mayurkg)

    Thank you, Steve, for replay.

    I actually don’t understand, the same snippet is working on another website and that is also in WordPress, I actually can’t figure out why it is not working with this WordPress site.

    I already contacted them and told about the issue. They just ask me to raise this on the forum so I did.

    but yes let me check with them again, if have any good news.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    It sounds like you’re missing a plugin. How do the sites differ with respect to plugins and the theme? That’s where to start troubleshooting.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Fatal error: Uncaught Error: Class ‘myclassname’ not found’ is closed to new replies.