[thelist] Server-side processing comparative anatomy.

Joe Crawford jcrawford at avencom.com
Thu Jun 7 14:21:48 CDT 2001

Here's three ways to do the same thing - encode a string so it can be
passed in a url. It's kind of neat to see how similar the
server-processed languages all are. I threw in a client-side version as

<!-- in ASP, save as url.asp -->
<form action="url.asp" method="get">
<input name="x" type="text">
<% Response.write(Server.URLEncode(Request.QueryString("x"))) %>

<!-- in Cold Fusion, save as url.cfm -->
<cfparam name="x" default="">
<form action="url.cfm" method="get">
<input name="x" type="text">

<!-- in PHP, save as url.php -->
<form action="url.php" method="get">
<input name="x" type="text">
<? echo rawurlencode($x); ?>

<!-- and for fun, a client side version in JavaScript -->
<form onsubmit="return false;">
<input name="x" type="text">
<input type="button" value="URL Encode It!"
<input name="y" type="text">

... sometimes the best reason to do something is for no reason at all.

	- Joe <http://artlung.com/>
Joe Crawford ||||||||||||||       mailto:jcrawford at avencom.com
||||||||||||||||||||||||             http://www.avencom.com
|||||||||||||||||||||||||||      Avencom: Set Your Sites Higher

More information about the thelist mailing list