Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    I am developing a CMS and would like the followoing variables in the index.php page

    PHP Code:
    $siteTitle "CleanMS"// Your Websites Title

    $metaDesc "Simple Lighweight CMS System"// Meta Description

    $metaKeywords "cms, lighweight,clean,ms,cleanms,content,management,system,philip,baucutt,custom,computer,services";

    $siteOwner "Phil Baucutt"/// Your Name

    $yearNow "2007"// The Current Year 
    i need to echo them in the following page

    PHP Code:
    <?php include 'includes/config.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=iso-8859-1" />
    <meta name="description" content="<?php echo "$metaDesc?>" />
    <meta name="keywords" content="<?php $metaKeywords?>"
    <title><?php echo "$siteTitle?></title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div class="title">
    <? echo $siteTitle ?>
    </div>
    <div id="menu">
        <?php include "includes/nav.php"?>
    </div>
    <div class="content">
    <?php include 'includes/content.php'?>
    </div>
    <div class="copyright">Powered By <a href="http://customcomputerservices.co.uk">CleanMS</a> <br />
    Copyright &copy; <? echo $yearNow ?> <? echo $siteOwner ?>
    </div>
    </body>
    </html>
    I have made an attemp at this but to no avail can anyone correce where I am goin wrong or point me in the right direction
    Regards Phil,


  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Why are you putting the variables in "" when they're already strings? Don't bother doing that. Also, there's a shortcut for that -- [minicode]<?= $var ?>[/minicode].

    Still, it seems like your code should work. Double-check that the include really contains what you think it contains.

  4. #3
    Senior Member Shani's Avatar
    Join Date
    Nov 2004
    Posts
    1,140
    Member #
    8171
    You need to end your php lines with a semicolon;
    ;-)
    Shani

    I have an eye for detail like you'd never believe.

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Damn... Nice catch :-D

    Worth mentioning that <?=?> requires no semicolons.

  6. #5
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    Got it working my CleanMS is now online at http://cleanms.uk.tt
    Regards Phil,



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:31 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com