Jump to content

How Would I...


Joshua F

Recommended Posts

I am trying to make a tip.php thing, that can be opened in a link and give a top about that page.

 

I am trying to make a default one.

 

Here's my code

<?php
session_start();
include "../includes/connect.php";
include "../includes/config.php";
if(isset($_SESSION['admin2'])){

//Add Page
if($_GET['title'] == 'addpage') {
echo "There is not a tip to this page.";
}
} else { echo "You are not logged in as an administrator."; }
?>

I have tip.php?action=addpage and it will echo that, but I want one that if there isn't a code for, it will do a default saying "There is not a tip for this page".

Link to comment
Share on other sites

Note quite sure I follow you exactly, but you want a new window to popup that will show tips for the page they are on. But not all pages have tips, is that right?

 

If so, you can manually define which pages do not have tips in an array.

 

$no_tips = array('page_title_1','page_title_2','page_title_3');
if(in_array($_GET['title'], $no_tips)){
   echo 'There are no tips to this page.';
}

Link to comment
Share on other sites

Note quite sure I follow you exactly, but you want a new window to popup that will show tips for the page they are on. But not all pages have tips, is that right?

 

If so, you can manually define which pages do not have tips in an array.

 

$no_tips = array('page_title_1','page_title_2','page_title_3');
if(in_array($_GET['title'], $no_tips)){
   echo 'There are no tips to this page.';
}

 

I'll just use this, seems easy to use. Thanks.

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.