Results 1 to 10 of 18

Hybrid View

  1. #1
    Retro Addict Administrator
    My location

    Burger Time Champion, Sonic Champion Harrison's Avatar
    Join Date
    Dec 2002
    Location
    UK
    Posts
    16,116
    Blog Entries
    1
    Downloads
    6
    Uploads
    14
    It's better to hand code, than rely on an editor that inserts and constructs its own code.

    A really good free editor is notepad++. It supports all known languages, colour coding it, and line numbering.

    You can insert php code wherever you want within your html file. You just need to wrap the PHP in the <?PHP ?> tags to tell the server where to parse it.

    If I have chance later I will knock you up a quick PHP file and attach it for you to look at and play around with.

    If you haven't played a classic game in years, it's never too late to start!


  2. #2
    RetroSteve! My location

    Stephen Coates's Avatar
    Join Date
    Mar 2003
    Location
    Rotherham
    Posts
    2,176
    Downloads
    0
    Uploads
    0
    a simple example file would be good to have a look at, thanks.

    Notepad++ is a nice editor. I have used it on Windows. Don't think it runs on Linux though. Gedit, which I use here does the same thing though.

  3. #3
    ELITE My location

    Space Invaders Champion, Flash Sprint Champion, Seconds Of Madness Champion, BMX Park Champion Submeg's Avatar
    Join Date
    Jul 2004
    Location
    Adelaide, SA
    Posts
    2,499
    Blog Entries
    3
    Downloads
    0
    Uploads
    0
    If I had the time and drive, I would do my own coding for mine...but I would rather spend the time working on other projects!

  4. #4
    Retro Addict Administrator
    My location

    Burger Time Champion, Sonic Champion Harrison's Avatar
    Join Date
    Dec 2002
    Location
    UK
    Posts
    16,116
    Blog Entries
    1
    Downloads
    6
    Uploads
    14
    That's the thing. If you know how to handcode it can be much faster, and the results are exactly what you want to achieve, plus you know the code only contains what it needs to, without any of the bloat webpage creators always add into the final webpage code. It also means if a website breaks you can normally work out why and get it back up again. Trying to fix a site created by a program can be next to impossible sometimes, as it can be really hard to untangle how the program built the site.

    This isn't the same as using something like Wordpress, Joomla or vBulletin. It would take years of coding to get anywhere close to what these projects can do, and they are mature enough to just use them. All I'm referring to is more basic websites/pages you would code yourself.

    If you haven't played a classic game in years, it's never too late to start!


  5. #5
    Retro Addict Administrator
    My location

    Burger Time Champion, Sonic Champion Harrison's Avatar
    Join Date
    Dec 2002
    Location
    UK
    Posts
    16,116
    Blog Entries
    1
    Downloads
    6
    Uploads
    14
    A basic example of some php within an xhtml webpage. I'm just showing the current time, and then loading the contents of another file into the page. Place both files in the same location and then load the index.php into the browser.

    Obviously you will need to run these from a server for the php to work.

    If you want to have your own local test server running to test php then download and install WAMP. It sets up an Apache server on your PC with PHP and MySQL already setup. You then just run WAMP and put your files into the WWW directory to run and test them. You access them by typing http://localhost/ into your browser.
    Attached Files Attached Files

    If you haven't played a classic game in years, it's never too late to start!


  6. #6
    Retro Addict Administrator
    My location

    Burger Time Champion, Sonic Champion Harrison's Avatar
    Join Date
    Dec 2002
    Location
    UK
    Posts
    16,116
    Blog Entries
    1
    Downloads
    6
    Uploads
    14
    Here is the next example. This is a quick demo site I'm knocked up for you to take a look at to show you how to create your site using a template and php.

    It's templated, so all pages load from a single template. It is fully xhtml and css coded. The layout uses purely div tags for page layout/position, with all formatting done in a css file. The different parts of the page that are static across the site are held within the template files directory so editing one element of the page is easy, and doesn't require editing the main index.php file where the whole page structure is stored.

    Finally, the actual content for each page is stored in the pages directory, so page content can easily be edited without altering the actual site.

    Fairly straight forward, and you will see it doesn't take much code to create. It is very basic with the only error checking being to see if a variable is set in the url for the page to load, and if it doesn't it automatically loads the home page. A lot more can be done in this regard, such as checking to see if a page set in the URL actually exists on the server, so that visitors can't break the site by typing whatever they wish into the url string.

    To load the site place the whole contents of the zip file into your server's www and then load the index.php file.

    Any questions, just ask.
    Attached Files Attached Files

    If you haven't played a classic game in years, it's never too late to start!


  7. #7
    RetroSteve! My location

    Stephen Coates's Avatar
    Join Date
    Mar 2003
    Location
    Rotherham
    Posts
    2,176
    Downloads
    0
    Uploads
    0
    Just had a look through those examples and I'm pleased to say it makes sense .

    This will be very useful, and this method will be much better than the current one of basic HTML pages.

    I ought to learn some CSS though.

  8. #8
    Retro Addict Administrator
    My location

    Burger Time Champion, Sonic Champion Harrison's Avatar
    Join Date
    Dec 2002
    Location
    UK
    Posts
    16,116
    Blog Entries
    1
    Downloads
    6
    Uploads
    14
    Glad it was useful. Any questions about website coding just ask. Happy to help.

    If you haven't played a classic game in years, it's never too late to start!


Similar Threads

  1. Humour The Website is down
    By Harrison in forum General Chat
    Replies: 1
    Last Post: 16th November 2010, 17:27
  2. MAME advice on CHD's
    By Bloodwych in forum Arcade
    Replies: 38
    Last Post: 8th June 2010, 13:14
  3. A500 Buying advice, please
    By Cortona in forum Buying and Selling
    Replies: 6
    Last Post: 8th July 2009, 22:29
  4. Basic A500 advice?
    By Fern in forum Hardware
    Replies: 5
    Last Post: 29th November 2008, 17:46
  5. Advice to get an Amiga for old games
    By Tiago in forum Amiga
    Replies: 10
    Last Post: 24th November 2008, 15:03

Tags for this Thread

Posting Permissions

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

Copyright classicamiga.com