Jump to content

need help


dezkit

Recommended Posts

Is there a code so if the page is index.php?page=Home it says Hi and if the page is index.php?page=Events it says Hello, or something like that, but the code HAS to be in index.php. Lots of Thanks.

 

im not that pro in PHP but i think the code has to look something like

 

<?php
$?=?("?");
if ($?=="index.php?page=Home")
  echo "Hi"; 
elseif ($d=="index.php?page=Events")
  echo "Hello"; 
?>

Link to comment
https://forums.phpfreaks.com/topic/92752-need-help/
Share on other sites

btw i want both the default page, index.php, and index.php?view=Home to say Home

 

<?php
$page = strtolower($_GET['page']);
switch ($page)
{
     case 'home':
          print 'Home';
     break;
     case 'events':
          print 'Events';
     break;
     case 'employment':
          print 'Employment';
     break;
     case 'gallery':
          print 'Gallery';
     break;
     case 'djs':
          print 'DJs';
     break;
     case 'vip':
          print 'VIP';
     break;
     case 'forum':
          print 'Forum';
     break;
     case 'contact':
          print 'Contact';
     break;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/92752-need-help/#findComment-475437
Share on other sites

try this

 

<?php
$getlink = $_GET["link"];

if ($getlink == "page1") {
echo "Hello This Is Page 1";
}
elseif ($getlink == "page2") {
echo "Welcome To Page 2";
}
else {
echo "Ooops! Page Not Found";
}
?>

 

so its like ?link=page1

 

and the out put is

"hello this is page 1"

Link to comment
https://forums.phpfreaks.com/topic/92752-need-help/#findComment-475443
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.