php vs asp

Discussion in 'Web Design & Coding' started by macromp, Apr 5, 2005.

  1. macromp

    macromp the retarded one

    Messages:
    426
    Location:
    UK
    i've got to do some research for a uni project, stuff about asp and php, i want to make php sound like the better option (i have no idea if it is or isn't). can anyone give me a few pointers on what to research, what php does better than asp. the person who did the coding for our project only knows php and i'm doing the research bit so he doesnt know either. help?
     
  2. xtweaker

    xtweaker Tweaking Monkey

    Messages:
    129
    Location:
    Montreal
    First thing that comes to mind is that PHP is open source, has a huge community for support and is cross-plateform.

    It's also natively meant to interface MySQL and SQL databases, and the database access functions are much simplier from what I know about it.

    And personally, I find the syntax of PHP to be much clearer than ASP and more straight-to-the-point.

    Also, you're much more likely to find free pferabs in PHP than in ASP from what I could see (free PHP utilities, and such). I guess it all depends where you search, but it just seems easier to find free code when it's in PHP.
     
    macromp likes this.
  3. Khayman

    Khayman I'm sorry Hal... Political User Folding Team

    Messages:
    5,518
    Location:
    England
    both pretty good IMO, php is a bit simpler to get started and has some better built in functions
     
  4. macromp

    macromp the retarded one

    Messages:
    426
    Location:
    UK
    awesome thanks, i'll look into those more xtweaker, what are some of the better functions khayman?
     
  5. xtweaker

    xtweaker Tweaking Monkey

    Messages:
    129
    Location:
    Montreal
  6. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    Ive never used ASP, but PHP has extensive support for different databases, contains full support for OOP in PHP5, and is an extremely fast langauge, that is suitable for everything.

    It comes builtin with not that much stuff, but once you add a few modules which almost come standard, you get built in crypto functions, sockets to connect to servers, file manipulation, regular exrpression functions, and above all, a huge community to help you out if you have a problem.
     
  7. macromp

    macromp the retarded one

    Messages:
    426
    Location:
    UK
    btw xtweaker, about the syntax thing, do you happen to have any sample code of the same thing in php and asp?
     
  8. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    ASP: Getting a Record from a Database

    PHP: Listing from a Database

    code sample for each language showing how to get information from a database. The ASP one is using Embedded Scripting which is also possible with PHP, and the PHP one is using script which generates the HTML. They are two different methods of doing the same thing. Its late right now, but tomorrow I might port the ASP example into PHP as I know PHP and not ASP.

    what can I say I got bored :p
    Here is the ASP example ported over to PHP, sorta stipped out the comments, sorry :)
    PHP:
    <HTML>
    <HEAD>
    <TITLE>PROVA ASP</TITLE>
    </HEAD>
    <BODY>
    <?php
    mysql_connect
    ('localhost','username','password');
    mysql_select_db('databasename');

    // SQL Select query
    $result mysql_query("SELECT * FROM Studenti");

    // Check if we had an error
    if (mysql_error()) {
        echo 
    "Unable to retrieve record";
    } else {
    ?>
    <div align="center">
      <center>
      <table border="1" bordercolor="#111111" width="50%" id="AutoNumber1">
        <?php
        
    while($row mysql_fetch_array($result)) {
        
    ?>
        <tr>
        <td width="25%">
        <?php echo $row['id']; ?>&nbsp;</td>
        <td width="25%">
        <?php echo $row['nome']; ?>&nbsp;</td>
        <td width="25%">
        <?php echo $row['Cognome']; ?>&nbsp;</td>
        <td width="25%">
        <?php echo $row['Data']; ?>&nbsp;</td>
        </tr>
        <?php ?>
    </table>
    <?php mysql_close(); ?>
      </center>
    </div>
    </BODY>
    </HTML>
     
    xtweaker likes this.
  9. xtweaker

    xtweaker Tweaking Monkey

    Messages:
    129
    Location:
    Montreal
    I think Geffy pretty much just did that for me ;)

    Thanks Geffy!
     
  10. macromp

    macromp the retarded one

    Messages:
    426
    Location:
    UK
    that's great geffy thanks.
     
  11. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    no prob, glad it helped