SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast kerim's Avatar
    Join Date
    Mar 2001
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a Host Rocket account that includes MySQL and PHP. I've gotten it to work with a pre-built script that I downloaded from the net, and now I'm trying to see if I can't do something more adventurous. But after one day of flailing around the net - I am quite frustrated. I went through every tutorial on the web, but I can't get PHP to work properly.

    Here is an example:

    http://oxus.net/kerimtemp/test4.html

    The script is:

    <HTML>
    <HEAD>
    <TITLE>My first PHP script</TITLE>
    </HEAD>
    <BODY>
    <CENTER>My first PHP script</CENTER>

    <?
    echo "<center>Hello World<P></center>";
    $today = date( "l dS of F Y h:i:s A" );
    PRINT "<CENTER>Today is: $today.</CENTER>";
    ?>
    </BODY>
    </HTML>

    From the tutorial:
    http://www.thescripts.com/serverside...php/page0.html

    But the result is a mess. I get lines of code in the output, and the date doesn't come out right. I wouldn't bother with something like this - assuming it was a fault with the tutorial - but I've been having similar problems with nearly every single tutorial I've tried today from the web.

    Several of the tutorials described how to generate output from a MySQL database, but none of them worked for me.

    What I'd like is to have a web site that automatically produced web pages by blending a template and content from a database. I guess it is still much harder than I thought. Does anyone know of a good pre-built script that might work for this, so I don't have to learn PHP from scratch?

    kerim

  2. #2
    Anyone seen my cypher? OneChance's Avatar
    Join Date
    Apr 2001
    Location
    Seattle
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try using a different file extension than .html, such as .php or .php4.

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Just to clarify the previous post. The web server looks at the file extension to decide whether to "parse" the file with the php engine. Not all files are automatically parsed. The web server can be set up to parse any file extension with the php engine, but since it takes more overhead, a web host is not going to be set up to parse all html files because generally they aren't going to have any php in them. To signal the server at your web host that your file indeed needs to be parsed by php, use the .php extension. Your web host should have its server set up to parse files with the most commonly used extension: .php, as well as .php3, .phtml, and .php4.

    Furthermore, if you are going to be learning php, you should download php/mysql/apache to your local pc. It can be a pain to set up though. There are plenty of tutorials on how to do it, but even though the whole process shouldn't take more than 30 minutes, it can take a lot longer. If you have win98, there is a pre-compiled ready to use package at:

    http://www.firepages.com.au/devindex.htm?from=dev3

    that you can just unzip and use immediately.
    Last edited by 7stud; Apr 28, 2001 at 03:44.

  4. #4
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    also if you haven't tried it check out Kevin's tutorial on sitepoint. Its very good.

    http://www.webmasterbase.com/article.php?aid=228&pid=0
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  5. #5
    SitePoint Enthusiast kerim's Avatar
    Join Date
    Mar 2001
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Such a simple matter - solved all the problems. Yes, I had tried kevin's tutorial which is most certainly the best - but because of the stupid extension error on my part I couldn't get anything to work!!! Now I understand.

    I don't have windows. I have a mac. I understand that Apache/PHP/MySQL all run on OSX, but unfortunately my current laptop is having lots of problems with OSX . . . .

    Thanks for everone's help.

    kerim


    Originally posted by 7stud
    Hi,

    Just to clarify the previous post. The web server looks at the file extension to decide whether to "parse" the file with the php engine. Not all files are automatically parsed. The web server can be set up to parse any file extension with the php engine, but since it takes more overhead, a web host is not going to be set up to parse all html files because generally they aren't going to have any php in them. To signal the server at your web host that your file indeed needs to be parsed by php, use the .php extension.


Bookmarks

Posting Permissions

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