Results 1 to 8 of 8

Thread: php basics

  1. #1
    Join Date
    Feb 2002
    Location
    Fountain Valley, CA
    Posts
    219

    Question php basics

    I need the ability to run .html pages with embedded php. To do this, according to the documentation that I have found, I need to modify the AddType application line in httpd.conf. I need to change the line, AddType application/x-httpd-php .php .phtml, by adding .html to the end of this line.

    However, it appears that I must do this site by site.

    My questions are:

    1. Do I need to .htm also?
    2. How can I do this at a server level and avoid having to do it site by site?
    3. Do I need to do this at all? Currently, if I add php code in the html page, it does nothing. So I am guessing that this is the problem and by adding .html to this line, it will parse the html page.
    We're all humanary stew, if we don't pledge allegiance to the Black Widow

  2. #2
    Join Date
    Jul 2002
    Location
    UK
    Posts
    79
    Why not just run .php pages with embeded HTML?

  3. #3
    Join Date
    Feb 2002
    Location
    Fountain Valley, CA
    Posts
    219
    Running php pages messes up the search engines and indexing.
    We're all humanary stew, if we don't pledge allegiance to the Black Widow

  4. #4
    Join Date
    Jul 2002
    Posts
    153
    Steve,
    Let me see if I can help you with this. Is php currently running on your system?

    PHP Code:
    <?phpinfo(); ?>
    --- Create a file called info.php and call it from a browser. If php is running you will see the output of the info page. If not then you have some work to do to get php running.

    1. No you can simply have a php page with the .php extension and not use the .htm. Its not needed as php pages can have html embedded inside them.
    2. Ehhhh?
    3. No. What code are you adding...maybe it does nothing.

    Thanks.

  5. #5
    Join Date
    Feb 2002
    Location
    Fountain Valley, CA
    Posts
    219
    I added the code and it showed a really nice PHP info page, PHP 4.1.2.

    1. No debate about that.
    2. We are an internet company and have been working with Yahoo, MSN, and others. It turns out that the search engines' indexes do not handle php pages very well. This is according to the "expert" that originally setup the web pages.
    3. The code that I added to the html page is:
    <?php
    echo "Hi!"
    ?>

    I wanted to test the php. I need to connect to MySQL and retrieve data from the database to display on the webpage. Price, Inventory Count, and Location. I was under the impression that php and MySQL was a good method to do this. Also, due the the constraints that I am working with hundreds of html pages, I simply wanted to add the php code to the pages and display the info. It can either be displayed on the page or as a popup window from a hyperlink.

    Thanks for the help!
    We're all humanary stew, if we don't pledge allegiance to the Black Widow

  6. #6
    Join Date
    Feb 2002
    Location
    Fountain Valley, CA
    Posts
    219
    Update: On one web site, it works. On the second web site, it cannot find the file. I get a File Not Found Error - The requested URL was not found on this server.
    We're all humanary stew, if we don't pledge allegiance to the Black Widow

  7. #7
    Join Date
    Feb 2002
    Location
    Fountain Valley, CA
    Posts
    219
    Thread is closed
    We're all humanary stew, if we don't pledge allegiance to the Black Widow

  8. #8
    Join Date
    Mar 2001
    Location
    Ireland
    Posts
    1,354

    Exclamation

    Originally posted by BooBoo
    Running php pages messes up the search engines and indexing.
    It shouldn't do if you code them properly. It WILL mess them up if they are completely dynamic ie. pulling from a database
    Blacknight
    ICANN accredited domain registrar

Posting Permissions

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