tailieunhanh - Beginning PHP6, Apache, MySQL Web Development- P16
Beginning PHP6, Apache, MySQL Web Development- P16:Welcome to Beginning PHP6, Apache, MySQL Web Development , your new trusty resource for assistance in creating your own dynamic web sites. There are a lot of technologies available that can be used to deliver great web sites, and we ’ re glad you chose the Apache/MySQL/PHP (sometimes referred to simply as AMP) approach. You may or may not have had a taste of these three components in the past, but either way we ’ re confident that you will be impressed with the power that lies within them | Chapter 13 Building a Content Management System result mysql_query sql db or die mysql_error db if mysql_num_rows result 0 row mysql_fetch_array result extract row session_start _SESSION user_id user_id _SESSION access_level access_level _SESSION name name mysql_free_result result redirect break case Logout session_start session_unset session_destroy redirect break case Create Account name isset _POST name _POST name email isset _POST email _POST email password_1 isset _POST password_1 _POST password_1 password_2 isset _POST password_2 _POST password_2 password password_1 password_2 password_1 if empty name empty email empty password sql INSERT INTO cms_users email password name VALUES . mysql_real_escape_string email db . PASSWORD . mysql_real_escape_string password db . . mysql_real_escape_string name db . mysql_query sql db or die mysql_error db session_start _SESSION user_id mysql_insert_id db _SESSION access_level 1 _SESSION name name redirect break case Modify Account user_id isset _POST user_id _POST user_id email isset _POST email _POST email name isset _POST name _POST name access_level isset _POST access_level _POST access_level if empty user_id empty name empty email empty access_level empty user_id 421 Part II Comic Book Fan Site sql UPDATE cms_users SET email . mysql_real_escape_string email db . name . mysql_real_escape_string name db . access_level . mysql_real_escape_string access_level db . WHERE user_id . user_id mysql_query sql db or die mysql_error db redirect break case Send my reminder email isset _POST email _POST email if empty email sql SELECT email FROM cms_users WHERE email . mysql_real_escape_string email db . result mysql_query sql db or die mysql_error db if mysql_num_rows result 0 password strtoupper substr sha1 time rand 0 32 8 subject Comic site password reset body Looks like you forgot your password eh No worries. . We ve reset it for you . n n body . Your new password is . .
đang nạp các trang xem trước