How It Works Now let s (Cheap web hosting) take a look

How It Works Now let s take a look at cpanel.php. The Control Panel page cpanel.php is used to allow users to change their usernames and e-mail addresses. They can also see all of the articles they have written, categorized by Pending and Published articles. As always, you need to connect to the database. And, as always, conn.php takes care of that. This time, you are displaying a Web page. You load up header.php, which is your standard header for all Web display pages. require_once conn.php ; require_once header.php ; You first go out to the database and get the user s name and e-mail address. $sql = SELECT name, email . FROM cms_users . WHERE user_id= . $_SESSION[ user_id ]; $result = mysql_query($sql, $conn) or die( Could not look up user data; . mysql_error()); $user = mysql_fetch_array($result); You will be entering and exiting PHP mode throughout this file and in the other Web pages. This gives you great flexibility and makes the page a lot easier to read. The next line exits PHP code: ?> The following form uses the post method. Notice the action. You already created that file. You know that when a submit button is clicked on this page, transact-user.php loads, the appropriate code runs, and the user is redirected to the control panel.

Note the use of htmlspecialchars(). This prevents strange characters such as < or > from messing up the page. These characters will be displayed using their entity equivalents (such as < and >).

Name:
>

The rest of the form is standard HTML. Now you need to display Pending and Published articles. Time to drop back into PHP:

Email:
>

475 Building a Content Management System
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Leave a Reply