Go to Post To me, FIRST is about having students realize that there IS an answer to the age old high school question: "when are we ever going to use this crap?" - Chris Hibner [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications > Website Design/Showcase
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
View Poll Results: PHP or ASP.Net?
PHP 31 81.58%
ASP.Net 7 18.42%
Voters: 38. You may not vote on this poll

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Spotlight this post!  
Unread 09-06-2003, 13:03
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Its not really a valid comparison. PHP is better than old-school ASP, but ASP.NET is an enterprise-capable framework for distributed applications. Its competitor is J2EE, not PHP so much. I can see why you would like PHP over ASP.NET, but there are some killer development tools available for .NET. For the last few years I've been working on a product in VB that uses ASP as the presentation layer. The improvements in .NET are unreal, but ASP still has a place for simple web sites.

Heres an implementation of echo for ASP:
Code:
<%@ Language=VBScript %>

<SCRIPT LANGUAGE="Javascript" RUNAT="SERVER">
	
	var ECHO_TOKEN = '%d';
	
	//-------------------------------------------------------------------------
	// FUNCTION:	echo	
	// PURPOSE:	Writes a message to the Response stream that contains
	//		embedded data elements to avoid concatenation.
	// ARGUMENTS:	text -	message string to output. embedded tokens
	//			will be replaced by the non-formal arguments
	//			passed to the function at runtime, in order.
	//-------------------------------------------------------------------------
	function echo(text)
	{
		_echoHelper(text, ECHO_TOKEN, echo.arguments);
		return;
	}		
	
	//-------------------------------------------------------------------------
	// FUNCTION:	echobr	
	// PURPOSE:	Writes a message to the Response stream that contains
	//		embedded data elements to avoid concatenation, with an 
	//		extra break tag at the end.
	// ARGUMENTS:	text -	message string to output. embedded tokens
	//			will be replaced by the non-formal arguments
	//			passed to the function at runtime, in order.
	//-------------------------------------------------------------------------
	function echobr(text)
	{
		_echoHelper(text, ECHO_TOKEN, echobr.arguments);
		Response.Write('<BR>');
		return;
	}			

	//-------------------------------------------------------------------------
	// FUNCTION:	_echoHelper
	// PURPOSE:	Parses a string and replaces token values with elements
	//		in the args array in order. Index 0 of the array is not
	//		included. Performs operation without concatenations.
	// ARGUMENTS:	text -	message string to output. embedded tokens
	//			will be replaced by the non-formal arguments
	//			passed to the function at runtime, in order.
	//		token -	replacable string
	//		args -	array of values to insert into text
	//-------------------------------------------------------------------------
	function _echoHelper(text, token, args)
	{
		var start = 0;
		var finish;
		var i;
				
		for (i=1; i<args.length; i++)
		{			
			finish = text.indexOf(token, start);			
			if (finish >= 0) 
			{
				Response.Write(text.substring(start, finish));				
				Response.Write(args[i]);
				finish = finish + 2;
				start = finish;						
			}
		}
		Response.Write(text.substring(start, text.length));
		return;
	}	
</SCRIPT>


<HTML>
<HEAD>
</HEAD>
<BODY>

<%	dim ip: ip = Request.ServerVariables("REMOTE_ADDR")

	echo "This page was requested on %d from IP %d at %d", Date(), ip, Time()	
%>

</BODY>
</HTML>
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Learning PHP Leon Machado IV Website Design/Showcase 15 20-08-2003 08:03
FREE web design, php, and 3ds max classes Jeremy_Mc General Forum 0 31-01-2003 15:42
php vs. perl Jack Website Design/Showcase 20 29-12-2002 17:01
PHP File Uploading Scripts Ian W. Chit-Chat 15 15-09-2002 17:41
What's better, PERL/cgi or PHP/my_sql? mikefrei Programming 10 27-05-2002 22:50


All times are GMT -5. The time now is 06:01.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi