/    Sign up×
Community /Pin to ProfileBookmark

php code in title tags

i want to change the title of my web page dynamically according to the selection of the user.
for eg :
if a user selects location as banglore that banglore should be shown in title .

  • <title> welcome to <?=$_get[‘location’]?></title>
    //i get location from the url.
  • but this code is not working …

    can any one help me….

    to post a comment
    PHP

    3 Comments(s)

    Copy linkTweet thisAlerts:
    @skywalker2208Feb 27.2010 — [code=php]
    <title> welcome to <?=$_GET['location']?></title>
    [/code]

    The $_GET array needs to be in all caps.
    Copy linkTweet thisAlerts:
    @dk_zero-coolFeb 27.2010 — Just an advice.

    instead of using <?=

    you should always use <?php echo

    Sooner or later one will learn this the hard way, it would be easier just to make it a habit. Only 6 month ago I had to work with a server that did not support the short cheat, and was not allowed to change these settings. I had to replace a lot of <?= in my files to make it work.

    The same goes for php start chars. Never use <? always <?php

    And don't replace <?php with ASP versions <&#37;

    These things will likely give you problems at some point.

    Use the standards...
    Copy linkTweet thisAlerts:
    @MindzaiFeb 27.2010 — And make sure you use htmlspecialchars too, outputting user input like that without filtering is very insecure.
    ×

    Success!

    Help @mlokeishreddy spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.14,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...