Liam Delahunty: Home Tips Web Contact
Recommended laptop
under £500

Think I deserve a present? See my Amazon Wish List

SEO Create Link Here Form

An easy to install PHP script for creating a link automatically. Great for other sites and bloggers to use for their writing. Makes their job easier, especially if you have a really long keyword filled page name.

Generally you will place this into the shared folder for all your included files and call it in the once somewhere on the pages you want to try and promote. Here I'm keeping the file which I've named links.php in the incs folder.

<?php include ($_SERVER['DOCUMENT_ROOT']."/incs/links.php"); ?>

I've used it at the bottom of all the tips pages, along with the Stumbleupon badge like so:

SEO Create Link Here Form Example

When the user clicks their mouse in the box the complete link is selected, making it easy to copy and paste your link into their web page. This has been achieved using the onClick JavaScript event handler - onClick="this.focus();" within the input tag.

// First we just want this pages filename
$filename = explode('/', $_SERVER['SCRIPT_FILENAME']);
// go to last entry in the filename array
$filename = end($filename);

// remove extention for display
$filename = eregi_replace("\.php","",$filename);

// Clean up the filename, as we will use it for the link text
$filename = eregi_replace("_", " ", $filename);
$filename = ucwords($filename);

// Format domain name for the link text
$domainname = $_SERVER['HTTP_HOST'];
$domainname = eregi_replace("^www\.","",$domainname);

print (" <a href=\"\"> Link here</a>: <input onClick=\"this.focus();\" size=50 value=\"&lt;a href=&quot;". $_SERVER['SCRIPT_URI']."&quot;&gt;$domainname - $filename&lt;/a&gt;\">\n");

Much better than a bookmark tool, it lets the user grab the page they really want. It's also an easy way for you to promote your own web site. Try it!

Link here:

Share this!  

Search Engines Read Php | Seo Create Link Form | Seo Links On Page Javascript


  Tips | Home | Search | Contact

Link here: