0

I have a website that hosts videos. Each video has it's own .html page. I essentially have a template that I have made that I reuse for each video page.

The work I have to do involves entering in video details repeatedly. Often, the same piece of information is entered multiple times on the same page, for example the video title.

I am curious if there is any way to automate this process of creating the html page from my template and entering in the various video details into the page.

Perhaps I have a database or table that holds all of a videos information and then creates a new page for each table row, by opening my template, copying over information from the table and then saves the new .html file.

Any insight on how this or something similar could be done is appreciated.

1
  • 1
    Can't you just use one template file, sending this file the id of the movie of interest, then get information from the database and populate your template with this information? For example you could have urls like www.yourdomain.com/video/3 that will be picked up by a index file that will parse out the id (3) and query the database and then generate the correct response. Commented Oct 17, 2012 at 22:02

1 Answer 1

3

The best way of doing this would be to create a video.php page and pass the video id via a link to the page like so: http://www.YourWebsite.com/video.php?id=123. (You can also format the way this URL is displayed by using .htaccess). This video.php file would then need to query your MySQL database to look up the title, description, video file, etc. This is referred to as a "database driven website."

I would recommend looking at tutorials available online, such as these: http://www.quackit.com/php/tutorial/php_database_driven_website.cfm
http://www.sitepoint.com/php-mysql-tutorial/

Sign up to request clarification or add additional context in comments.

1 Comment

I think you need to rephrase the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.