Matt Elhotiby
Matt Elhotiby

Reputation: 44066

Is there a way to add a get variable to the php include

I am trying to do this ...is it possible

<?php include("includes/sidebar.php?show_hide_tab=true"); ?>

because some pages dont need some logic in the sidebar

Upvotes: 1

Views: 72

Answers (1)

Mark Biek
Mark Biek

Reputation: 150799

Just do this

<?php
    $show_hide_tab = true;

    include('includes/sidebar.php');
?>

The scope of the $show_hide_tab variable will fall through to the include script.

Upvotes: 6

Related Questions