Jump to content
Larry Ullman's Book Forums

Ch10, P303, P304 Two Possible Typos


Recommended Posts

Larry,

 

in CH10, P303:

 

$url = 'page.php?name=' . urlencode
➝ ('Elliott Smith');
You only need to do this when programmatically
adding values to a URL. When a form
uses the GET method, it automatically encodes
the 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 version
of 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

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

 Share

×
×
  • Create New...