jbrill Posted May 15, 2007 Share Posted May 15, 2007 Im looking to use different header text for different pages, but I would like to keep all the code in one page so i am using if statements. I can get them to work with one if statement and then an else statement, but i would like to add one more "page title" please help how to do this this code is attached below: <?php include('includes/dbconnect.php') ?> <?php // Assuming today is: March 10th, 2001, 5:16:18 pm $curdate = date("Ymd"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd"> <html> <head> <META NAME="DESCRIPTION" CONTENT="Makes Data Security Simple, Safe and Effective Utilizing 512 Bit Polymorphic Encryption"> <META NAME="KEYWORDS" CONTENT="encrypt-stick, turbocrypt, Secure usb, usb, encryption, encryption usb, usb encryption, computer key, encryption-stick, encryption stick, encrypt stick, encryption download, polymorphic encryption, 512 bit encryption, 512bit encryption, ENC, ENC security, ENC security systems, PMC ciphers, ciphers, encryption ciphers, TurboCrypt Encryption, Polymorphic Encryption, Encrypt-Stick software"> <link rel="SHORTCUT ICON" href="http://www.enc.com/favicon.ico"> <link href="encstyles.css" rel="stylesheet" media="screen"> <title>Welcome to ENC Security Systems, Encrypt-Stick and TurboCrypt Encryption Software</title> </head> <body> <br> <table width="790" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <?php if ($page_title == encryptstick) { print(" <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td height=\"70\"><span class=\"ELGrayHed\">title one<br /> text one </span></td> <td width=\"45%\" align=\"right\" valign=\"top\"><a href=\"index.php\"><img src=\"images/mainlogo.jpg\" alt=\"home\" border=\"0\" align=\"right\"></a><br></td> </tr> </table> "); } else { print(" <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td height=\"70\"><span class=\"ELGrayHed\">Regular title <br /> regular content for all pages with no page title </span></td> <td width=\"45%\" align=\"right\" valign=\"top\"><a href=\"index.php\"><img src=\"images/mainlogo.jpg\" alt=\"home\" border=\"0\" align=\"right\"></a><br></td> </tr> </table> "); ?><? } ?> </td> </tr> <tr> <td bgcolor="black"> <!-- begin nav bar --> <?php include('includes/navbar.php') ?> <!-- end nav bar --> </td> </tr> <tr> <td> i would like to ad done more page like text one. how do i do it? thanks in advance! this forum has helped me learn so much! Link to comment https://forums.phpfreaks.com/topic/51562-simple-phpif-question/ Share on other sites More sharing options...
marf Posted May 15, 2007 Share Posted May 15, 2007 use the old simple querystring $page = $_GET['page']; if($page == "encrypt"){ //Put your html here, or an include statement } else if($page == "contact"){ //Again html or include } else{ //This one is best to put index.php here } Link to comment https://forums.phpfreaks.com/topic/51562-simple-phpif-question/#findComment-253946 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.