Avatar of Nathan Riley
Nathan Riley
Flag for United States of America asked on

Creating Pages in PHP

I have a system I'm creating that takes the user to a web form they enter the information and hit submit it then inserts that data into the database.

After that I would like it to take them to the new page that is created from the web form based of a template.php file.

I have no idea where to start with this. I have the template.php file created of how it should look.

But say someone creates project 1, project 2, project 3 ect... I don't want to have to create a project1.php, project2.php, project3.php for every new project created.  Can't I somehow use a template.php file for all of them?  How will the page know if they go to http://domain/project1.php link to use the template.php file?
PHPWeb Development

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon
fppdit

insert this command where ever you want to call the template. Below, I created a template folder and place the file that I want to call on every page. It keeps it organize.

<? include("template/footer.php"); ?>
Nathan Riley

ASKER
I may have explained wrong:

1. So the user clicks new project, takes them to a web form to enter their title, description, ect...
2. They hit submit and the data is then inserted into the database.
3. Now I need a way to create dynamic pages, like if they create project and the id in the database is 1 then I would want the url to be domain.com/1.php for an easy example. Obviously I wouldn't want to have to create these 1.php, 2.php ect... pages for all projects. I assume it would need to use some template.php file or something when the user clicks the domain.com/1.php URL. How can I accomplish this?
ASKER CERTIFIED SOLUTION
Ray Paseur

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck