PHP help
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: PHP help

  1. #1
    er0k
    Guest

    PHP help

    ok ive never thought to find out what PHP does, or basically is. What the power of it is,. whats its used for etc. I figure i need to learn it sometime or another anyway, so ill be asking here and searching around. if anyone could give me a good explanation that i could ask questions about in here etc i would be much ablidged. thankyou

  2. #2
    Banned
    Join Date
    Jun 2002
    Posts
    458
    Me remembers rewan-something, sorry i forgot ur name, but he wrote a tutorial on it. But here is an explanation.
    Php is a language used to make dynamic web pages. What you have to do, is install php, from php.net (from apache) and configure your server to parse .php files through php.exe Php comes with preconfigured settings for most common server types. Now let me explain this parse thing, just some basic code, I wanna make a varible, so lets say I type
    $khakis = "khakis r kewl";
    Then that means that whenever I type $khakis in a php script on that page it will be replaced by khakis r kewl. Taking a closer look, (By the way, all php pages must end in .php or .php3 or .phtml) what happened was the server, seeing that the page was .php ran it through php.exe which saw
    $khakis = "khakis r kewl";
    and from then on replaced all $khakis with khakis r kewl, it finished running the php page through php.exe, then gave the server back just html code, and the server then gave it to the user. So we could have php use mysql as well, that way we could display things like databases, by doing something like,
    $db = (localhost, root, dbnamehere)
    and use a built in function in php, which is called mysql_connect(), that way the page would connect to mysql, and then we could pull out databases. Php is dynamic, open source, and free.
    Quick review,
    1. User tries to access .php page
    2. Server seeing it is .php gives it to php.exe
    3. Php.exe processes all the php scripts/code in the page and hands it back over to the server in plain old html
    4. Server gives page to user
    For a database it would be likem
    1. User tries to access page
    2. Server seeing it is .php, give it to php.exe
    3. Php.exe sees that some info for the page is located in a database, and connects to it (a coder must type in the functions that allow php to connect to a database) and pulls out the information
    4. Php.exe processes all the code, adds in the database info and hands everything over to the server
    5. Server gives it to the user
    Php has a great relationship with mysql, they work great together, with many built-in mysql functions, as well as apache functions. (of course! they make the thing!)
    There are tons of books and sites that explain php much better than this. I just wanted to tell you php rules, it is a great tool, though I started using asp, , I have to, I get payed for it. But if I had the choice, I would take php.

    EDIT: php also has built-in support for generating images, (cool, huh?) as well as for dynamically creating .pdf files (adobe acrobat documents).

  3. #3
    er0k
    Guest
    cool thanks, i was just wondering if i needed it to run my server through mysql, or if i even needed a database TO serve. PHP sounds cool though.. i think ill learn it anyway.

  4. #4
    Banned
    Join Date
    Jun 2002
    Posts
    458
    You don't need to use mysql, its just that php and mysql work really well together, though mysql is meant mainly for average loads, and ur welcome.

  5. #5
    er0k
    Guest
    hum.. in order to run a server i dont need a database, is that what you are saying, or i just dont need a php/mysql database?

  6. #6
    Senior Member
    Join Date
    Jan 2002
    Posts
    244

    Re: PHP help

    http://www.antionline.com/showthread.php?postid=546442 is the link to Rewandythals tutorial.
    i m gone,thx everyone for so much fun and good info.
    cheers and good bye

  7. #7
    Banned
    Join Date
    Jun 2002
    Posts
    458
    You don't need a database to run a site. But if you wanted to use a databse with php, you should try out mysql. They are designed to work well together.

  8. #8
    er0k
    Guest
    i understand that, i was wondering if i needed a database to run a server. any kind of server.

  9. #9
    Senior Member
    Join Date
    Nov 2001
    Location
    Ireland
    Posts
    735
    PHP is a really cool programming language. It's like C for the web. It has C feature, Perl features...etc.
    It rocks.

  10. #10
    Banned
    Join Date
    Jun 2002
    Posts
    458
    No, erok, you don't. You only need a database if you want php to pull stuff out of one. But you don't need to know for a while, not until you really get into php.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides