« Home « Chủ đề thiết kế web với php

Chủ đề : thiết kế web với php


Có 240+ tài liệu thuộc chủ đề "thiết kế web với php"

Phát triển web với PHP và MySQL - p 44

tailieu.vn

We’ll begin by looking at a very simple image creation script. This script is shown in Listing 19.1.. L ISTING 19.1 simplegraph.php —Outputs a Simple Line Graph with the Label Sales. We’ll walk through the steps of creating this image one by one.. To begin building or changing an image in PHP, you will need to create an image identifier.....

Phát triển web với PHP và MySQL - p 45

tailieu.vn

ImageCreateFromGIF() functions in the same way if the appropriate support is installed.. To save the image to a file or output it to the browser, we must call the ImagePNG() function.. We’ll come to that in a minute, but we have other work to do with our image first.. Fitting the Text onto the Button. We have some text typed...

Phát triển web với PHP và MySQL - p 66

tailieu.vn

case ‘select-account. ‘account-setup’;. ‘log-out’;. if(!check_auth_user. echo “<P>You need to log in”;. if($action&&$action!=’log-out’). echo “.<br><br>”;. deleted an account, show account setup page. case ‘store-settings. case ‘account-setup. case ‘delete-account. display_account_setup($auth_user);. case ‘send-message. if(send_message($to, $cc, $subject, $message)) echo “<p>Message sent.<br><br><br><br><br><br>”;. echo “<p>Could not send message.<br><br><br><br><br><br>”;. case ‘delete. case ‘view-mailbox. case ‘show-headers. case ‘hide-headers’. L ISTING 27.2 Continued. case ‘view-message. $fullheaders = ($action==’show-headers’);. case...

Phát triển web với PHP và MySQL - p 67

tailieu.vn

L ISTING 27.5 store_account_settings() Function from mail_fns.php—Function to Save New Account Details for a User. echo “All fields must be filled in. Try again.<br><br>”;. if($settings[‘account’]>0). $query = “update accounts set server = ‘$settings[server. port = $settings[port], type = ‘$settings[type. remoteuser = ‘$settings[remoteuser]’,. remotepassword = ‘$settings[remotepassword]’. echo “could not store changes.<br><br><br><br><br><br>”;. As you can see, two choices within this function correspond...

Phát triển web với PHP và MySQL - p 68

tailieu.vn

Next, we call the display_message() function. It calls the retrieve_message() function to get the appropriate message from the mailbox:. The retrieve_message() function is in the mail_fns.php library. You can see the code for it in Listing 27.10.. L ISTING 27.10 retrieve_message() Function from mail_fns.php—This Function Retrieves One Specific Message from a Mailbox. $message[‘body. if(!$message[‘body’]). $message[‘fullheaders. $message[‘subject. $header->subject;. $message[‘fromaddress. $header->fromaddress;. $message[‘toaddress....

Phát triển web với PHP và MySQL - p 69

tailieu.vn

In this chapter, we will implement a front end for a mailing list manager (or MLM). We will call our system Pyramid-MLM.. Users will be able to subscribe to any of the lists at our site and select whether to receive newsletters in text or HTML.. This system should allow various newsletters to be created and sent to users, and...

Phát triển web với PHP và MySQL - p 70

tailieu.vn

‘account-settings’;. else if(check_admin_user. if not logged in at all. ‘new-account’;. only these actions can be done if not logged in switch ( $action. case ‘new-account. case ‘store-account. case ‘log-in. case ‘show-all-lists. display_items(“All Lists”, get_all_lists. case ‘show-archive. display_items(“Archive For “.get_list_name($id),. case ‘information. //all other actions require user to be logged in if(check_logged_in()). case ‘account-settings. case ‘show-other-lists. case ‘subscribe. display_items(“Subscribed Lists”, get_subscribed_lists(get_email()),....

Phát triển web với PHP và MySQL - p 71

tailieu.vn

L ISTING 28.3 Continued else. echo “<p>Sorry, that email address is already registered here.”;. echo “<p>You will need to log in with that address to change. return false;. echo “Could not store new account.<br><br><br><br><br><br>”;. This function first checks that the user has filled in the required details.. If this is okay, the function will then either create a new user,...

Phát triển web với PHP và MySQL - p 72

tailieu.vn

L ISTING 28.8 Continued. $info = load_list_info($listid);. echo “<h2>”.pretty($info[listname]).”</h2>”;. echo ‘<p>’.pretty($info[blurb]);. echo ‘<p>Number of subscribers. echo ‘<p>Number of messages in archive. the load_list_info() function and the pretty() function. The load_list_info() function actually retrieves the data from the database. This function is in the mlm_fns.php function library. The code for it is shown in Listing 28.9.. L ISTING 28.9 load_list_info() Function...

Phát triển web với PHP và MySQL - p 73

tailieu.vn

L ISTING 28.13 Continued. This function performs a few validation checks before writing to the database: It checks that all the details were supplied, that the current user is an administrator, and that the list name is unique. If all goes well the list is added to the lists table in the database.. The administrator will see the form shown...

Phát triển web với PHP và MySQL - p 74

tailieu.vn

echo “There is nobody subscribed to list number $listid”;. include(‘class.html.mime.mail.inc’);. read in the text version. read in the HTML version. echo “<p>Unable to get image list from database.”;. add images to the mimemail object. add HTML and text to the mimemail object. //send the HTML version of the message to administrator. //send the text version of the message to administrator....

Phát triển web với PHP và MySQL - p 75

tailieu.vn

There are three main parts of the blah-blah forum system.. A summary of the files in this application is shown in Table 29.1.. T ABLE 29.1 Files in the Web Forum Application. index.php Application The main page users will see when they enter the site. Contains an expandable and collapsible list of all the articles on the site.. new_post.php Application...

Phát triển web với PHP và MySQL - p 76

tailieu.vn

L ISTING 29.5 treenode Class from treenode_class.php—The Backbone of the Application. displaying the tree are in this file class treenode. each node in the tree has member variables containing. all the data for a post except the body of the message var $m_postid;. importantly recursively creates lower parts of the tree. $this->m_postid = $postid;. $this->m_title = $title;. $this->m_poster = $poster;....

Phát triển web với PHP và MySQL - p 77

tailieu.vn

http://webserver/chapter29/new_post.php?parent=5. The parameter passed in as parent will be the parent postid of the new posting. If you click New Post instead of Reply, you will get parent=0 in the URL.. Second, you will see that for a reply, the text of the original message is inserted and marked with a “ >. Third, you can see that the title...

Phát triển web với PHP và MySQL - p 78

tailieu.vn

The most important decision we need to make is what format to deliver the certificate in.. We do not need to worry about software or bandwidth, and the certificate could be printed with anti-counterfeiting measures.. The simplicity of the end result will make it very easy to design and very quick for a script to generate.. We have no control...

Phát triển web với PHP và MySQL - p 79

tailieu.vn

index.html asks the user to answer quiz questions.. When the user submits his answers to the questions in index.html , we need to grade him and calculate a score. This is done by the script called score.php . The code for this script is shown in Listing 30.2.. L ISTING 30.2 score.php—Script to Mark Exams. echo “<h1><p align = center><img...

Phát triển web với PHP và MySQL - p 80

tailieu.vn

http://www.php.net/manual/ref.pdf.php. for an overview, installation instructions, and the PDFlib documentation, available as the file PDFlib-manual.pdf in the PDFlib distribution, for a detailed reference on the API.. $fp = fopen(“hello.pdf”, “w”);. pdf_set_info($pdf, “Creator”, “pdftest.php”);. pdf_set_info($pdf, “Author”, “Luke Welling and Laura Thomson”);. pdf_set_info($pdf, “Title”, “Hello World (PHP)”);. pdf_add_outline($pdf, “Page 1”);. pdf_set_font($pdf, “Helvetica-Bold”, 24, “host”);. pdf_show($pdf,”Hello,world!”);. echo “download the pdf <a href =...

Phát triển web với PHP và MySQL - p 81

tailieu.vn

We will look at some of the parts of this script that are different from the previous examples.. Visitors need to get their own details on a certificate, so we will create the document in mem- ory rather than in a file. If we wrote it to a file, we would need to worry about mechanisms to create unique filenames,...

Phát triển web với PHP và MySQL - p 82

tailieu.vn

Change to the directory that you have stored the source files in, for example. Extract the files using the following command:. gunzip -c mysql-3.22.xx.tar.gz | tar xvf. Change to the new directory. cd mysql-3.22.xx. Now you can start configuring the MySQL server. You can specify many options with the. If you have any errors, you can check the config.cache file...

Phát triển web với PHP và MySQL - p 83

tailieu.vn

To test whether or not MySQL is working, you can execute the following commands:. The mysql database will be used for storing the permissions and access to the server. If you need more information, please refer to the MySQL Web site, http://www.MySQL.com . Apache 1.3 and later is designed to run on Windows NT 4.0 and Windows 2000. It is...