Most Easy way to keep safe ur DB configuration file!

Suppose you have the file in your server named config.php where you’ve wrote the necessary functions for DataBase connection. Any Body can get information by accessing it directly from a browser. Here is a way to prevent this…

<?php
if (!defined(‘prover’))
{
die(“File not found”);
}
// MySQL Settings
$db_host = ‘localhost’;
$db_user = ‘root’;
$db_database = ‘registration’;
// Connect to the database
mysql_connect ($db_host, $db_user) or die (‘Could not connect to the database.’);
mysql_select_db ($db_database) or die (‘Could not select database.’);
print “Hallo”;
?>

The function defined checks whether a constant exists. The variable prover is not defined in the PHP script, so, if you try to access config.php  directly,  you’ll see  “File not found” right on top, preventing people from looking at your code and discovering what your login/password are, if any. In this case, mysql_connect lacks a password. That’s because there isn’t one in the local server.

Published in:  on March 25, 2008 at 3:46 am Comments (6)

Form Validation! Instant Alert on page!

Using Java Script you can check a form. The errors will be shown in a small window. But using JavaScript library, you can do it more smartly and effectively.
The basic method is to attach to the form’s onsubmit event, read out all the form elements’ classes and perform validation if required. If a field fails validation, reveal field validation advice and prevent the form from submitting.
Include the javascript libraries:

<script src=”prototype.js” mce_src=”prototype.js” type=”text/javascript”></script>
<script src=”validation.js” mce_src=”validation.js” type=”text/javascript”></script>

You write elements like this:
<input class=”required validate-number” id=”field1″ name=”field1″ />
You then activate validation by passing the form or form’s id attribute like this:
<script type=”text/javascript”>
     new Validation(‘form-id’); // OR new Validation(document.forms[0]);
</script>
See the Example:

(more…)

Published in: Uncategorized on March 21, 2008 at 10:02 pm Comments (3)

Independence of Movement!Drag Anywhere!

You have already seen how the widgets of a page can be moved any where of that page. This is a simple use of JavaScript. One of my honorable senior Apu vai came to RUET to attend the 3rd convocation and told me to use the best of JavaScript. He directed me to create this….

 drag.jpg
You can drag this kind of widgets any where of a web page. You can also save that setting for further viewing using Ajax. Download the example from my Shared Box of the right side of the page. The zip is named Drag.zip
*** It works fine in IE.

Published in: Uncategorized on March 20, 2008 at 3:41 am Comments (3)

I’ve Started Action Script!

Finally i’ve begun action script with flash. I’ve not seen any difficulty with button scripting and movie clip scripting Even now. But i’m sure there are some untolerateable factors which are coming toward me. But i’ll try my best to get a clear concept on it. Thnx to Mehedy (My friend) to help me by giving a book of it. 

My first project contains one scene with a Instruction to click on one button between two. By clicking on one of them, take it to other scene using Action Script. The Script show one label of scene two and become halted.

Simple Action Script of my two Button is below:

For Pink button:
on (release) {
 gotoAndStop(“Scene 2 Choice”,”pink”); //goes to label named pink of scene 2 and stop

}
For Green button:
on (release) {
 gotoAndStop(“Scene 2 Choice”,”green”);  //goes to label named green of scene 2 and stop

}

Published in: Uncategorized on March 17, 2008 at 8:13 am Leave a Comment

Have you ever seen such a beautiful thing?!

Do you want to make your site look like Facebook? Then the fact is JQuery! jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML. It was released January 2006 at BarCamp NYC by John Resig.One of my best friends Rana told me to study this and i’ve got it.

See the example below:

You can use this kind of window for login or inserting data.

untitled1.jpg

Or you can show a remote Page through this. (more…)

Published in: Uncategorized on March 16, 2008 at 9:09 pm Comments (2)

How to install Internet explorer 7 without validation key!

Download Internet Explorer 7.0 installer from the Microsoft site . You have to choose Windows XP Service Pack 2 (SP2) as your operating system. Remember you can’t install IE 7.0 if service pack 2.0 is not installed in your operating system. And if you are facing genuine windows validation problem while downloading IE7 installer from the Microsoft site, can also download this installer alternatively.
Extract the downloaded Internet Explorer setup file ( IE7-WindowsXP-x86-enu.exe ) using WinRAR to a directory (IE7-WindowsXP-x86-enu).
(more…)

Published in:  on March 15, 2008 at 6:44 am Comments (2)

বন্ধে কাজ করার মজাই আলাদা!

আজ থেকে রুয়েট বন্ধ। সমার্বতন এবং মিড সেমিষ্টার এর ছুটি একসাথেই হবার সম্ভাবনা আছে। কোন ক্লাস নাই। সকালে ওঠার তাড়া নাই। তাই সারা রাত ধরে নতুন জিনিস শেখার এর চেয়ে ভাল সময় হয় না। ইউনিকোড নিয়ে খুব বেশি ধারনা না থাকায় এই রাত গুলো তার জন্যই বরাদ্দ।

Published in: Uncategorized on March 12, 2008 at 6:59 pm Leave a Comment

Q: Why Joomla? Ans: Why not Joomla?

               In my current semester we have a course that includes PHP project. We will have to submit this within a month.
I think most of our students in our class room are trying to do best with their project. But time is not enough. So, they will not be able to include maximum features on their project site.
joomla_logo_black.jpg

Here comes the necessity of using a CMS (Content Management System) like Joomla. This CMS offers you to utilize your expectation. Youhave full independence of coding with your choice. Joomla uses most effective features on it and it has high quality security on its contents. most important factor is that, it is Open Source. So, any body can configure it and use it’s capability of wellperforming.

Starting Joomla:
Choose a beautiful Joomla template and install it. Then Manage the articles, Edit the HTML,CSS files, Add new Component using PHP or Other
database connectivity language,Even make a new template.

joomla will give many builtin features that will make your Website Effective and Modern.
Joomla! Features:
The power and simplicity of the Joomla application may be difficult to understand if you
don’t have previous experience with a CMS. However, any webmaster can see that the
included administrative featuresare compelling:
• Complete management possible via a robust web interface
• Web-based management of site assets such as graphics, files, and other media
• Content approval features allow moderating of remote author postings
• Hierarchical user group management
• Automated menu management
• Content publication scheduling for automatic publishing and deletion of articles
• User security and contact management
Even more impressive is Joomla’s ability to handle content and provide interaction
with site visitors. Joomla’s content capabilitiesinclude the following:
• Multiple built-in “What You See Is What You Get” (WYSIWYG) editors
• Automatic full text search of site content
• Full support for newsfeeds in RSS or Atom format
• Built-in user polling
• Banner advertising management
• Plug-ins for e-commerce solutions,including shopping cart, picture gallery, inven-
torymanagement, and point of sale
• Multilingual internationalization features
• Accessibility options for the disabled
Finally, Joomla offers a good number of system advantages, including the following:
• Full open source license with free download of the application and source code
• Availability on all major operating systems (Windows, Mac OS, Linux)
• Page caching for improved performance

So, dont waste time and begin to get concept about it!

Published in:  on at 1:04 am Comments (3)

PHP with MySQL Database Connectivity!

I’m writing this article for those who are not familier with database connection using PHP or other language. One of my best friend Akash has told me to help him with this topic. Its a special matter. Because he is a student of Mechanical Engineering.
Though he is trying to know about the basic of HTML, CSS using Macromedia Dreamwever MX but his cursity about PHP made me surprised.

First you should know the neccessity of database. In present websites there are many kind of use of database. Such as User Login, Comment Box, Voting system, Registration form etc. When a Website is not just for browsing but also for connectivity between user and administrator of that site, then it need database.

For example: One user want to be a member of a site with his information and he will get his data back requesting them again. For this he need to be registered.
First his registration form is inserted into database with is ID. When he requests or get Login , then he can go to his page or some secured page by the verification of his information stored in database. His user ID and Password also stored in database and when he insert his ID & PASS in a login form then neccessary PHP code send this data to database and some code compare that data with stored data. When it is true then some other functions will be executed.

Requriments:
***** I want to imagine that Akash has enough idea About
1.MySQL Query
2.Functions and Logics that he used in C language previous semester
3.Executing codes

4. Database (MySQL or Oracle)
5. Web Server ( Apache or anythig)
6. PHP

(more…)

Published in:  on March 11, 2008 at 10:47 pm Comments (9)

Building Component for Joomla is Easy! Try it!

Component is similar to a module. The primary difference comes
from the user interface portions of the extension. A component can have a complete
Administrator interface, whereas a module is limited to simple parameter settings. The
interface for a component is accessible through the Components menu of the Adminis-
trator interface.

Requirements:
 1.XML file
 2.PHP/Other File

Create com_suggestionbox any where.
 In the \com_suggestionbox folder, create a file named suggestionbox.xmland enter the
following code:

XML Descriptor File:
This file contains neccessary information to give Joomla.

(more…)

Published in:  on March 8, 2008 at 4:06 pm Comments (4)