Archive for March, 2009

How to disable all wordpress plugins?

Posted by om 11 March, 2009 (0) Comment

Sometimes you have to disable wordpress plugins all at once and most wordpress webmaster don’t like going wordpress plugin section and
Disable manually one by one, this looks very boring and annoying.
Here I have real quick peaceful solution!
1. Open you wordpress database in PhpMyAdmin.
2. Open SQL query panel/popup window.
3. Run this command

UPDATE wp_options SET option_value = ” WHERE option_name = ‘active_plugins’;

And it’s done!!
This query will not remove any plugin from server. You can again reactivate your wordpress plugins manually from blog control panel.
You can use this query to make your wordpress blog automated.

  • Share/Bookmark
Categories : WordPress Tags :

How to get the page name of the current URL?

Posted by om 4 March, 2009 (0) Comment

Using this script you can get PHP current page from a url.

function CPageName() {
 return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}

echo "The current page name is ".CPageName();
  • Share/Bookmark
Categories : AJAX Tags :

How to Get the Page URL with php code?

Posted by om 4 March, 2009 (4) Comment

Every php coder ask questions to get CURRENT PAGE URL with PHP, it is not as straightforward in raw php coding as one may think to get the current url to use it inside your application. Here is a code which you can use to get url easily.


function CPageURL() {
 $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;
}
  • Share/Bookmark
Categories : PHP Tags :