WordPress Plugins Bugs

by Hiroshi on 13-03-2009

Plugins are cool. Every WordPress powered blog uses different plugins. They give your blog wings. There are few things you must be aware of before using plugins. What I do, I just test the plugin before I actually use it. All the plugins out there are not trustworthy. Even if any plugin comes by a trusted source, it can have bugs which will make your blogging life a bit complicated. I regularly check plugins, update plugins whenever any update is available and remove the plugin which contain any bug. Here are few popular WPplugins I noticed some bugs in them recently.

{ Continue Reading }

Kaspersky, Bit Defender, Facebook Hacked - Databases Exposed - SQL Injections

by Hiroshi on 09-02-2009

xss-attacks

Recently Kaspersky, Bit-defender, Face book websites were attacked via XSS and SQL Injections and their databases were exposed. Screen shots about their vulnerability and database tables were posted over internet.

Kaspersky is one of the leading companies in the security and antivirus market. Their website is down right now (9 feb 09, 6:42 pm) as I checked it, which was hacked recently. They are in maintenance mode. It seems as though they are not able to secure their own data bases. The companies who claim to secure our computers are not secure themselves. Seems incredible but unfortunately, its true. Through SQL injection some hackers were able to expose users, activation codes, lists of bugs, admins, shop and many more tables of their database. This is just a security alert though. No loss to customers and company as I suppose because the team involved is saying that their purpose is to alert the big companies about security measures. They have posted all the names of the tables in database though. Now I suppose we will see the new secure Kaspersky website. I have used myself this antivirus for quite a long time and then I had shifted to another one.

{ Continue Reading }

Appsolutely Free Webhosting For Content Management Systems

by alliyankabeer on 05-02-2009

free-web-hosting

Absolutely (appsolutely) FREE UNLIMITED Web Hosting offer for some specific content management systems i.e. WordPress, Drupal, ZenPhoto, phpBB, MediaWiki, Google apps etc. is here.

No banners or ads.
All free for life.
Automatic One-Click Software Installations
Bring your own domain - or get one from them free

{ Continue Reading }

iMatrixed Photo - New Facebook Application

by Hiroshi on 18-11-2008

iMatrix is a new FaceBook Application which converts any image into a cool Matrixed Text. You can use that text based image anywhere, lets say in email signatures or in website.

For example we convert following image into iMatrixed Text:

Origional Image

iMatrixed Image drawn with characters:

And now look at the following Matrixed Text based image. Below image is not a graphic but is actually generated by characters and letters actually.

Let me show you screenshot of coding behind:

You can add this application via following URL:

http://apps.facebook.com/imatrix/

You must be logged in into your Face book account to bookmark this application. Once you go to that URL, it askes you to bookmark via a little icon at the bottom of page.

Bookmark it and let the show begin. Send your friends text versions of any image you want.

PHP Register Globals Explained - Headers already Sent - Undefined Variable

by Hiroshi on 19-04-2008

There are some situations where simple code may work properly in case of PHP online or at localhost if register_globals are on. But not necessarily if register_globals are off.
Warning: Undefined Index - Use of Undefined constant selected
Warning: Header already sent
Sometimes messages like above that header already sent or undefined variable or index can appear.
Recommendation: You can use javascript redirect instead of header redirect.
Header Redirect
header("location: somepage.php?action=posted");

Use javascript redirection if header redirect is not working. i.e.

<script language="javascript" type="text/javascript">
<!--
alert("Please Login.");
document.location = "index.php";
-->
</script>

Use @ to avoid warnings

<? session_start();
if(@$_SESSION['usrName']=="") {
?>
And
$getname=@$_REQUEST["name"];

Note how I have used @ which is not necessary to use but working at strict server and with globals off to avoid warnings you can use this.
Register_Globals are by default off. These are for security reasons. Meant to be like it. It is recommended to program with globals off settings and use POST and REQUEST always while passing variables through pages. i.e.

$getact=$_REQUEST["act"];
$_POST["act"]

OR
echo $_POST["act"];
if(isset($_GET['action']) && $_GET['action']=="download")
{ // do something }

Get Dynamic And Static IP Address Of Visitor In PHP

by Hiroshi on 14-03-2008

Suppose we have a website and we want to get the user IP address and want to display it for him or we want to store it and get a log for hits of website. Also sometimes users may share same IP address for internet sharing & usage so his PC's IP will be something like 192.168.0.2 (Proxy Case) and actual IP address which he is using for internet, shared by his internet service provider will be different. We can find these both IP by this simple example of PHP code.

PHP Code:

<?
$domain=$_SERVER['REMOTE_ADDR'];
$domain1 = isset($_SERVER['HTTP_X_FORWARDED_FOR'])
 ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
echo "Viewer's Server's IP Address: <strong>$domain</strong> - ";
echo "Viewer's PC IP Address: <strong>$domain1</strong>";
?>

PHP Easy Most Database Connection

by Hiroshi on 24-02-2008

Setting up a database connection can be a difficult task if you google through different codes present online.
Here is the easy most method to create a dbconnection for PHP and mysql.

<?php
/* Online settings

$db = mysql_connect("localhost", "root", "password");
mysql_select_db("dbname",$db);
$siteurl =
http://javedkhalil.com/;
*/
/* Local settings */
$siteurl =
http://javedkhalil.com;
$db = mysql_connect("localhost", "root", "");
mysql_select_db("dbname",$db);
?>

Always write code both for Online and Local usage. Comment the code which is not being used. Also use siteurl variable and store website root path in it. It comes very very handy in times. We have to use many times website name inside the pages.
Now you can save this code in a file named like dbcon.php or whatever you like and include this file in php pages where you want to use dbconnection by this.

<?php Include ("dbcon.php"); ?> Here you are done.Another very simple code for dbconnection if you like, I am writing it here.

<?
$con=mysql_connect("localhost","root","")or die("Unable to connect");
mysql_select_db("dbname",$con)or die("Unable to open database");
?>

This easy way to connect from mysql database through PHP will give a message if the connetion is not established.

PMB Is Out For Download - PHP MySQL Records Management CMS

by Hiroshi on 16-12-2007

pmb

PHP Personal Management Book is available for download, absolutely free. PHP Personal Management Book is a complete PHP CMS for personal record management and covers more than just Address Book or Phone Book requirements. The purpose of this software is to enable you manage upcoming events which matter to you most and help you remember and manage your contacts and expenditures in well-organized manner.
PMB is PHP based open source absolutely free software for Home PC or Online Web Application usage.

Well every PHP developer search for stuff and examples about some PHP knowledge or ready to use codes and snippets and CMS etc. Who is not aware with the sourceforge.net? I also download stuff and get learning and PHP knowledge but mostly developers do not care about the design, interactivity and simplicity. Here, I suggest that you download PMB, use it and tell me how you feel about it? I was in need of such CMS, so I built it myself. I will enhance PMB even more along with planning and working with more Open-Source content-management-systems. Developing PMB was more than a joyful experience to me.

Everybody can use this CMS even without learning a thing about PHP. I have included all the help and how-to stuff along with PMB. PMB is my first Open-Source CMS development struggle and I am launching it at my birthday. I hope that PMB might prove useful for you and I wish that I will get suggestions and requests for upgrades and to add more modules and support in it.  

Top Features

  • Complete Personal & Home Record Management, CMS, More than a personal diary
  • Dual Controllable Accounts (Admin, User)
  • Dual Security with Password Protection and Secret Code
  • Flexible Modules, Enable/Disable Feature
  • Photo Support for Contacts and Events
  • Group Management (Arrange records into groups)
  • Alerts & Reminders

Other All Features

  • Complete Phone Book (Home, Office, Mobile)
  • Complete Address Book (Home, Business, Personal contact details, enhanced and advanced Contact Book experience, Easy Groups Management, manage contacts into groups)
  • Birthday Record management, upcoming birthdays reminders
  • Monthly Bills Record management
  • Expenditures management (Your important major expendiures record management to keep track of at what and how much you spend over time...)
  • Borrow, Lent, Balance and Saving Record management
  • To-Do-List
  • Events Diary with photo support
  • Reminders and alerts
  • Advanced search (Search by name, date, month, year, category or record detail)
  • Dual Controllable Accounts (Admin, User)
    You can use PMB front-end with both password protection or without password protection
    Decide your security option by yourself
  • Dual Security with Password Protection and Secret Code
    Assign password to any record you want to hide it from normal view if its private
  • Modules Enable/Disable Feature
    You can enable any module to use it or disable to ignore it. Flexibility allows you to keep your desired modules and sections available while others disabled. You can use disabled modules anytime by enabling them. Your data is secure, whether you enable or disable any one of it anytime.
    and much more...

Download PMB

***Notice***

The official page of PMB is offline for a while and is going under maintenance. It will be available at the start of the month December 08. Above link for download is working for now.

Here are some screenshots of PMB.

Front

Admin Area

Developing A PHP CMS - Coding & Programming

by Hiroshi on 04-12-2007

I will have to admit. Programming is a very sensitive and careful work to do. Its been quite some days while I have been developing my new but first open source based, php full content management system. Even if I did write down all the points which I will be going to cover in this management system but as the project went on I had to drop some code and add some new by time to time. I like to do PHP stuff. Its my one of many interesting things to do.

In PMB I promised my readers to provide them a complete content management system which will cover more than just a phone book or address book. I would say that it has actually more bells and whistles in it. The development process went on fairly. I am almost done with it. I have planned to provide my readers full support relating to this system. I have created some web-based instructions on how to use PMB? what PMB contains? What platform is uses? How PMB can be used at local machine? How to use it at local server? How to use wamp server in fact and wamp general settings and also screenshots of the software. Even if anybody do not know that how to run PHP pages at PC locally, I can say that by reading detailed instruction manual along with PMB, he will be able to setup PMB locally and use it successfully for his record management needs.

I am pretty happy about the development of this CMS. If I will get responses and suggestions, I will even enhance its functionality, support and modules. Presently it will support images also and everything is customizable. Just waiting for 17-December-2007 to arrive and PMB will be on its way.

MySQL Query Is Not Updating Records

by Hiroshi on 02-11-2007

Did you wonder sometimes that why mysql update command is not updating my records when the syntax of update query is perfectly alright?

This is the problem i stuck with couple of times and I just wondered and looked for solution but seriously never found any solution to that anywhere untill I found the answer to this question and I was relieved than from tension.

The problem was that I was naming the variables used in mysql query which were used by mysql itself.
Suppose that if there are seven variables in total number and mistakenly you named just one of them which is used by mysql, even than mysql update query will not work also and will not update records in the database.

For example by, from, status etc.

Insert mysql query will run and add records in database but update query will not be running.

Incorrect Query
UPDATE expenditures set by='$by', amount='$amount', from='$from', purpose='$purpose' where id='$action';

Correct Query
UPDATE expenditures set bby='$bby', amount='$amount', ffrom='$ffrom', purpose='$purpose' where id='$action';

Testing Your Query
The trick is to echo the query which you are running and test it in phpMyAdmin query window. i.e.

$myquery="UPDATE expenditures set bby='$bby', amount='$amount', ffrom='$ffrom', purpose='$purpose' where id='$action'";
echo "$myquery";

By echoing that you will get something like this
UPDATE expenditures set bby='javed', amount='2000', ffrom='home', purpose='books' where id='2'

Finding Error
This is just an example. Alright now copy that query (echo result) and go to phpMyAdmin and open that database and i suggest that table also which is going to be updated and click query button. In query window write that result and try running that.
If its right it will update successfully but if that's not right than it will give some error saying something like;

syntax error
'You have some error near UPDATE expenditures set by='$by', amount='$amount', from='$from', purpose='$purpose' ... in line 1'

If it gives error than it will highlight those variables also which are not right and there you can guess that what's wrong.

Always when your query is not running and giving error it is recommended that you echo that query and run that in phpMyAdmin query window and see cautiously the error message. Hope it will help.

Did you find any problem like this or query related? Please share with me.

 Page 1 of 2  1  2 »