how to change images and title using php

Hello everyone,

My website is currently undergoing construction. I am revising the entire site. I own a modeling agency and it consist of hundreds of models and each model has their own portfolio webpage. 80% of the webpages have the same layout (logo, disclosures etc…) the only thing that differs from all of these pages are the photos of the models and the model’s names. How can I use just one webpage (as a template) and only change the photos of the models and names to minimize the webpages to my site? This will save me time because I really don’t want to revise over 100 webpages for each model page. I know php is the way to go but I don’t know where to start. Should I have a database of model photos? Also how would I tie the name and the description of the model to the each photo using php. If someone could give me an example and description as to what I need to do to accomplish this task it would be greatly appreciated. I spoke with several IT specialist and they all say it’s fairly easy to accomplish this but I haven’t gotten any information yet as to how to get it completed. :-[

If you cannot get anywhere on this, I am available for hire. If you dont know Php and Mysql it will be a difficult task, although for someone in the know, it is not.

Thank you Kevin. I really need to learn to do this because I have several other sites that I need to do the same thing as well. I used dreamweaver to put the sites together using html and css. I don’t mind investing the time in recreating the site i just need to be able change the images on the page to minimize the webpages on the site. If anyone could turn me in the right direction it would be greatly appreciated :slight_smile:

The quickie explanation:

SELECT specific_fields FROM model_table WHERE model_id=?

populate page with query results

Only one page needed if all the pages are the same. I would have a separate template page and include it in the main profile page to keep code and html seperated.

Quick N Dirty
[php]<?php
try
{
$sql = “SELECT first_name, lastname, image_path FROM model_table WHERE model_id=?”;
$stmt = $pdo->prepare($sql);
$stmt->execute();
$row = $stmt->fetch($_GET[‘model_id’]);
}
catch (PDOException $e)
{
echo $e->getMessage();
}

include(“template.php”);
?>

template.php
Name: <?= {$row['first_name']} {$row['last_name']};?>
Image: [/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service