For accessing content through a Web server, the data should be placed at the root of the Web server. In case of the Apache server, the documents for the server should be placed in the directory Ivarlwww/html/ (or any other directory specified as DocumentRoot in. Remember that all the HTML aI}.ct PHP files mentioned in this article reside at the DocumentRoot, which is the Fedora 9 system. Placing any file in Apache's DocumentRoot})ermits everyone to 'tccess the page, by accessing the server's URL.
As for the datab.ase, at least one table is required for session management to store the user names and passwords to authorise login requests. Connect to your MySQL server by using the following command:
This will prompt for the MySQL password. After providing the password, once you get the mysql prompt, you can create a database called 'session' by issuing the following command:
Following this, you can create a table to store the user name and password by issuing the following command:
which handles sessions using a cookie. For handling sessions using the database table on the server side (which we will deal with in Part 2 of this article), issue the following command at the mysql prompt:
This will create the table required to store the session information. shows the commands as issued through the MySQL command line. After creating the tables, insert at least one user into the user table. The typical command I used for the test case is as follows:
This command inserts a user named 'admin' with the password 'good', encoded using the key session. Calling decode for the password requires the same key for a correct retrieval of the password.




Reply With Quote
Copyright Techfuels
Bookmarks