Jump to content

Basic PHP...maybe


nayrz21

Recommended Posts

I am the owner of www.Team-p90.clanservers.com  (Not a free hosting site, but one that comes with a server hosting package) Anyways the whole site is made in HTML which makes editing the tables on the side a pain to do because I would have to go through and edit index.html roster.html media.html etc etc.(reason why its not updated at the moment :P)  I know if you use a .php You only need to edit one file, however thats all I know.

 

My Questions are

1. What exactly needs to be done

2. A place where I could learn to do this myself/find a person who would be willing to help

 

Thanks.

Link to comment
Share on other sites

Links above, or googling php and mysql will yield you a ton of tutorials, for how to do it yourself.

Freelance area if you want to find someone that may help you.

 

But know, it's not as simple as you make it out to be.

Link to comment
Share on other sites

I know if you use a .php You only need to edit one file, however thats all I know.

 

My Questions are

1. What exactly needs to be done

2. A place where I could learn to do this myself/find a person who would be willing to help

 

1: Well first thing is first. If your server supports PHP rename all your .html files to .php. This will make the transition easier. If you are for SEO ranking, I would setup a .htaccess that does a 301 redirect from the old .html files to the new .php to keep your ranking and let the spiders/bots know to update. After that you are basically going to be doing more or less templating. Where you have your index.php file which includes your main header, footer and content files. The header and footer files will most likely be static. However, the content file you can make PHP driven with a database if you would like. So instead of having to manually update the file, you could use a PHP-Admin system to update it. You can use MySQL, which would be the preferred method, but depending on how much time you want to spend, you can also just read that file in with file_get_contents and write back the update content to it with fopen and fwrite.

 

2: Google/PHP.net are both great places to start. Even some of the links mentioned above. But you may want to look for a "Simple CMS (Content Management System)" as that is essentially what you want and I know there are tons of them out there. It is just finding the right one for you. It all depends on how advanced you want this and how much time you want to spend. The CMS would be the easier way to go as it is already coded you just have to learn how to use it and implement it with your current site.

 

Hope that helps, best of luck!

Link to comment
Share on other sites

Actually, I was just thinking:  If all you need is the ability to make templates, why not just get a copy of Dreamweaver and use their template system, rather than learning an entire language?  Learning PHP just to make templates is like buying a Swiss Army knife when all you need to do is slice bread.  Dreamweaver lets you create a template file, associate it with html files, and then any time you edit the template it automatically updates all the files.  There are also probably cheaper/free programs with templating capabilities similar to Dreamweaver's.

 

 

Link to comment
Share on other sites

I was not sure how simple of a project It would be, hence the "...maybe :P"

Ill look into premiso's Idea and see what happens from there? Though from the second half of your post it seems that using CMS or dreamweaver would be a much simpler/more efficient way to get what I want done?

 

Link to comment
Share on other sites

Example of how simple it can be:

 

index.php

<?php

$content = file_get_contents("/path/to/main/directory/".$_GET['page'].".html");

$template = <<< html
<html>
<head>
<title></title>
</head>
<body>
<!-- your template up until the point the content table cell is created -->

<!-- content table cell would start here -->
$content
<!-- content table cell would end here -->

<!-- and the rest of your layout after the content table cell is closed -->
</body>
</html>
html;

echo $template;

?>

Then pages would be along the lines of, index.php?page=whatever_the_filename_is

Each content page would now only need to hold whatever content you wanted to be displayed.

 

This is about as simple as it gets, imo.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.