#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    4
    Rep Power
    0
    Ok...is PHP the same as perl or javascript
    (only asking... )

    Lynne
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    Alkmaar, The Netherlands
    Posts
    123
    Rep Power
    15
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Lynne:
    Ok...is PHP the same as perl or javascript
    (only asking... )

    Lynne
    [/quote]

    Nope, else it would be called Perl or Javascript wouldn't.

    Javascript is a scripting language mainly used on the client side (it can be used on the server side as well though). Perl is a language mainly used for CGI-scripts. PHP is also a scripting language, but gets parsed by the server (like ASP). Right now PHP is considered the best scripting language there is because of its very good interfaces with databases among a lot of other great features.

    One other big advantage is the ever growing community on the net that is using PHP (like this forum), so there are a lot of nice people willing to help you out in case of problems


    ------------------
    Good luck,
    Bas

    ------------------
    E-mail me at: b.vandermeijden@pecoma.nl
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    36
    Rep Power
    15
    JavaScript kicks a$$.
    And I haven't found anything yet that Perl can do and Php can't. So Perl seems to be useless if you're using Php. If there is a reason perl is used over php, I would love to know. I've been using all three for a while now and have found no reason to go back to Perl since I found Php.

    ------------------
    -Gabe
    "Save trees, eat beaver."
    "y!php3++?"
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    2
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>JavaScript kicks a$$.
    [/quote]

    I personally don't care for it much. It might not be so bad, but like any client-side scripting language, you simply can't depend on it. Rewriting code to work around differences in browsers, as well as the fact that users can disable it entirely, makes Javascript useful only for 'convenience' features.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>
    So Perl seems to be useless if you're using Php. If there is a reason perl is used over php, I would love to know
    [/quote]

    Well, I'll let a more knowledgable Perl hacker rail against you on this one, but there are a few things that help Perl out.

    - It's everywhere. There's so much code out there isn't not even funny - just take a look at CPAN. This is actually pretty important.

    - It's a little better integrated for shell scripting type stuff. PHP seems to be geared toward web development (which it is great at, IMHO).

    - I don't know about you, but when I started doing PHP stuff, I really missed being able to do the following:

    $varname = qq~
    This is "quoted" text, as is 'this'. In "PHP", I'd have to escape a lot of this stuff.
    ~;

    ...but really, PHP seems to me to be equivelent to Perl in a lot of ways. I guess you can even turn it around - what can PHP do that Perl can't? Probably nothing. The main difference is that you can do it easier if you're a beginner - which is never a bad thing.


    ------------------
    - Jeff A. Campbell
    - VelociNews.com
    - "Free newspages for your
    web site!"
  8. #5
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    Darchmare -
    "I personally don't care for it much. It might not be so bad, but like any client-side scripting language, you simply can't depend on it. "

    The other client-side scripting languages are? are? x-browser it is the ONLY realistic scripting language. Plus it is the browsers not the script that are unreliable!

    As I think I have mentioned before in this place - to anybody who may be deciding between PHP and PERL (although you can combine them ,sglane was spot on though!)
    look at a page of PHP then a page of PERL (the PHP one will be legible and shorter) then decide - it will not be hard.

    PHP will do almost anything PERL can and vice-versa, but PHP with its incredible ease of use, begginner or otherwise, and easy connectivity to all major (and minor) datasources, speed ,,,,, etc etc.

    And what exactly happens to 'quoted' text when PERL adds it to a database? addslashes($str) - its not that hard is it?

    Simon

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    2
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>
    And what exactly happens to 'quoted' text when PERL adds it to a database? addslashes($str) - its not that hard is it?
    [/quote]

    It's not the database insertions that I'm complaining about, it's assigning text to a variable or printing it outright. It's a small thing, sure, but it's nice to use other delimiters for stuff (esp. if you are manipulating a lot of HTML).
  12. #7
  13. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    PHP4 now supports here. The operator I believe is >>>

    Of course, not being embedded, Perl requires this feature more than PHP.
  14. #8
  15. No Profile Picture
    Dave Bryant
    Guest
    Devshed Newbie (0 - 499 posts)
    I'd say that Perl is better for getting the OS to work with other parts of the Machine, PHP is better for interfacing with a database and presenting it on a browser, and Javascript is better for getting nifty (but often pointless) interaction between user and browser done. PHP is so popular because it fits the small to mid-sized businesses so well, everything is free and it can handle mid-level transactions well with good speed. Plus, the code out there and support is ever-growing. I'm hooked on PHP!!!

    ------------------
  16. #9
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    5
    Rep Power
    0
    With Perl, you can hide the source code. With PHP, you cannot.

    If not true, please let me know.
  18. #10
  19. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    That depends on WHOM you are hiding it from... If someone has access to your doc roots you've got bigger problems than someone reading your scripts.
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    300
    Rep Power
    15
    Just to throw in my humble opinion.

    There are different things you can do with both of the languages, and they both have their advatages and shortcomings. Perl has been around longer than PHP, and is, IMHO, a more complex language that allows you to do more advanced things. On the other hand, PHP is great for pure web development, since it is by far more easier to output HTML code with it then with Perl, to connect to databases, and those sorts of things. Back to Perl again, there is much more code lying around than PHP (CPAN has modules for nearly any operation conceivable). PHP can mimic that code with few functions, and you can easily make objects that would act similar to CPAN modules. But keep in mind that PHP was meant _only_ for web development, where Perl is meant for much more than that (system programming, application programming...)

    So, they both have their advantages. I started with Perl, and am still a little biased towards it. But I really think that PHP is great, and I like it being around. Imagine being stuck with nothing else than ASP...
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    SLC, UT, USA
    Posts
    47
    Rep Power
    16
    Since everybody else is throwing in so shall I...
    I agree client side scripting just isn't reliable enough for most critical scripts particularly form validation.
    I still use Perl for site maintenance like searching out and fixing broken links, modifying banner links, etc. With over 25,000 files this helps a lot. These are quick little scripts I write and run from the command line.
    One reason PHP is better is because it runs as a thread in the webserver. Much faster than Perl/CGI.

    Robman
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    36
    Rep Power
    15
    I would imagine that your average user is either using IE4, IE5, NS4 or NS6. Also, your average Joe will not have the knowledge to turn off JavaScript. Most (90%) of the browsers accessing the internet are 4.0 or better which have no problem w/ JavaScript.

    PHP has shell access just like PERL. PERL is slower due to the fact that it has to open a new process for each and every time the script is run whereas PHP does it all in the same process.

    ------------------
    Sglane
    sglane@yahoo.com
    ICQ : 16225268
    AIM : RdnckTch81
    Yahoo! : sglane81
    "Save trees, eat beaver."
    "y!php3++?"
    http://www.fastband.net/~gabe/
    http://www.archangel-is.com/
  26. #14
  27. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    "Also, your average Joe will not have the knowledge to turn off JavaScript."

    It's not the average Joe that I'm worried about; it's the skilled, deliberate attacker.

    NEVER count on client-side code for security purposes. Your server-side scripts -- whether PHP, Perl, or whatever -- should always treat all data coming from the client as tainted until they (the data) are validated server-side.

Similar Threads

  1. Is there such thing as a dumb question?
    By dvda in forum Dev Shed Lounge
    Replies: 0
    Last Post: February 15th, 2004, 05:40 PM
  2. PHP data retrieval question with MySQL
    By gursharn in forum PHP Development
    Replies: 7
    Last Post: December 31st, 2003, 09:43 AM
  3. dumb question
    By zayin7232 in forum Perl Programming
    Replies: 4
    Last Post: December 29th, 2003, 06:38 AM
  4. Radio Buttons
    By Ulysses Freeman in forum HTML Programming
    Replies: 4
    Last Post: November 15th, 2003, 09:57 PM

IMN logo majestic logo threadwatch logo seochat tools logo