Results 1 to 6 of 6

Thread: help needed "first php script"

  1. #1

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    help needed "first php script"

    I am new to PHP
    My first script failed when I wanted to copy and paste my first script to the "windows NOTE PAD"
    all I can see is a blank file.txt
    what do u think is the problem..and What do I need to have first?
    thanks

  2. #2
    Are you sure you saved it as a .php file? When saving, try saving it as (with quotes) "first.php".

    And how are you trying to run it? You can't just open up a browser and open your file like you can do with HTML. PHP needs to be parsed by the PHP program. Either install PHP on your computer (http://easyphp.org is an easy way) or host your file on a server that supports PHP.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Open notepad
    Paste script
    Save as "something.php" in root directory
    Open browser
    http://localhost/something.php

    (assuming you have PHP installed and a server running)

  4. #4

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    instaling php

    yes but this time it is asking me "which program is it asocciated with?
    But yesterday I downloded "php 4.3.4" it is not in the list...which file should I put in windows /system so that it can be associated ..

    thanks

  5. #5
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    There are a few threads that you can find if you do a search about installing PHP. In order for PHP to run, you must have server software, like Apache.

    Download Apache and set it up, verify that it works.
    Install PHP for Apache and veryify that it works.

    You can't just execute a page by double clicking on it, you'll have to browse to it through your browser, http://localhost/yourfile.php

    Also know where your web directory is, the default or wherever you changed it to.

    If you don't want to do all this, find a host that has PHP and get an account with them. Then you'll just have to upload your files.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

Posting Permissions

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



Click Here to Expand Forum to Full Width