CONNECTIONS: web application

User registration (already discussed) User login (already discussed) Send Message Inbox Out Box Sign-Out

pptx31 trang | Chia sẻ: dntpro1256 | Lượt xem: 553 | Lượt tải: 0download
Bạn đang xem trước 20 trang tài liệu CONNECTIONS: web application, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
CONNECTIONS: web applicationBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.1Summary of the previous lectureDeleting records in MySQL using PHPUpdating records in MySQL using PHPBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.2OutlineUser registration (already discussed)User login (already discussed)Send Message InboxOut BoxSign-OutBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.31. User registrationUser registration form:Home pageAction page:Retrieve user’s inputValidate inputConnection with DBInsert record into users tableBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.42. User loginUser login form:Home pageAction page:Retrieve user’s inputConnection with DBSelect record from users table where user email and password are same as user’s inputBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.52. User loginIf one row is selected then:Session variables are registered$_SESSION[‘name’];$_SESSION[‘email’];$_SESSION[‘password’];Redirect to user’s pageRedirect to index page with error messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.63. Send messageCreate a table in connections database as:Table Name: messagesNo. of fields: 4message_Id int 5s_Email varchar 50r_Email varchar 50message varchar 500Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.73. Send messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.8Table fields3. Send messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.9Form to send message:Receiver email: data-list of users Message: text-areaSubmit buttonAction page:Retrieve receiver email and message from post arrayRetrieve sender email from $_SEESION[‘email’]Insert data into messages table3. Send messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.10Session startsDB connectionHTML page starts3. Send messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.11headerlinks3. Send messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.12Form startsFirst row shows the message from action page3. Send messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.13List attributeInput fieldDatalist startsSelects usersLoop startsSets options Loop endsDatalist ends3. Send messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.14Textarea for messageSubmit buttonForm ends3. Send messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.15Footer div3. Send messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.16headeractionsformfooter3. Send messageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.17Session startsSender’s email from sessionUser’s input DB ConnectionInsertion InstructionQuery executedredirection4. Inbox pageSession startsDB connectionRetrieve receiver id from sessionSelect messages against user’s idDisplay structureDisplay all messagesBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.184. Inbox pageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.19Session startsDB connectionCSS is included4. Inbox pageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.20Header and logoAction box4. Inbox pageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.21User’s idMessages received by userInstruction executedMessage is fetchedSender’s information4. Inbox pageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.22Sender’s pictureSender’s emailmessageLoop endsFooter 4. Inbox pageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.23Sender picmessage5. Outbox pageSession startsDB connectionRetrieve receiver id from sessionSelect messages sent against user’s idDisplay structureDisplay all messagesBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.245. Outbox pageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.25Messages sent by the userMessages are fetchedReceiver’s info5. Outbox pageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.26Messages are displayed5. Outbox pageBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.276. Sign-OutBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.28Starts sessionDestroy sessionRedirect 6. Sign-OutBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.29Session startsSession destroysredirectionSummaryUser registration (already discussed)User login (already discussed)Send Message InboxOut BoxSign-OutBasharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.30References Chapter 30, “Beginning PHP and MySQL” by W. Jason Gilmore, Apress publisher, 4th edition; 2010, ISBN-13 (electronic): 978-1-4302-3115-8.Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan.31

Các file đính kèm theo tài liệu này:

  • pptxlec32_connections_6943_2026980.pptx
Tài liệu liên quan