Jump to content

isset get error


MSUK1

Recommended Posts

Hello

 

im trying to create a settings page for a script im working on

 

i want to use a variable 'l' for the link of an iframe

 

ive written this

 

settings.php

<?
/*
THIS IS YOUR SETTINGS PAGE
USE THIS TO CONFIGURE THE ITEM SWITCHER
WE HOPE YOU ENJOY OUR PLUGIN
*/

// STEP 1: CHOOSE YOUR THEME : 'green' 'orange' 'blue' 'pink' 

$color = 'blue'; // change between the ' '

// STEP 2: CREATE YOUR MENU

/* HERE IS OUR PRE-DEFINED MENU SEE DOCUMENTATION TO ADDING MORE ITEMS */

$menu = '       <li class="is-nav-li">
                	<a href="http://msukserver.net/Dev/ItemSwitcher/?l=domain1">
                    Theme Forest
                    <span class="orange">Orange</span>
                    </a>
                </li>
            	<li class="is-nav-li">
                	<a href="http://msukserver.net/Dev/ItemSwitcher/?l=2">
                    Code Canyon
                    <span class="blue">Blue</span>
                    </a>
                </li>
            	<li class="is-nav-li">
                	<a href="http://msukserver.net/Dev/ItemSwitcher/?l=domain3">
                    Graphic River
                    <span class="green">Green</span>
                    </a>
                </li>
            	<li class="is-nav-li">
                	<a href="http://msukserver.net/Dev/ItemSwitcher/?l=domain4">
                    Video Hive
                    <span class="pink">Pink</span>
                    </a>
                </li>
	';

// STEP 3: DEFINE EACH URL

$l = NULL;
if(isset($_GET['l']) && $_GET['l'] == "domain1"){
  $l = 'http://www.domain1.net/';
}
$l = NULL;
if(isset($_GET['l']) && $_GET['l'] == "domain2"){
  $l = 'http://www.domain2.net/';
}
$l = NULL;
if(isset($_GET['l']) && $_GET['l'] == "domain3"){
  $l = 'http://www.domain3.net/';
}
$l = NULL;
if(isset($_GET['l']) && $_GET['l'] == "domain4"){
  $l = 'http://www.domain4.net/';
}

echo $l;

?>

 

then the main index.php file which includes settings.php before the header

 

<?

include 'settings.php';

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>

<link rel="stylesheet" type="text/css" media="screen" href="is/css/<? echo $color; ?>.css"/>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>

</head>

<body>

<div id="isbar" class="isbar">
<div id="left">
	<div class="logo"></div>
</div>
<div id="right">
	<a id="close-button" class="close" href="#hello">
		<p class="close">close</p>
	</a>
	<a class="buy" href="#hello">
		<p class="buy">Purchase</p>
	</a>
</div>
<div id="center">
    	<div id="is-button">
        	<p class="button">Select A Theme</p>
        </div>
    	<div id="is-menu">
        	<ul id="is-nav-ul">
            <? echo $menu; ?>
            </ul>
        </div>
</div>
</div>

<!-- JS -->

<script type="text/javascript">
$("#is-button").click(function () {
$("#is-menu").fadeToggle("slow");
});    
$("#close-button").click(function () {
$("#isbar").fadeOut("fast");
});    
</script>

<iframe src="<? echo $l; ?>" scrolling="yes" width="100%" height="100%">
</iframe>

</body>
</html>

 

when selecting the link (which navigates to ?l=domain1 (for example))

 

nothing loads in the iframe, it doesn't seem to be echoing a value for 'l'

 

all help apperciated

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.