Depending on what local equals depends on which bannertop page should come up. I was doing this through the Get Vars script.
A live example can be found at www.site.com/test
Mind you it brings up a blank area...
<html><head><title>site.com</title>

* BELOW IS WHERE I DEFINE THE VARIABLE***
<?php
$visit= $HTTP_GET_VARS["visit"];
?>


</head><?php
include('http://www.site.com/top_page.php')
?>
</div>
<div align="center"><center> <table border="0" cellpadding="0" cellspacing="0" width="775" height="608" style="border-collapse: collapse" bgcolor="#FFFFFF">
<tr><td colspan="4" bgcolor="#D2D7E5" height="22" width="775"><span class="menu"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber1"><tr><td width="50%" align="center"><p align="center"><span class="menu">

********PROBLEM IS BELOW*****

<?php
if ($visit == 'local')
{
print "include ('http://www.site.com/111bannertop.php')" ;
}

else
{
print "include('http://www.site.com/bannertop.php') " ;
}
?>

********PROBLEM IS ABOVE*****

</td> </tr></table></span></td></tr>

    if (Uvisit == 'local') 

    You need the $ before the variable name.

    if ($Uvisit == 'local') 

      didnt work...still brings up an empty space

        Oh oops, I didn't see that part. You don't have to echo or print it, just include it.

        if ($visit == 'local') 
        { 
        include "/bannertop.php";
        }  

          how could i store the varible into another file so that I can use that variable in other parts of the site?

            Easiest method is to use sessions.

            session_start();
            ...
            ...
            $_SESSION['visit'] = $visit;
            ...
            ...
            

            And on future pages:

            session_start();
            $visit = $_SESSION['visit'];
            

            Just one major thing to watch out for: you can't send any output to the browser before calling session_start(). Putting it in the very first line of each page - "<?php session_start();" - where session data is used is a good tactic.

              what does it store the variable?
              I get this error
              Parse error: parse error, unexpected '.' in
              /test/new/test.php on line 10

                so with everypage i need

                session_start();
                $visit = $_SESSION['visit'];

                AND

                <?php
                $visit= $HTTP_GET_VARS["visit"];
                ?>

                But what extra code do I need to put into my links to other pages on my site?

                  Er, no. You don't have
                  $visit = $SESSION['visit'];
                  on the first page (where $visit is getting its value from $HTTP_GET_VARS (or $
                  GET)), because it's not in the session yet. On that page it would be more like

                  session_start();
                  ...
                  ...
                  $visit = $HTTP_GET_VARS['visit'];
                  ...
                  $_SESSION['visit'] = $visit;
                  

                  And the ... is of course just short for "some code" which I didn't write because it's irrelevant to the point.

                  And as I said, on every other page where you want to use this variable, you'd have something like

                  session_start();
                  $visit = $_SESSION['visit'];
                  

                  $_SESSION is much like any other array, you can add things to it, you can read from it, you can delete things from it. It just has this magical extra ability to keep its values from one page to the next.

                  Like I said, read the manual; that will fill in the bits where I'm handwaving.

                    great, thanks for the support!

                      Write a Reply...