PHP Questions

Discussion in 'OT Technology' started by VBGOD, Mar 28, 2004.

  1. VBGOD

    VBGOD Guest

    I pretty much use ASP.NET for any real web solution, but the site I'm working on now (Diabetic site) is on a Linux server. Actually, most of my sites are hosted off Linux servers. :o Those Linux servers are just so damn cheap, and I'm at the breaking point where I actually need some dynamic content on some of these sites. I'm basically stuck with using some PHP here and there. I just downloaded PHP to my Windows Server 2003 machine, and the installation went smoothly. So I'll be able to development and test from my machine, and basically copy them over to my Linux server. I've already created a test page, and it works. From what I've seen so far, PHP seems like an old version of ASP mixed with JavaScript syntax. I've always avoided it because I never really needed to use it, but now I have to. Question: is there a go to source for tutorials? http://www.asp.net is a fan-fucking-tastic site for ASP.NET developers, but I don't see anything remotely like that for PHP. Thanks!
     
  2. Ximian

    Ximian New Member

    Joined:
    Mar 20, 2004
    Messages:
    1,860
    Likes Received:
    0
    Location:
    DCA
  3. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    Herb, if you want some cheap ASP.NET hosting, contact me.
     
  4. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    As for tutorials, hit up google. For online docs, hit up php.net (awesome explanations and users post their own working sample code along with any hiccups they had).

    If you're not an online tutorial person, I'd recommend finding a bookstore/library and checking out some books.

    You can't go wrong checking out hotscripts.com and hitting up the PHP section. You probably could find tutorials here, but they have a ton of links to PHP scripts. You might find someone has already done what you're looking for...

    PHP will probably feel a little backwards going from ASP, but its typically pretty easy to learn (it follows closely to Perl and has a hint of C flavoring mixed in).
     
  5. VBGOD

    VBGOD Guest

    :eek4:

    The only good thing about that site is the PHP setup files.
     
  6. VBGOD

    VBGOD Guest

    ok
     
  7. VBGOD

    VBGOD Guest

    My thing is this: I've seen 10 different ways in sending email via a form. I don't want to learn the wrong way. :(
     
  8. Ximian

    Ximian New Member

    Joined:
    Mar 20, 2004
    Messages:
    1,860
    Likes Received:
    0
    Location:
    DCA
    I guess you can't read well since php.net is the best resource for learning about PHP.

    Here's a script, it requires you have sendmail (or a replacement) on the system with proper permissions for the web user accessing it.

    Form:

    Code:
    <form name="mailer" action="mail.php" method="post">
    <table>
    <tr>
    	<td>Name: </td>
    		<td><input type="text" name="name"></td>
    </tr>
    <tr>
    	<td>Email: </td>
    		<td><input type="text" name="email"></td>
    </tr>
    <tr>
    	<td colspan="2">Comments: <br><textarea name="comments" cols="40" rows="10">
    </textarea></td>
    </tr>
    <tr>
    	<input type="hidden" name="sendmail" value="1" />
    	<td colspan="2" align="right"><input type="submit" value="Send Mail"></td>
    </tr>
    </table>
     
    
    Mailing script:
    Code:
    <?
    $name=strip_tags($HTTP_POST_VARS['name']);
    $email=strip_tags($HTTP_POST_VARS['email']);
    $comments=strip_tags($HTTP_POST_VARS['comments']);
    $headers="From: $email\nReply-To: $email";
    if($HTTP_POST_VARS['sendmail'] == "1") {
    if(!mail("[email="[email protected]"][email protected][/email]", "SUBJECT HERE from $name",
    $comments . "\n\nFrom: $name - $email", $headers)) die("There was a problem send
    ing mail to $mailto");
    else echo "Success";
    } else {
    ?>
    <?php
    }
    ?>
    
    You see, when you're working with PHP, Perl or other such languages, there is no "wrong" way of doing it as long as no damage is done, of course. Try to make it as efficient as possible and don't forget security.
     
  9. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    Yeah, PHP does allow you do to something 10 different ways. As long as the way you pick works, its not usually a problem.
     
  10. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA
    I love php.net because all you have to do is type in the name of a function and it gives you all the parameters and other stuff you need.
     
  11. EkriirkE

    EkriirkE Zika Xenu OT Supporter

    Joined:
    Jan 11, 2004
    Messages:
    14,799
    Likes Received:
    0
    Location:
    Dublin & San Francisco, CA
    *.lunix sites are worth shit.
    They can't help anybody except to download the actual product.

    ..and no, I don't know a good tutorial site, I just use the C I know, and google functions I need
     
  12. Ximian

    Ximian New Member

    Joined:
    Mar 20, 2004
    Messages:
    1,860
    Likes Received:
    0
    Location:
    DCA
    If you don't want to bother reading the documentation provided or don't want to go through all the source code and figure out how it works, you really shouldn't complain.

    I've gotten help from many "lunix" sites and many projects are documented very well. If you really think developers are going to go out of their way to help you with a specific problem without you going through their documents, just go back to using Microsoft products now.
     
  13. VBGOD

    VBGOD Guest

    Do you use notepad, or is there an actual development environment?
     
  14. VBGOD

    VBGOD Guest

    Oh, I'm not complaining. If anything, I LOVE how this will work on my Windows and Linux servers. I'll spend more time, but I don't want to learn incorrectly. When I first started with ASP a long time ago, I studied from a few books. Later on, I found it was the "wrong way". :-/ I just don't want that to happen here.
     
  15. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    :confused: I've never seen documentation better than the PHP docs on php.net.
     
  16. Aimless

    Aimless Resident drunkey

    Joined:
    Nov 5, 2001
    Messages:
    2,534
    Likes Received:
    0
    Location:
    Wisconsin
    I like Dreamweaver MX 2004 :dunno:
     
  17. Leb_CRX

    Leb_CRX OT's resident terrorist

    Joined:
    Apr 22, 2001
    Messages:
    39,994
    Likes Received:
    0
    Location:
    Ottawa, Canada
    I found php.net to be quite useless

    I find most answers through google
     
  18. VBGOD

    VBGOD Guest

    By the way, thanks. :)
     
  19. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    php.net, when you know how to use it, has some awesome info. I'm on there pretty often double checking I'm using the right function for the job. I wouldn't use php.net for trying to learn PHP, but for reference. For tutorials, I'd go to google.

    As for development environments, check out Edit+. Its like Notepad but with balls. I believe it recognizes PHP straight out of the box.
     

Share This Page