Is there a PHP variable that will fetch the TITLE of the file?

I learned (thanks to David Powers) that you can use $_SERVER['PHP_SELF'] to refer to your current URL, which is useful in situations like putting a "Share on Facebook" button on your page.
However, some of these social networking sites allow you to also put the Article Title in the same button, so I was wondering if there was a PHP variable I can use for *that*. This way, by specifying the title of the article in the aptly-named title tag of the page, I can put those "submit this page to" links as includes that don't need to be specifically-edited for each page.

Create a variable for the title and use it in both places.
<?php
$title = 'Things you always wanted to know about...';
?>
<title><?php echo $title; ?></title>
// later on
<?php echo $title; ?>
Alternatively, if your page content is generated dynamically, you can store the title in the database.
Another technique would be to base the title on the page name.
$page = basename($_SERVER['SCRIPT_FILENAME'], '.php');
$title = ucwords(str_replace('_', ' ', $page));
That would store "About Us" in $title if the page is called about_us.php.

Similar Messages

  • I have been taking photos for years and have thousands.  When I use Apple TV screen saver, it seems only to grab a handfull and repeats them.  Is there a configuration setting that will allow me to have the screen saver grab more than just a few?  Thanks.

    I have been taking photos for years and have thousands.  When I use Apple TV screen saver, it seems only to grab a handfull and repeats them.  Is there a configuration setting that will allow me to have the screen saver grab more than just a few?  Thanks.

    The device has an 8GB drive for caching streamed meida, a small portion of that is used to temporarily store photos for the screensaver. It may vary depending on resolution etc but it seems to be around 100.

  • Is there a "live" selection that will deselect as you change the color?

    As a textile designer I use Index mode a lot to reduce down to a certain number of colors and then I usually have to go in and clean it up.
    A lot of times I select a certain color and then selectively go in and change it to a different color in the print. Usually they are stray pixels.
    I don't want to change all the instances of the colors just in specific places.
    My colleague swears that the first couple of days she was working in CC the marching ants would go away as she changed colors. But she has no idea why it stopped or how it happened in the first place.
    Is this a possibility??
    It would make my life so much easier if I could see my progress in real time.

    Create a variable for the title and use it in both places.
    <?php
    $title = 'Things you always wanted to know about...';
    ?>
    <title><?php echo $title; ?></title>
    // later on
    <?php echo $title; ?>
    Alternatively, if your page content is generated dynamically, you can store the title in the database.
    Another technique would be to base the title on the page name.
    $page = basename($_SERVER['SCRIPT_FILENAME'], '.php');
    $title = ucwords(str_replace('_', ' ', $page));
    That would store "About Us" in $title if the page is called about_us.php.

  • HT204382 a .flv document could not be opened. The movies file format isn't recognised. Is there additional software available that will enable quicktime to open the movie

    I wanted to view a document with a .flv extention (0.1. Launchpad.flv) on my mac book pro. The following message came up
    The document "o.1. Launchpad.flv " could not be opened.
    The movie's file format could not be recognised
    Is there some  additional software is available that will enable quicktime to open the movie?

    I'd get VLC & try that, although Perian may still work to play within quicktime, but it's no longer being developed.

  • I would like to play music from my iphone 5s on a sound bar with an iphone 3 dock. Is there an adapter available that will play audio please?that will play audio please

    I would like to play music from my iphone 5s on a sound bar with an iphone 3 dock. Is there an adapter available that will play audio please?

    The genuine Apple adapter works for me, most cheap knockoffs do not support sound ,it is usually in the micro print at bottom of the ebay offerring
    It is pricey by comparison but it works and the knock offs usually don't pay the patent  licence fee hence they guess the technology that is in the lightning plug
    and charge a minimal price

  • HT4759 I want to use icloud mail on both iPhone 4s AND my pc. icloud mail on PC is mega glitchy and frustrating because my PC is ancient, I run XP, & these DO NOT MEET req's for iCloud.  Is there a email platform that will run well on both XP and iPhone?

    I NEED to use icloud mail on both iPhone 4s AND my PC. I need to use both. 
    Trying to use icloud mail on PC is mega glitchy (STOP SCRIPT WARNINGS EVERY FEW MINUTES) and frustrating because:
      1.  my PC is ancient (but nicely refurbished/fast)
      2.  I run XP  (with both Firefox and Chrome- newest versions)
      3.  thusly, I DO NOT MEET SYSTEM REQUIREMENTS for iCloud.
    In my passed attempts I found that
    1. Yahoo doesn't work well on iPhone
    2. Gmail doesnt work well on iPhone.
    I must be missing something... an app or... maybe a donated/ NEW FREE MAC!  (That would be sweet!  Ha.)
    Is there an email platform that will run well on both XP and iPhone?
    or... Please say it isn't true: I would love a Mac tablet or desktop. We have no money for a mac. SOL?   Is this iCloud apple tech only for wealthy middle class and above who can afford to have the newest and best of everything? 

    @Naiks, having suffered through unsuccessful synching attempts for Calendar and Contacts myself, l would suggest you try the following:
    UNINSTALL iCloud control panel from your PC. Seems silly, but do it.
    Go into Outlook, and look at the very top menu. Click FILE, then ACCOUNT SETTINGS, then click the popup box.
    You will see a list of all your email accounts. Make sure that ONE of them has a checkmark against it. If not, select the account your want as your default, and click "set as default.
    Exit out of Outlook and reboot your machine.
    Now reinstall iCloud, check CALENDAR and CONTACTS, and do as instructed when prompted.
    Reboot for good luck and now launch OUTLOOK. All that remains is to locate your iCloud Contacts and Calendar files, and make them your default.
    IMPORTANT: Don't panic if you can't find your contacts -- they're there. Click CONTACTS and you'll see you have several available contact files. Locate the one label "iCloud" in grey type. Right-click on it, select PROPERTIES, then click the Outlook Address Book tab. Check the box that says something like "Make this my default Outlook Address Book." Keep clicking "apply" and "okay" until you've exited out of the dialog box maze.
    You may have to do something similar with your Calendar files. I dd not, but if you need to, do it.
    Everything should now sync pretty seamlessly.
    I didn't have the exact same problem as you, but my dilemma was close enough. Good luck!
    Arthur P. Johnson

  • My MacBook Pro is running very hot after lion install.  Are there any hardware changes that will help? What can I do to get it back to normal?

    My MacBook Pro is running very hot after lion install.  Are there any hardware changes that will help? What can I do to get it back to normal?

    I get the impression that most of the users on older hardware experiences similar temperature issues on Lion for a long time now. Awaiting for confirmation from the original poster.
    In the meantime I'm just cautious with regards to pushing the machine to such extreme temps, since something tells me such behaviour which includes monitor flickering and the likes is nothing but abnormal for any type of use...
    Any clues if 10.7.5 does anything on this? If not I'm afraid i see myself going back to SL for good...

  • HT201272 I have a purchased app that will not show up in the cloud and is no longer in the app store. Is there a way to get it from my iPhone to my iPad?

    I have a purchased app that will not show up in the cloud and is no longer in the app store. Is there a way to get it from my iPhone to my iPad?

    You should be able to copy it from your iPhone to your computer's iTunes via File > Devices > Transfer Purchases, and if it's compatible with your iPad you can then sync it to it

  • HT3964 I have a MacBook Pro that will not boot up. The apple symbol   Read more: I have a MacBook Pro that will not boot up. The apple symbol is there and a spinning wheel continues to spin. Any options??

    I have a MacBook Pro that will not boot up. The apple symbol is there and the spinning wheel keeps spinning. Any idea how I can fix this?

    Reinstall OS X.
    Reinstalling Lion/Mountain Lion Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    OR
    Reinstall Snow Leopard without erasing the drive
    Do the following:
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install the Combo Updater for the version you prefer from support.apple.com/downloads/.

  • Is there a plug-in that will allow me to view CR2 (raw) files from a Cannon 5D Mark III to PSE 9 ?

    is there a plug-in that will allow me to view CR2 (raw) files from a Cannon 5D Mark III to PSE 9 ?

    The 5D.3 was first supported in ACR 6.7 which you need PSE 10 to use, so there is no plug-in for PSE9 that will allow opening the files from a camera newer than when PSE9 became obsolete.
    Besides getting PSE12, assuming it is supported on your current computer—check the specs, you can use the free DNG Converter available from http://www.adobe.com/downloads/updates.html 
    to convert your CR2 files to DNG files that are compatible with older versions of ACR.  Be sure to set your DNGC compatibility settings to a version old enough to be openable with PSE 10’s ACR.
    As far as whether the OP is serious, it doesn’t hurt to ask the question before spending money on something you didn’t need.

  • HT1386 i have albums that will not sync now. I have only owned my ipod for 5 mo and it appeared to sync fine. Now it say that the process is complete but there are 3 items that will not sync to my ipod. I i just purchased from the store!!

    i have albums that will not sync now. I have only owned my ipod for 5 mo and it appeared to sync fine. Now it say that the process is complete but there are 3 items that will not sync to my ipod. I i just purchased from the store!! please help! thanks maggibnd

    Do they play in iTunes?
    Can you directly redownload them by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Is there a cable available that will connect an I pad to an older printer?

    Is there a cable available that will connect an I pad to a printer?

    If you have a Mac or PC there are utilities available that enable them to act as a print server, enabling you to print to any printer the Mac or PC can use.
    The donation-supported handyPrint and a commercial product such as Printopia ($19.95 with free trial) are two examples. The Mac must be "on" but may be asleep for them to work. Equivalent PC options may exist but you're on your own finding them.
    You can also buy this standalone print server:
    http://www.lantronix.com/it-management/xprintserver/xprintserver.html
    These options enable you to use any printer available to your network, even older ones that may predate AirPrint by decades. But as Bob said, everything you do with an iPad is wireless.

  • Is there one converter program that will convert these three formats:  cda, wma, and midi to mp3?, Is there one converter program tha t will convert these three formats:  cda, wma, and midi to mp3?

    Is there one converter program that will convert these three audio formats:  cda, wma, and midi to mp3?

    Hi Illaass,  Oh yes for days and I even called and email some asking this question and no one I could find did all three so I only have to buy one program.  The one I was going to download because it did two of them I read the reviews and 2 people said that a hacker was attached to the download and they changed all his search features amoung other things.  So I got out of there and that was the end of that.  That's why I decided to try this in case someone knows the answer.  Thanks for responding though.  Sandi

  • Is there a Terminal command that will pick up DNS numbers?

    Hello all,
    Is there a Terminal command that will pick up the DNS numbers utilized by a router?
    The router options don't show any, though the router is set to use PPPoA to pick them up.
    I kindly TIA,
    Eme '~[ )♥♪

    Hi, Thanks for the reply, I appreciate it.
    What do you mean by "pick up"?
    I mean to show what the DNS numbers are that the router is using.
    They are not entered in the DNS server field in Networks, TCP/IP tab.
    If you mean refresh the client settings, the DNS settings are obtained as part of the DHCP lease (or PPP connection in the case of PPP).
    The user/ OP is actually using PPPoA, when i googled PPPoA.. seems he is using Cisco perhaps.
    http://en.wikipedia.org/wiki/Point-to-PointProtocol_overATM (Asynchronous Transfer Mode)
    "PPPOA or PPPoA, Point-to-Point Protocol (PPP) over ATM, is a network protocol for encapsulating PPP frames in ATM AAL5. It is used mainly with cable modem, DSL and ADSL services.
    It offers standard PPP features such as authentication, encryption, and compression. If it is used as the connection encapsulation method on an ATM based network it can reduce overhead slightly (around 0.58%) in comparison to PPPoE".
    Essentially the original poster removed the OpenDNS #s from his DNS server field in the TCP/IP tab (b/c they seem to make Adobe.com inaccessible to him)
    removing them & allowing his router to "pick them up from the ISP" seems to solved his problem.
    However he can not, find what the numbers are that are being utilized,
    b/c they are not entered as usual in the Network, & part of the DHCP lease,
    or in Airport admin Utility.
    I/ we wondered, if there was a Terminal command that will show what the
    numbers are that are being used .
    Does that help clarify what I mean? Sorry to be so long winded.
    Eme '~[ )♥♪

  • Is there an anti-malware add-on that will make Firefox disconnect from the internet by mistakenly clicking on an infected link!?

    Just wondering if there is an anti-malware add-on that will make Firefox disconnect from the internet by mistakenly clicking on an infected link!?

    In order to be able to find the correct solution to your problem, we require some more non-personal information from you. Please do the following:
    *Click the Firefox button at the top left, then click the ''Help'' menu and select ''Troubleshooting Information'' from the submenu. If you don't have a Firefox button, click the Help menu at the top and select ''Troubleshooting Information'' from the menu.
    Now, a new tab containing your troubleshooting information should open.
    *At the top of the page, you should see a button that says "Copy text to clipboard". Click it.
    *Now, go back to your forum post and click inside the reply box. Press Ctrl+V to paste all the information you copied into the forum post.
    If you need further information about the Troubleshooting information page, please read the article [[Use the Troubleshooting Information page to help fix Firefox issues]].
    Thanks in advance for your help!

Maybe you are looking for