Download presentation
Presentation is loading. Please wait.
Published byKane Kingston Modified over 10 years ago
1
CHAPTER 10 COMMON PROGRAMMING TECHNIQUES
2
SENDING VALUES TO A SCRIPT Hidden form input type: Depending on the method, $_POST['do'] or $_GET['do'] will have a value "this" Recall that the GET method sends variables through the URL, so the form part can be skipped by appending the name=value pair to the URL: www.example.com/page.php?do=this
3
SENDING VALUES TO A SCRIPT Edit To append multiple values to a URL, use & between each name=value pair If a string is sent through a URL, it should be encoded for proper handling. Use the urlencode() function: $url= 'page.php?name='. urlencode('Sam Smith');
4
DELETING A USER 1.Retrieve user names and ID's 2.Display user names using a loop, but don't display user ID 3.Put a hyperlink next to each name 4.Send the current userID to the delete page in the URL : this will be a $_GET value
5
DELETING A USER - CON'T 5.Validate the userID 6.Retrieve user information 7.Display record being deleted 8.Verify deletion from user (via a form - this will have a $_POST variable set) 9.Delete the record from the database.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.