Christopher Posted September 30, 2013 Share Posted September 30, 2013 Larry, in CH10, P303: $url = 'page.php?name=' . urlencode➝ ('Elliott Smith');You only need to do this when programmaticallyadding values to a URL. When a formuses the GET method, it automatically encodesthe data. // Actually I think it should be the POST method, coz unlike GET request, POST data does not need to be encoded or decoded. P304: In the preceding example, a new versionof the view_users.php script was written.This one now includes links to the edit_user.php and delete_user.php pages,passing each a user’s ID through the URL. // I think this 'a' is a typo here(not needed). Link to comment Share on other sites More sharing options...
HartleySan Posted September 30, 2013 Share Posted September 30, 2013 Yes, the second one is definitely a typo. As for the first one, please see the following: http://stackoverflow.com/questions/6603928/should-i-url-encode-post-data Link to comment Share on other sites More sharing options...
Larry Posted September 30, 2013 Share Posted September 30, 2013 As for the first one, it should be GET. The point I'm trying to make is that when values end up in a URL through a form that uses GET, they're automatically URL-encoded. When you manually add values to a URL, you must URL-encode them yourself. Link to comment Share on other sites More sharing options...
Recommended Posts