Secure PHP Development- P109 ppt

5 83 0
Secure PHP Development- P109 ppt

Đang tải... (xem toàn văn)

Thông tin tài liệu

Designing an E-campaign Database The e-campaign database consists of 11 tables. Figure 15-2 shows the entity relation- ship (ER) diagram for the entire e-campaign database. Figure 15-2: Entity relationship diagram for the e-campaign database Listing 15-1 shows a script that you can use to create this database in MySQL. Listing 15-1: ecampaign.sql # phpMyAdmin MySQL-Dump # version 2.2.5 # http://phpwizard.net/phpMyAdmin/ # http://phpmyadmin.sourceforge.net/ (download page) # # Host: localhost # Generation Time: Jun 07, 2002 at 09:16 PM # Server version: 3.23.35 # PHP Version: 4.1.0 # Database : `ECAMPAIGN` Continued Chapter 15: E-campaign System 511 19 549669 ch15.qxd 4/4/03 9:26 AM Page 511 Listing 15-1 (Continued) # # # Table structure for table `ASSEMBLY` # CREATE TABLE ASSEMBLY ( LIST_ID int(11) NOT NULL default ‘0’, REC_ID int(11) NOT NULL default ‘0’, FIRST varchar(255) default NULL, LAST varchar(255) default NULL, EMAIL varchar(255) NOT NULL default ‘’, AGE varchar(255) default NULL, INCOME varchar(255) default NULL, SEX varchar(255) default NULL ) TYPE=MyISAM; # # # Table structure for table `BOUNCED` # CREATE TABLE BOUNCED ( CAMPAIGN_ID tinyint(4) NOT NULL default ‘0’, LIST_ID tinyint(4) NOT NULL default ‘0’, REC_ID tinyint(4) NOT NULL default ‘0’, PRIMARY KEY (LIST_ID,REC_ID,CAMPAIGN_ID) ) TYPE=MyISAM; # # # Table structure for table `CAMPAIGN` # CREATE TABLE CAMPAIGN ( CAMPAIGN_ID int(11) NOT NULL auto_increment, NAME varchar(127) NOT NULL default ‘’, LIST_ID int(11) NOT NULL default ‘0’, MSG_ID int(11) NOT NULL default ‘0’, STATUS int(4) NOT NULL default ‘0’, PRIMARY KEY (CAMPAIGN_ID) ) TYPE=MyISAM; 512 Part III: Developing E-mail Solutions 19 549669 ch15.qxd 4/4/03 9:26 AM Page 512 # # # Table structure for table `ECAMPAIGN_EXECUTION` # CREATE TABLE ECAMPAIGN_EXECUTION ( EXEC_ID int(11) NOT NULL auto_increment, CAMPAIGN_ID int(11) NOT NULL default ‘0’, CAMPAIGN_TS timestamp(14) NOT NULL, PRIMARY KEY (EXEC_ID), UNIQUE KEY CAMPAIGN_TS (CAMPAIGN_TS) ) TYPE=MyISAM; # # # Table structure for table `LIST` # CREATE TABLE LIST ( LIST_ID int(11) NOT NULL auto_increment, NAME varchar(127) NOT NULL default ‘’, DB_HOST varchar(127) NOT NULL default ‘’, DB_USER varchar(127) NOT NULL default ‘’, DB_PASSWD varchar(127) NOT NULL default ‘’, DB_TYPE varchar(127) NOT NULL default ‘’, DB_NAME varchar(127) NOT NULL default ‘’, DB_TABLE varchar(127) NOT NULL default ‘’, LIMIT_CONDITION varchar(255) default NULL, CREATE_TS bigint(20) NOT NULL default ‘0’, CREATOR_ID int(11) NOT NULL default ‘0’, CHECK_FLAG bigint(20) NOT NULL default ‘0’, PRIMARY KEY (LIST_ID), UNIQUE KEY CHECK_FLAG (CHECK_FLAG), UNIQUE KEY NAME (NAME) ) TYPE=MyISAM; # # # Table structure for table `LIST_FIELD_MAP` # CREATE TABLE LIST_FIELD_MAP ( Continued Chapter 15: E-campaign System 513 19 549669 ch15.qxd 4/4/03 9:26 AM Page 513 Listing 15-1 (Continued) LIST_ID int(11) NOT NULL default ‘0’, REC_ID varchar(127) NOT NULL default ‘’, FIRST varchar(127) default NULL, LAST varchar(127) default NULL, EMAIL varchar(127) NOT NULL default ‘’, AGE varchar(127) default NULL, INCOME varchar(127) default NULL, SEX varchar(127) default NULL, PRIMARY KEY (LIST_ID) ) TYPE=MyISAM; # # # Table structure for table `MESSAGE` # CREATE TABLE MESSAGE ( MSG_ID tinyint(4) NOT NULL auto_increment, NAME varchar(127) NOT NULL default ‘’, BODY text NOT NULL, CREATE_TS bigint(20) NOT NULL default ‘0’, CREATOR_ID int(11) NOT NULL default ‘0’, PRIMARY KEY (MSG_ID), UNIQUE KEY NAME (NAME) ) TYPE=MyISAM; # # # Table structure for table `MESSAGE_HDRS` # CREATE TABLE MESSAGE_HDRS ( MSG_ID int(11) NOT NULL default ‘0’, HDR_ID int(11) NOT NULL default ‘0’, HDR_VALUE varchar(127) NOT NULL default ‘’ ) TYPE=MyISAM; # # # Table structure for table `TRACK` # CREATE TABLE TRACK ( 514 Part III: Developing E-mail Solutions 19 549669 ch15.qxd 4/4/03 9:26 AM Page 514 ID int(11) NOT NULL auto_increment, USER_ID int(11) NOT NULL default ‘0’, CAMP_ID int(11) NOT NULL default ‘0’, URL_ID int(11) NOT NULL default ‘0’, TRACK_TS bigint(20) NOT NULL default ‘0’, PRIMARY KEY (ID) ) TYPE=MyISAM; # # # Table structure for table `UNSUB` # CREATE TABLE UNSUB ( ID int(11) NOT NULL auto_increment, REC_ID int(11) NOT NULL default ‘0’, LIST_ID int(11) NOT NULL default ‘0’, CAMPAIGN_ID int(11) NOT NULL default ‘0’, UNSUB_TS bigint(20) NOT NULL default ‘0’, PRIMARY KEY (ID,REC_ID,LIST_ID), UNIQUE KEY REC_ID (REC_ID,LIST_ID) ) TYPE=MyISAM; # # # Table structure for table `URL` # CREATE TABLE URL ( URL_ID int(11) NOT NULL auto_increment, NAME varchar(127) NOT NULL default ‘’, URL varchar(255) NOT NULL default ‘’, PRIMARY KEY (URL_ID), UNIQUE KEY NAME (NAME) ) TYPE=MyISAM; Understanding Customer Database Requirements Each customer database that you want to use in e-campaigns must have the follow- ing data fields: Chapter 15: E-campaign System 515 19 549669 ch15.qxd 4/4/03 9:26 AM Page 515 . this database in MySQL. Listing 15-1: ecampaign.sql # phpMyAdmin MySQL-Dump # version 2.2.5 # http://phpwizard.net/phpMyAdmin/ # http://phpmyadmin.sourceforge.net/ (download page) # # Host: localhost #. page) # # Host: localhost # Generation Time: Jun 07, 2002 at 09:16 PM # Server version: 3.23.35 # PHP Version: 4.1.0 # Database : `ECAMPAIGN` Continued Chapter 15: E-campaign System 511 19 549669

Ngày đăng: 07/07/2014, 07:20

Mục lục

  • Secure PHP Development

    • Front Matter

      • Preface

        • Is This Book for You?

        • How This Book Is Organized

        • Tell Us What You Think

        • Acknowledgments

        • Contents at a Glance

        • Contents

        • Part I

          • Chapter 1: Features of Practical PHP Applications

            • Features of a Practical PHP Application

            • Employing the Features in Applications

            • Summary

            • Chapter 2: Understanding and Avoiding Security Risks

              • Identifying the Sources of Risk

              • Minimizing User-Input Risks

              • Not Revealing Sensitive Information

              • Summary

              • Chapter 3: PHP Best Practices

                • Best Practices for Naming Variables and Functions

                • Best Practices for Function/Method

                • Best Practices for Database

                • Best Practices for User Interface

                • Best Practices for Documentation

                • Best Practices for Web Security

                • Best Practices for Source Configuration Management

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan