Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > Script Languages

Script Languages Perl/PHP/Python/Ruby so on and so forth.

Reply
 
Thread Tools Display Modes
Old 08-24-2006, 06:46 PM   #1 (permalink)
Forum Expert
 
Kenny164's Avatar
 
Join Date: Sep 2004
Location: Ballymena, Northern Ireland
Age: 23
Posts: 464
Send a message via MSN to Kenny164
Default Python or PHP? (Web Framework)

Well, the time has come to write my own thread .

I'm just wondering if anyone has had much experience with Python based web frameworks such as Django, CherryPy, TurboGears, etc?

I don't know if i should stick with the normal PHP set up. I wish to run a simple CMS (they all seem like overkill to me), however I am looking for certain features:
  • User auth - Gonna try and sync web users with RunUO users (check char stats on their profile)
  • Templates with CSS - I've got my site layout already coded
  • Scriptable - To integrate RunUO stats (and future projects, maybe an admin section can shutdown/save the server, etc)
So, does anyone have any recommendations? I dont even know which framework to work on, PHP seems the most popular (but oldest), if i do decide to run a python based framework, I think I'll need Cherrypy to run with my webserver (Lighttp) with Fast_cgi.

I've a newbie to this sorta stuff (as you can probably tell) and I'm just looking for some opinions.

Thanks for reading!
__________________
Use the middle mouse button on Here for forum rules, if nothing happens get firefox and try again!!!
Kenny164 is offline   Reply With Quote
Old 08-24-2006, 11:10 PM   #2 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

A piece of advice: go with PHP.

It's stable like a rock, has broad community support.

I'm a big python fan, don't get me wrong. I use it to develop a lot of my prototype algorithms at work and for experiments with things at home.

You won't be sorry with PHP,

If you're into RunUO, you might also think about ASPs with C#. I haven't done those, but I'm sure that they would compliment your developing skill set.

C//
Courageous is offline   Reply With Quote
Old 08-24-2006, 11:49 PM   #3 (permalink)
Master of the Internet
 
TMSTKSBK's Avatar
 
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
Default

ASP.NET is evil. If you're developing, and already know C# well, you might look at that. Otherwise, I would echo Courageous, and say PHP 4tw.
__________________
Goodbye, folks.
TMSTKSBK is offline   Reply With Quote
Old 08-25-2006, 06:07 AM   #4 (permalink)
Forum Expert
 
Join Date: Jul 2005
Location: Istanbul/Turkey
Age: 27
Posts: 425
Default

I would say if you are experienced with J2EE, use AppFuse (WebWork as UI framework) but it looks like your project will not necessarily need lots of feature and stuff there.

Go with ASP.NEt or PHP.
__________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
noobie is offline   Reply With Quote
Old 08-25-2006, 03:28 PM   #5 (permalink)
Forum Expert
 
Kenny164's Avatar
 
Join Date: Sep 2004
Location: Ballymena, Northern Ireland
Age: 23
Posts: 464
Send a message via MSN to Kenny164
Default

Thanks for your thoughts, I think I'll just go ahead with PHP then.

I dont know if i should write my own simple CMS (trust me, it'll be VERY simple) in php using some kinda of framework such as Zend or CakePHP (haven't really looked at them yet). Or should I use a fully made engine such as drupal?
__________________
Use the middle mouse button on Here for forum rules, if nothing happens get firefox and try again!!!
Kenny164 is offline   Reply With Quote
Old 08-25-2006, 07:10 PM   #6 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

Well, if you're going to go straight into CMS, I suggest you look at the latest Plone. Particularly if you already know Python.

If you're going to dabble with custom content production of your own, PHP will be much better. But if what you want is a full CMS suite, go the Plone route. You won't be sorry.

Anyway, if you have or can get your own Apache going, it's like a right of passage to install modphp, and do a little php'ing. So maybe you should do this anyway, just for fun, you know?

C//
Courageous is offline   Reply With Quote
Old 08-25-2006, 11:47 PM   #7 (permalink)
Master of the Internet
 
TMSTKSBK's Avatar
 
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
Default

I <3 the Apaches.
I also <3 the PHPs.
I also also <3 the MySQLs...
__________________
Goodbye, folks.
TMSTKSBK is offline   Reply With Quote
Old 08-26-2006, 04:16 PM   #8 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

But the question is, do you also <3 the Linuxs?
Sep102 is offline   Reply With Quote
Old 08-26-2006, 09:41 PM   #9 (permalink)
Account Terminated
 
Join Date: Jun 2004
Location: Cincinnati, Ohio
Age: 20
Posts: 3,954
Default

Ruby Ruby Ruby. Or since you're looking for web dev, Ruby on Rails!

Last edited by WarAngel; 08-26-2006 at 09:46 PM.
WarAngel is offline   Reply With Quote
Old 08-26-2006, 10:28 PM   #10 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

Ruby's not bad. But really. The python community is much larger, and support is often an issue with these things.

C//
Courageous is offline   Reply With Quote
Old 08-26-2006, 10:52 PM   #11 (permalink)
Account Terminated
 
Join Date: Jun 2004
Location: Cincinnati, Ohio
Age: 20
Posts: 3,954
Default

Ruby is growing at an exponential rate. Compare the community size five years ago to the community size today and the growth is just rediculous. Python wins for now... but give Ruby a little more time. ;D

Nice to see you posting again Courageous. I always enjoy reading your posts.
WarAngel is offline   Reply With Quote
Old 08-29-2006, 09:43 PM   #12 (permalink)
Forum Expert
 
Kenny164's Avatar
 
Join Date: Sep 2004
Location: Ballymena, Northern Ireland
Age: 23
Posts: 464
Send a message via MSN to Kenny164
Default

Thanks for all your replys .

I have went ahead with PHP and came out with a script... I'm just wondering if i'm going in the right direction. The index.php takes arguments (I googled some 'PHP Templating' articles) to what static page should be shown... such as index.php?p=infoContact will show the site with Contact me in the content section (if that makes sense)... In fact, i'll post code:

index.php:
Code:
<?PHP /* index.php */
require 'includes/db_connect.php';
if (isset($_GET['p']) == True) {
    $pageName=$_GET['p'];
} else {
    $pageName='home';
}
include('content/'.$pageName.'.php');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<?php if ($pageName == 'home'){echo '<title>Kenny\'s Krib</title>';}else{echo '<title>Kenny\'s Krib: '.$pageTitle.'</title>';} ?>
<link rel="stylesheet" href="pk1.css" type="text/css" />
</head>
<body>

<div id="main">
    <div align="center">
        <a href="./"><img src="images/KKrib-title.png" width="865" height="142"></a>
    </div>
        
    <div style="float: left; width: 12%;">    
        <?php include('indexMenu.php'); ?>
    </div>

    <div>
        <div ID="content">
            <h2><?php echo $pageTitle; ?></h2>
            <br>
            <h3><?php echo $pageContent; ?></h3>
        </div>
    </div>

    <div id="footer">
        <i>Copyleft &copy; KKrib 2006</i>
    </div>
</div>

</body>
</head>
</html>
and a sample section (eg p = woteva)

content/infoContact.php:
Code:
<?PHP /* home.php */
$pageTitle = "Contact me";
$pageContent = "
You may contact me at any time using one of these methods:
<ul>
    <li>ICQ: 64045040</li>
    <li>MSN or EMAIL: peter.kinney-at-btinternet.com</li>
    <li>Yahoo: PeterK_Dec98</li>
    <li>UO: KnightShade (UODreams.it) </li>
</ul>
<p align=\"center\"><img src=\"images/uosig2.png\" width=\"400\" height=\"250\"></p>
";
?>
Now i'm just wondering, will i be able to display content without pulling it in from a variable? (ie. $PageContent). the reason being, i wish to use more dynamic pages.

Here's a simple sample of what i've done: http://petkin.freehostia.com/KKrib1/ u can use test/test to login.

Thanks in advance, and sorry for bumping!
__________________
Use the middle mouse button on Here for forum rules, if nothing happens get firefox and try again!!!

Last edited by Kenny164; 08-29-2006 at 09:59 PM.
Kenny164 is offline   Reply With Quote
Old 08-30-2006, 10:58 AM   #13 (permalink)
Forum Expert
 
arul's Avatar
 
Join Date: Jan 2005
Location: Hic sunt leones ...
Age: 21
Posts: 1,279
Send a message via MSN to arul
Default

Good start, but your implementation has more holes than emental cheese

Several articles on SitePoint should shine more light on this issue, for example http://www.sitepoint.com/article/php-security-blunders
__________________
Angels are falling the very last time, down they're burning in hate and decline, unfaithful and violent we're breaking the spell, we're god, we're scissor, in heaven and hell!
arul is offline   Reply With Quote
Old 08-30-2006, 11:31 AM   #14 (permalink)
Forum Expert
 
Kenny164's Avatar
 
Join Date: Sep 2004
Location: Ballymena, Northern Ireland
Age: 23
Posts: 464
Send a message via MSN to Kenny164
Default

Quote:
Originally Posted by arul
Good start, but your implementation has more holes than emental cheese

Several articles on SitePoint should shine more light on this issue, for example http://www.sitepoint.com/article/php-security-blunders
Yeah, I'm kinda newbie to PHP. Thanks for the link

I'm just wondering though, to display other pages such as the 'Contact Admin' (only link that works btw, heh).

The link goes to index.php?p=infoContact... which pulls the content from a variable stored in /content/infoContact.php. This is good for serving up static pages with no scripts.

But what if i want to run php code thats stored on another page?

For example, If i want a news section (or my Patch log). Which I should update when I make changes to the RunUO server, I'm going to make it load entrys from a MySQL database.

Should I create another PHP script such as Patches.php, and not use the index.php?p= ?

Thanks again.
__________________
Use the middle mouse button on Here for forum rules, if nothing happens get firefox and try again!!!
Kenny164 is offline   Reply With Quote
Old 08-31-2006, 11:35 AM   #15 (permalink)
Forum Expert
 
Join Date: Jan 2004
Age: 30
Posts: 880
Default

This does not look like much of a CMS to me, it looks more of just a way to show all your pages off of one URL. If your manually creating all the included content pages, why not just link to the content pages themselves and instead include headers and footers. If there's no dynamic data and your editing the files by hand then there really is no need to try and simulate a CMS.

The purpose of a CMS is so that the user never needs to get their hands dirty in the code or have to manually create internal pages (such as your doing now with your include/contents/page system).

As has been echoed by arul, you do have security problems in your current design. For starters your not doing any sanity checks on the GET data, this could lead to some troubles, especially with exposing your server structure.

My advice would be to pick up a real CMS application, I find Wordpress to be very friendly, easy to install and not that large (in my opinion). There are others equally good but definately more involved such as Joomla/Mambo, PHPNuke and others.

I hope this advice is welcomed.
__________________
--BeTrayed / The Dev

http://www.gamemusketeers.com
http://www.wecentral.com
BeTrayed is offline   Reply With Quote
Old 06-23-2007, 02:13 AM   #16 (permalink)
Forum Novice
 
Join Date: Oct 2005
Posts: 142
Default

Wow, everyone pretty much said it.

The reason PHP is so popular is because it's particularly easy to use. Someone with practically no programming history can pick it up, and if you pick at it long enough and hit the documentation you can figure every part of the code out.

It also integrates very easily with databases. Up until recently, the only way I knew to send or retrieve data from a SQL database from a program was to open an external PHP page and do the work through that. Thank god for .NET 3.0!!

You can also find an incredible amount of documentation and coding already done in PHP, so if you're just starting out in web framework you'll have more specific support (PHP is intended for web-work).

Hope I helped!
Shadow-Sigma is offline   Reply With Quote
Old 07-25-2007, 10:12 AM   #17 (permalink)
Account Terminated
 
Join Date: Mar 2007
Posts: 58
Default

Yep php all the way. Stay away from the MS rip offs of it like asp and such. I've had to work based off existing asp /.net stuff and its the most messy and horrid thing to work with. php is simple, powerful, and based on free/open source software.
quantomsadmn is offline   Reply With Quote
Old 08-01-2007, 03:57 PM   #18 (permalink)
Newbie
 
Join Date: Oct 2004
Location: Charleston, SC
Age: 27
Posts: 37
Send a message via ICQ to LightShade Send a message via AIM to LightShade
Default

Apache/PHP/MySQL

Perhaps mirroring it in ASP.NET for those M$ supporters...though I use PHP/MySQL/Apache...and this is even after coding for strictly M$ webservers and whatnot for years for work.
LightShade is offline   Reply With Quote
Old 08-03-2007, 10:19 PM   #19 (permalink)
Newbie
 
Kyla's Avatar
 
Join Date: Mar 2004
Posts: 15
Default

Find a nice CMS your happy with that allows you to fairly easily create Components/Modules for it such as Joomla, GeekLog, Drupal and such.

If you really really want to go python go Zope and take a look at some of their CMS Modules, then add your own programmed content into it.

Of the two, I say go with what your most familiar with.

Here's a site, deals mostly with PhP and Security, but the general practices are good regardless of language.

PHP Security Consortium

~K
Kyla is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5