1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Rep Power

    New to php. Need help

    I am try to do some work for a client that did the site is php.

    He made one header for the page and I want to change the title for each, but the next tine keeps cominng up to the title line. How do I stop that. Here is what I have

    PHP Code:
    <?php if($page ==echo '<title>Home Page</title>'?>
    if($page ==echo '<title>ABOUT Page</title>'?>
    <link rel"stylesheet ...........css" />
    The link stylesheet go's up to the same line as the title. How do I get a line feed
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Rep Power

    not really sure what this is good for, but either add a blank line after the closing PHP tag or add a single space after it or explitily output a line break after the titles:

    PHP Code:
    echo "Title ... \n"
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Pennsylvania, USA
    Rep Power
    This code is invalid and won't even work in PHP I don't think. You're missing right parentheses.
    PHP Code:
    <?php if($page ==1) echo '<title>Home Page</title>'?> 
    <?php if($page ==2) echo '<title>ABOUT Page</title>'?>
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo