Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 5 of 5
  1. #1
    The One
    VisualDigits's Avatar
    Join Date
    Mar 2005
    Location
    New Jersey
    Posts
    1,916
    DNF$
    1,070
    Bank
    0
    Total DNF$
    1,070
    Donate  

    How to combine two values into one string?

    I'm a php newbie and I'm working on my php based site, but got stuck abit because I want to update the page title for each page using variables from a database. So I have 2 variables: $category and $title and want them to be part of the page title so that it would look like this:
    MySite.com - $category - $title.

    Can anybody help find the right code? Thanks in advance.
    Cogito, ergo sum!

  2. #2
    Gold Lifetime Member
    channelmaster's Avatar
    Join Date
    Dec 2004
    Location
    Switzerland
    Posts
    10
    DNF$
    165
    Bank
    0
    Total DNF$
    165
    Donate  

    Re: How to combine two values into one string?

    ... you could use it in the title-tag of the html-page with the following code
    <?php echo "$category - $title"; ?>

    ... or did I misunderstand your problem?

  3. #3
    The One
    VisualDigits's Avatar
    Join Date
    Mar 2005
    Location
    New Jersey
    Posts
    1,916
    DNF$
    1,070
    Bank
    0
    Total DNF$
    1,070
    Donate  

    Re: How to combine two values into one string?

    yes, this is what I was looking for. Thanks!
    Cogito, ergo sum!

  4. #4
    Gold Lifetime Member
    channelmaster's Avatar
    Join Date
    Dec 2004
    Location
    Switzerland
    Posts
    10
    DNF$
    165
    Bank
    0
    Total DNF$
    165
    Donate  

    Re: How to combine two values into one string?

    no problem at all.

  5. #5
    Account Terminated
    Join Date
    Mar 2005
    Location
    Canarian Islands
    Posts
    234
    DNF$
    1,563
    Bank
    0
    Total DNF$
    1,563
    Donate  

    Re: How to combine two values into one string?

    <title><?php echo $category .'-'.$title;?></title>

    is faster.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Domain name forum recommended by Domaining.com