Archive

Posts Tagged ‘URL’

current page url php

<?php

function getCurrentPageURL() {
$pageURL = ‘http’;
if ($_SERVER["HTTPS"] == “on”) {$pageURL .= “s”;}
$pageURL .= “://”;
if ($_SERVER["SERVER_PORT"] != “80″) {
$pageURL .= $_SERVER["SERVER_NAME"].”:”.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}

return $pageURL;
}

echo getCurrentPageURL();

?>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: ,

Remove index.php from site url – magento

Go to system -> configuration and click on the option (sidebar menu) “Web” under the main category “general” 

Then enable ” Use Web Server Rewrites “ to yes .

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Magento Tags: , ,

Archive url from post year – WordPress

<?php

get_year_link( $year );

?>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Wordpress Tags: , , ,

Archive url from post month – WordPress

<?php

get_month_link( $year, $month );

?>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Wordpress Tags: , , ,

Archive url from post date – WordPress

<?php

echo get_day_link(2010, 6, 20);

?>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Wordpress Tags: , , ,

Validate website address – PHP

<?php
 if (!preg_match("/^(http(s?)://|ftp://{1})
 ((w+.){1,})w{2,}$/i", $websitrAddres))
  $errorList[]="Invalid Website address. ' ";
?>
EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: , , ,

Switch to our mobile site