Archive

Archive for the ‘other software’ Category

The virtual hosting provided by Lunarpages

November 23rd, 2008 No comments

I had hosted some of my websites on Lunarpages for about 2 years, their sevice were good previously but not good any more resently.

I had moved 2/3 of my website out of Lunarpages, their response to the tickets become too slow, I wait almost 5 hours for the initial response said my question will be forwarded to technical support staff and wait another day to get another response.

Now I have only several wordpress blogs left, and they complained the usage too high, I told them that all my blogs are not active, and they said maybe  malacious script exits on my site and no willing to examine the scripts.

Their limit for usage is 1% CPU usage, 1% Memory usage, 0.2 SQL usage and 20% Top Process, and I guess them put my hosting in a evaluation server for almost one year.


Lunarpages.com Web Hosting

$ PHP decode from and encode to Base64 $

October 21st, 2008 No comments

When preparing plugin for some blogging tool, sometimes it is needed to decode PHP to Base64, following is a simpleway.

Copy following code into a file called phpdecode.php and just to exeute it.

<?PHP
error_reporting
(E_ERROR | E_WARNING | E_PARSE);
@
set_magic_quotes_runtime (0);
@
header("Content-Type: text/html; charset=utf-8");
$code=$_POST['code'];
$action=$_REQUEST['action'];
if (
get_magic_quotes_gpc()) $code=stripslashes($code);

if ($action==‘decode’) {
$code=base64_decode($code);
$code=nl2br(htmlspecialchars($code));
}
else
$code=base64_encode($code);
?>

<html>
<body style=”text-align: center;”>
<div style=”text-align: left; width: 90%; font-family: Verdana; font-size: 14px; margin: auto; background: #EFEFEF; color: #000;”><b>Result: </b><br><br><?php echo ($code);?><br><br></div><br><br>
<form action=”decodephp.php” method=’post’>
<textarea name=’code’ cols=’100′ rows=’16′></textarea><br>
<input type=’radio’ name=’action’ value=’decode’ checked>DECODE &nbsp; &nbsp; <input type=’radio’ name=’action’ value=’encode’>ENCODE<br><br>
<input type=’submit’> &nbsp; &nbsp; <input type=’reset’>
</form>
</body>
</html>

You can copy the following code between <php> and </php>, and give a  try at the link http://www.tsnpc.com/decodephp.php:

<php>JGFsbF9zZW50ZW5jZXNfZmlsZT0icGx1Z2luL3NiL3NlbnRlbmNlcy50eHQiOw0KJGFsbF9zZW49QGZpbGUoJGFsbF9zZW50ZW5jZXNfZmlsZSk7DQokYWxsX251bT1jb3VudCgkYWxsX3NlbiktMTsNCiRjdXJfbnVtPXJhbmQoMCwgJGFsbF9udW0pOw0KJHBocHJldHVybj0kYWxsX3NlblskY3VyX251bV07</php>

Related Blogs

  • Related Blogs on php
Categories: other software Tags: ,

sql replace statement at locoy

August 29th, 2008 No comments

UPDATE Content SET [title]=REPLACE( [title],’existed text’,'replasement text’);

Categories: other software Tags:

A way to change the footer of Coppermine Photo Gallery

August 19th, 2008 1 comment

Coppermine Photo Gallery is a wonderful web photo album, following is a way to change the footer of CPG:

Go to the file of themes.inc.php in the folder \include, find the code:

global $template_footer;
$template_footer = ‘<div class=”footer” style=”padding-top: 5px;” align=”center”>
******you can put the content of your footer here**********

</div>’;

Categories: other software Tags: