Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » How to make clean PHP5 websites

This thread is locked; no one can reply to it. rss feed Print
 1   2 
How to make clean PHP5 websites
Archon
Member #4,195
January 2004
avatar

I was reading up on trying to get Mono, mod_Mono and Apache 2 to work together, but it's quite a difficult endeavour because it requires extensive configuration and I'm working in the dark -- the documentation doesn't seem to work on my server and no one is responding in IRC that can help).

Now, I'm reconsidering whether to use ASP.NET or PHP5 for the 100th time.

So then I searched through this forum for mentions of ASP.NET, and I came across Simon Parzer's blog about ASP.NET and he says that ASP.NET is bad because .NET/Mono will eventually spill out messy, 'final' source code for the web pages...

But on the developers side (which I think is more important), it is very clean because the code can be placed in the back-end file and you can connect with the web page by using the IDs of HTML/ASP.NET objects.

Also, what I much like about ASP.NET is the "master page" feature... When I was making an adhoc website for myself with PHP5 not so long ago, the closest thing to doing that was with

include("php/header.php")
<-- web page -->
include("php/footer.php")

That's not quite desirable because it's means that those pages have to be half-complete and I'd need to make assumptions about those header/footer files.

*Is there any way to make PHP5 clean?
*Why would ASP.NET's automagically generated code matter?
*Is Apache Tomcat a remotely feasible solution? :-X

Another thing, people say "PHP is unstable and has bad security" and others say things like "I've heard that ASP.NET has security problems". But they don't give any specifics...

Matthew Leverton
Supreme Loser
January 1999
avatar

You can make clean PHP websites, but you'll need to invest in a framework.

Archon
Member #4,195
January 2004
avatar

Quote:

You can make clean PHP websites, but you'll need to invest in a framework.

What do you usually do for your clients?

What have you done for Allegro.cc?

Neil Walker
Member #210
April 2000
avatar

I hear good things about CakePHP (http://en.wikipedia.org/wiki/CakePHP) as a framework. But if you don't really mean a complete framework then something like the Pear (http://en.wikipedia.org/wiki/PHP_Extension_and_Application_Repository) wrapper classes might be what you want. Or if it's just a templating system then Smarty (http://en.wikipedia.org/wiki/Smarty).

For mine I just wrote my own templating/db system that does most of what I want.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

CGamesPlay
Member #2,559
July 2002
avatar

For a templating system, I recommend PHPTAL.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Kibiz0r
Member #6,203
September 2005
avatar

I use Serendipity for my blog, which uses Smarty. I've customized the templates a bit, and it does its job pretty well. No problems with it so far.

That's about all I can give you, though. I'm a fledgling web developer.

James Stanley
Member #7,275
May 2006
avatar

My website isn't exactly pretty, and it's probably offline most of the time because my router is playing up periodically, but I have a basic header written out, I simply call a function, generate_header("home page"), and it will generate a header with "home page" written across the top. You can put all sorts of information in the parameters. Same for the footer. If you're thinking of a 'commercial' style website, I'd advise against my method. I'd also advise against the commercial-style altogether as it always seems too complicated. Sites like A.cc and Google are obvious and simple, but still look nice. Sites like Maplin's have too many images, take forever to load, and are difficult to use the first time as you have no idea where anything is.
Just my thoughts.

Simon Parzer
Member #3,330
March 2003
avatar

Quote:

I was reading up on trying to get Mono, mod_Mono and Apache 2 to work together, but it's quite a difficult endeavour because it requires extensive configuration and I'm working in the dark -- the documentation doesn't seem to work on my server and no one is responding in IRC that can help).

I hope you weren't trying to use mod_mono for .NET 2.0. So far, only the 1.1 version is usable.

I've worked a lot with both ASP.NET and PHP. I made two web applications using ASP.NET and one homepage+CMS (not counting my private homepage and some small projects) using PHP.

My blog post is a bit dated now, I wrote it when I started with ASP.NET, I could only see the disadvantages and not the benefits back then. Of course the end result (HTML+JavaScript code) is much worse using ASP.NET, but especially when you consider writing a web application it saves you a huge lot of work. There is a reason behind the fact that many companies use ASP.NET.

The most impressive thing, is probably that you can make an application that displays data from a database table, allowing the user to modify, delete and add entries without writing a single line of code in ASP.NET.
To do the same thing in PHP you need a lot of knowledge about the API and whatnot. What bothers me, though, is (as already mentioned) the result of ASP.NET. When I develop a page in PHP I know what the HTML output will look like. On ASP.NET you end up with chunks of code like this, which have only one purpose: to hold the framwork together:

1<div>
2<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
3<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
4<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwMDUyNjYzMjhkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYCBRZjdGwwMCRsb2dpbiRSZW1lbWJlck1lBRxjdGwwMCRsb2dpbiRMb2dpbkltYWdlQnV0dG9uWAH/hleJpt9aXDs/v6sNs3bYQ1A=" />
5</div>
6<script type="text/javascript">
7<!--
8var theForm = document.forms['aspnetForm'];
9if (!theForm) {
10 theForm = document.aspnetForm;
11}
12function __doPostBack(eventTarget, eventArgument) {
13 if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
14 theForm.__EVENTTARGET.value = eventTarget;
15 theForm.__EVENTARGUMENT.value = eventArgument;
16 theForm.submit();
17 }
18}
19// -->
20</script>
21<script src="/blah/WebResource.axd?d=SVfXBLAoY5NJ1Aig7wagNg2&amp;t=633137390482886900" type="text/javascript"></script>
22<script src="/blah/WebResource.axd?d=acrwNDtzT6E-JYdnXViovDhgh90idtg33A7w1nLQZC81&amp;t=633137390482886900" type="text/javascript"></script>
23<script type="text/javascript">
24<!--
25function WebForm_OnSubmit() {
26if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
27return true;
28}
29// -->
30</script>

Also, if you try some of the more complex features of ASP.NET you will inevitable stumble over some bugs and quirks in the implementation (ie. concerning the ViewState). PHP in turns is pretty stable and nearly everything works as expected (I discovered a bug only once, it disappeared after upgrading to the next version of the interpreter).

To draw a conclusion, it's a matter of taste what you use. If you like WinAPI, Windows Forms or .NET you will probably choose ASP.NET. If you want to do a complex web application without thinking too much, you will choose ASP.NET (or JSP), too.

But if you want to do something from scratch, implementing the entire thing yourself, you want to use PHP. Or Perl. Or Python. Maybe Ruby. Yeah, or something else. If you want to make a homepage where most of the content is static, you don't want to use ASP.NET, because it gets in your way.
While ASP.NET implements a framework with a lot of classes, PHP only gives you the basic functions: Date/Time, DB access, DOM, XML, ... You need to know what you're doing, but you have a lot more control.

Oh, and there is always the last option: plain HTML.

Anyway, what do you want to make? A private homepage?

Archon
Member #4,195
January 2004
avatar

Quote:

Anyway, what do you want to make? A private homepage?

Yes. Although I really doubt that anyone would visit my site, I'd like to make a forum (just for the heck of it) and a news page...

Also, there would be a showcase of any games that I make or that friends make, as well as a whole set of web pages dedicated to a any single game if it is good enough which contains game info and news.

CGamesPlay
Member #2,559
July 2002
avatar

I would actually have serious reservations about doing a web site in ASP.NET simply for the reason that it has pathetic time zone support. I.e. it has none. You can shift dates by arbitrary amounts, but in terms of time zones, you can convert from local to UTC, or from UTC to local. Nothing else.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Archon
Member #4,195
January 2004
avatar

Without using a PHP framework, is there any other clean way to code in php?

Right now, I do things like:

<h1><?php print("$header"); ?></h1>

With the PHP and HTML interleaved, but none of this:

<?php print("<h1>$header</h1>"); ?>

Should I just copy + paste the header and footer code into each web page?

CGamesPlay
Member #2,559
July 2002
avatar

A system that Drupal uses, and they call it "phptemplate" works like this:

<?php
// phptemplate.php

function get_template($filename, $params)
{
    ob_start();
    include $filename;
    return ob_get_clean();
}

?>
// index.tpl
<html>
<head>
<title><?php echo $args["title"]; ?></title>
</head>
<body>
<?php echo $args["body"]; ?>
</body>
</html>

This way you can do things like this:

$pageData = get_template("pages/thread.tpl", $posts);
echo get_template("layouts/index.tpl", array("title" => "Viewing Thread", "body" => $pageData);

It's pretty versatile and allows you to keep the header and footer in one place.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Archon
Member #4,195
January 2004
avatar

I think that I may have it, thanks to Guilt in IRC.

I'm thinking that my web pages could just be like this:

<html>
    <head>
        <title>Archon's Page</title>
    </head>
    <body>
        <div id="header">
            <?php include("php/title.php") ?>
        </div>
        <div id="navigation">
            <?php include("php/nav.php") ?>
        </div>
        <div id="content">
            

All of my stuff can go here!

</div> <div id="footer"> <?php include("php/footer.php"); ?> </div> </body> </html>

I'll also have to include the css stylesheet at the top... But, it's actually a bit more stable because I don't have to create half-complete webpages, the title.php, nav.php and footer.php could be just blocks of webpages as opposed to being a necessity.

What do you all think?

BAF
Member #2,981
December 2002
avatar

That's sloppy, I personally used to use that setup and it grows very messy. You should separate logic and code. I usually use Smarty, because I can get my HTML setup and keep it separate, passing in my page data.

Also, after scrolling up in IRC, I saw a discussion on using JS/AJAX to make the site. My advise on that: don't overuse JS. Only use it where you need it, and do everything else server side.

Jonny Cook
Member #4,055
November 2003

I generally do it like that too. Not because I think it's the best, but because it's the best the I've thought of to do it. I've never been completely satisfied with any method I've used.

[edit]And by that "that" I meant the way Archon described... I think I violated some pronoun-antecedent relationship rule.[/edit]

The face of a child can say it all, especially the mouth part of the face.

Simon Parzer
Member #3,330
March 2003
avatar

I second BAF's suggestion. A template system like Smarty is just the thing you need.

It'll probably take some time to get used to, though.

piccolo
Member #3,163
January 2003
avatar

Use asp.net and vbsrcipt. I made a web aplication with easy for my job.
and i have never seen asp or .net or vbsrcit in my life.


asp.net and vbsrcipt and mysql 6.0 and IIS.
Edit: i did not even try to clean
<%@ Page CompilerOptions='/R:"C:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"' ClassName="SenderClass" Language="VB" %>

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Microsoft.Data.Odbc" %>
<HTML>
<HEAD>

<SCRIPT Language="VB" Runat="server"  >

Sub Page_Load(Source as object, e as EventArgs)

		Username.visible = "false"

	Dim sConString As String = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=serverinfo; UID=root; PASSWORD=*****; OPTION=3"
	Dim oConnection as ODBCConnection = new ODBCConnection(sConString)

	Dim sSQL as String = "SELECT * FROM servers"
	Dim oDataAdapter as ODBCDataAdapter = New ODBCDataAdapter(sSQL, oConnection)
	Dim oDataSet as DataSet = new DataSet()
	oDataAdapter.Fill(oDataSet)

	Dim sSQL2 as String = "SELECT * FROM applications"
	Dim oDataAdapter2 as ODBCDataAdapter = New ODBCDataAdapter(sSQL2, oConnection)
	Dim oDataSet2 as DataSet = new DataSet()
	oDataAdapter2.Fill(oDataSet2)

	oDataGrid.DataSource = oDataSet
	'oDataGrid.DataBind()
	If not Page.IsPostback then

		myDropDownList.DataSource = oDataSet 
		myDropDownList.DataTextField = "name" 
		myDropDownList.DataValueField = "name" 
 		myDropDownList.DataBind() 
		myDropDownList.Items.Insert(0, "") 
 		myDropDownList.Items.Insert(1, "All Servers")

		'myDropDownList.Items.Insert(1, new ListItem("All Servers", "All Servers"))  


		myDropDownList2.DataSource = oDataSet
		myDropDownList2.DataTextField = "ip" 
		myDropDownList2.DataValueField = "ip"  
		myDropDownList2.DataBind() 
		myDropDownList2.Items.Insert(0, "") 


		myDropDownList3.DataSource = oDataSet2
		myDropDownList3.DataTextField = "name" 
		myDropDownList3.DataValueField = "name"  
		myDropDownList3.DataBind() 
		myDropDownList3.Items.Insert(0, "") 


		
		Username.Text = Context.Items("Username")

	End If

 
End sub


         

 




	'Event to transfer page control to Result2.aspx
	Sub Page_Transfer(sender As Object, e As EventArgs)
		if  (Not myDropDownList.SelectedItem.Text = "") or(Not myDropDownList2.SelectedItem.Text="") or (Not myDropDownList3.SelectedItem.Text= "") then 
			Context.Items("name2") = myDropDownList.SelectedItem.Text
 			Context.Items("ip") = myDropDownList2.SelectedItem.Text
			Context.Items("Applications") = myDropDownList3.SelectedItem.Text
			Context.Items("ans3") = "name"
 			Context.Items("Username") =username.Text
			Server.Transfer("Results.aspx")
		else
			label.Text= " You have not selected an Item"
		End If
	End sub





</SCRIPT >

</HEAD>
<BODY>
<h1 align="center">Information Systems</h1>
<h1 align="center"> HW/SW Management System</h1>
<ASP:DataGrid ID="oDataGrid" Runat="server" Runat="server"/>
<h2 align="center">Search Facility </h2>


	<form runat="server">

		<p align="center"> 

		<table>

			<tr>
				<td>
					<b>Server:</b>
					<br>

					<b>IP Address:<b> 
					<br>

					<b>Applications:<b>

				</td>
				<td>
		
					<asp:DropDownList ID="myDropDownList"  Runat="server"/><br>
		
		
					<asp:DropDownList ID="myDropDownList2"  Runat="server"/><br>

		
					<asp:DropDownList ID="myDropDownList3" Runat="server"/><br>
		
				</td>	
		
		

			</tr>
		</table>
		<asp:Button Text="Search" OnClick="Page_Transfer"
			runat="server" /><br>
		<asp:label id="label" runat="server" />
		</p>	
<asp:TextBox ID="Username"  runat="server" />

	</form>


</BODY>
</HTML>


<HTML>
<HEAD>



</HEAD>
<BODY>
<h1 align="center">Information Systems</h1>
<h1 align="center"> HW/SW Management System</h1>

<h2 align="center">Search Facility </h2>


	<form name="_ctl0" method="post" action="search.aspx" id="_ctl0">
<input type="hidden" name="__VIEWSTATE" value="dDwtNTI5MDk0NTk2O3Q8O2w8aTwyPjtpPDQ+Oz47bDx0PEAwPDs7Ozs7Ozs7Ozs+Ozs+O3Q8O2w8aTwxPjtpPDM+O2k8NT47aTwxMT47PjtsPHQ8dDxwPHA8bDxEYXRhVGV4dEZpZWxkO0RhdGFWYWx1ZUZpZWxkOz47bDxuYW1lO25hbWU7Pj47Pjt0PGk8Nz47QDxcZTtBbGwgU2VydmVycztBY2Nlc3NDYXJlO0FDYXJlIC0gTmFybmlhO0FyZ2VudC1Nb25pdG9yO0RldnNlcnZpY2VzO0ZpZWxkd29ya2VyOz47QDxcZTtBbGwgU2VydmVycztBY2Nlc3NDYXJlO0FDYXJlIC0gTmFybmlhO0FyZ2VudC1Nb25pdG9yO0RldnNlcnZpY2VzO0ZpZWxkd29ya2VyOz4+Oz47Oz47dDx0PHA8cDxsPERhdGFUZXh0RmllbGQ7RGF0YVZhbHVlRmllbGQ7PjtsPGlwO2lwOz4+Oz47dDxpPDY+O0A8XGU7MTAuMi43Ny4xNjA7MTAuMi43Ny4xNzA7MTAuMS4zLjE0OzEwLjEuMy45MDsxMC4xLjMuMTU7PjtAPFxlOzEwLjIuNzcuMTYwOzEwLjIuNzcuMTcwOzEwLjEuMy4xNDsxMC4xLjMuOTA7MTAuMS4zLjE1Oz4+Oz47Oz47dDx0PHA8cDxsPERhdGFUZXh0RmllbGQ7RGF0YVZhbHVlRmllbGQ7PjtsPG5hbWU7bmFtZTs+Pjs+O3Q8aTwzPjtAPFxlO0FjY2VzcyBDYXJlO0FyZ2VudCBQcmVkaWN0b3I7PjtAPFxlO0FjY2VzcyBDYXJlO0FyZ2VudCBQcmVkaWN0b3I7Pj47Pjs7Pjt0PHA8cDxsPFRleHQ7VmlzaWJsZTs+O2w8Sk5FV1RPTkRFVlxcam5ld3RvbjtvPGY+Oz4+Oz47Oz47Pj47Pj47PkMko7mcFiUClcaGVIsGDOVK3RX6" />


		<p align="center"> 

		<table>

			<tr>
				<td>
					<b>Server:</b>
					<br>

					<b>IP Address:<b> 
					<br>

					<b>Applications:<b>

				</td>
				<td>
		
					<select name="myDropDownList" id="myDropDownList">
	<option value=""></option>
	<option value="All Servers">All Servers</option>
	<option value="AccessCare">AccessCare</option>
	<option value="ACare - Narnia">ACare - Narnia</option>
	<option value="Argent-Monitor">Argent-Monitor</option>
	<option value="Devservices">Devservices</option>
	<option value="Fieldworker">Fieldworker</option>

</select><br>
		
		
					<select name="myDropDownList2" id="myDropDownList2">
	<option value=""></option>
	<option value="10.6.77.160">10.6.77.160</option>
	<option value="10.9.77.170">10.9.77.170</option>
	<option value="10.5.3.54">10.5.3.54</option>
	<option value="10.8.3.34">10.8.3.34</option>
	<option value="10.7.3.15">10.7.3.15</option>

</select><br>

		
					<select name="myDropDownList3" id="myDropDownList3">
	<option value=""></option>
	<option value="Access Care">Access Care</option>
	<option value="Argent Predictor">Argent Predictor</option>

</select><br>
		
				</td>	
		
		

			</tr>
		</table>
		<input type="submit" name="_ctl1" value="Search" /><br>
		<span id="label"></span>
		</p>	


	</form>


</BODY>
</HTML>

wow
-------------------------------
i am who you are not am i

Matthew Leverton
Supreme Loser
January 1999
avatar

If you're just making a simple site, then don't get carried away over the elegance of it. PHP is great for simple things, regardless of how you use it. (And other than the ugly syntax you have to live with, it is great for larger things too ... if you can discipline yourself.)

If you're interested in doing at least one thing right, then I would use a template system. Personally, I never found one that I liked, so I wrote my own. So naturally, mine is the best one out there, but since it's not available, that won't help you. ;)

Smarty is probably the most widely used. I don't like it because it's so horribly written. You can not do complicated expressions because its parser is as lame as can be. For instance, you cannot put two variables through the same filter unless you first assign them to another temporary variable. (You might be able to with backticks, but at some level it breaks down...) Mine lets you do things like {(x y)|filter} to pass two variables through. Smarty has a lame math tag: {math equation="(( x + y ) / z )" x=2 y=10 z=2} With mine you can just do {(x + y) / z}, and so on. And on top of it all, Smarty is just another mini language that knows nothing about HTML...

PHPTAL does things better, but I never liked how everything was attribute defined. I cannot really comment much on it because I never used it in a project. Mine is a mix between PHPTAL and Smarty.

But regardless of your preference of template engine, you should be aiming for one thing: separating "business" code from presentation. If you can do that well, your site will be cleaner than most other PHP ones.

MiquelFire
Member #3,110
January 2003
avatar

I'm actually making a system that allows me to create a page that could be stand alone, but is really a template page in itself (it's the caller page, so to speak) and the framework will load the code for the page, and combine it with the site template (or directory, depends on my configuration in the end)

So the index page would look like this:

<html>
<head><title>Home</title></head>
<body>
<p>Welcome to my page!</p>
</body>
</html>

And the rest of the stuff in the main template looks like this:

<!DOCTYPE ...>
<html ...>
<head>
<title>Site title<!--{command to control how title strings are cancationed}--></title>
...Stylesheet(s), Javascript file(s), and any other stuff in the head tag that is used by the whole site...
</head>
<body>
...Tags for the page header...
<div id="content"><!--{mfs-body}--></div>
...Tags for the page footer...
</body>
</html>

But my system I plan on being able to grow in the long run. I just didn't want includes in my templates if it was possible. That's why I did it this way.

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

Archon
Member #4,195
January 2004
avatar

What do people say about ASP.NET?

The only unbiased problems that I've been given is that mod_mono doesn't work for 2.0 yet and the problem with timezones.

At the moment, I may give the idea that I presented a go first before truly looking at templates with PHP.

Michael Jensen
Member #2,870
October 2002
avatar

Ok, so first off, I'm biased: I'm somewhat of a microsoft fan boy. I like being able to debug my server side code, and my client-side javascript all from the IDE -- also I'm told you can debug SQL Stored Procs all from the same IDE which is mega cool, but I've only seen it done.

Quote:

I hope you weren't trying to use mod_mono for .NET 2.0. So far, only the 1.1 version is usable.

Master pages, and codeless database stuff are both only in 2.0+ so I'm guessing he does want to use 2.0.

My advice, if you're going to use ASP.NET, host it on a windows box; mono isn't production ready for web servers. It doesn't even have 2.0, and 3.0 is supposed to be comming out of beta in about six months (javascript debugging is so damn cool!), and ASP.NET AJAX isn't supported by it either (requires 2.0) -- basically you're just going to miss out on all sorts of everything badass with mono. Also, if anything bad happens on your microsoft server box, I'm to understand that microsoft covers your ass in court for legal fees up to $2M. Or was it 2B? I always get that number mixed up.

Also, it has been mentioned in this thread that the asp.net framework get's in your way for the occasional nitty gritty, but really, you can do things to tell the framework not to render (notably: me.Controls.Clear() -- it gives you a completely blank page and you can build the output yourself) -- you can even gain direct control to the page headers (not the html part, but the HTTP stuff), etc. -- IMHO you only need to do nitty gritty things occasionally or write a few functions here and there to get around all of it.

So really if you wanted access to all of the deep down dirty stuff: it's there.

Quote:

separating "business" code from presentation. If you can do that well, your site will be cleaner than most other PHP ones.

That's exactly what it comes down to. It doesn't mater if you use PHP, ASP, RUBY, etc -- write clean code. Seperate your code into tiers of Application Framework, Business, Database Logic, Presentation and you'll be coding like a pro. Writing the code isn't the hard part, it's making it clean, maintainable, documented, and killing it's bugs that's the real hard part.

piccolo: ASP.NET doesn't use VBSCRIPT -- it uses Visual Basic.NET! -- It's very different from VBSCRIPT.

Quote:

...could be just blocks of webpages as opposed to being a necessity.

Like user controls?

Quote:

and the problem with timezones.

Time Zones are a non-issue -- you just convert any local time to UTC and then offset it by the TimeZone you want -- I'm pacific, I think that's -8? So Just MyTimeInUTC.AddHours(-8) (If I remember the syntax right)... If you really wanted a class that knew if it was UTC or local, you could just write one that inherits DateTime and has a boolean, and some built in ToTimeZone(x) functions, etc.

Also, File Uploads are a breeze in .NET, server side image processing/production are easy (you have access to GDI+, alpha blending, resizing (bicubic, bilinear, nearest pixel, quality/speed settings, etc)) you have access to sockets, ping, you can dowload files from other URLs to the server in single commands, built-in ajax, web-services that serialize and desearialize .NET objects automagically/transparently -- it's all just plain amazing.

BAF
Member #2,981
December 2002
avatar

I thought ASP.NET could use C# too...

Anyway, have you ever tried to set up mod_mono? It's absolute hell. I tried to play around with it, but there is no "universal" setup like with PHP. No... you have to specify special directories for EVERY vhost (which, on my test box, wouldn't work well because I have vhost_alias setup).

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

I'm pacific, I think that's -8? So Just MyTimeInUTC.AddHours(-8)

Yeah, you think you have the timezones right, but if they change (like... this year), you have to update your code to cope. Not to mention you have to deal with time zones supporting and not supporting DST, as well as half hour time zones.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Archon
Member #4,195
January 2004
avatar

OK. I'm getting PHP5 (again) mostly because of the large range of sources and books that are available. I still really like ASP.NET though.

The problem I have is that I'm using a minimal Ubuntu set up within a virtual environment and I'm not too familiar with its workings since I run Gentoo as my primary distro (and I much prefer Gentoo to any other distribution that I've tried). The thing about Ubuntu(Debian) is that I can't seem to properly uninstall packages -- the configuration files seem to stay in the system. To make my installation 'organised' again is to start over.

bamccaig
Member #7,536
July 2006
avatar

piccolo said:

Use asp.net and vbsrcipt.

VBScript is evil! VBScript is used in ASP whereas ASP.NET uses .NET languages, such as Visual Basic .NET and C#[.NET]. I use ASP/VBScript at work right now and I hate it. Simple things don't always work and it's very unpredictable at times... However, PHP is pretty cool and I think I'd love to try ASP.NET.

 1   2 


Go to: