![]() |
More PHP Help
Well, I am once again making a website that I need to use PHP and MySQL.
What I need is, when a user fills out a form, it makes an entire new page just for that user. To be more specific, I am making a color palette website, and I want it so when the user submits a palette, it makes an entire page just for that one palette. Any ideas on how to do this? |
Do you need to actually create a page? Could you not put the information into a database and then create the page from that?
|
Hm... Which would be more effective?
|
I would recommend putting the information into a database.
|
So once they submit it, and put it in the database. How do I have it automatically set up a page for it?
|
You make a master page, then you can use the PHP $_GET function to get the data.
If you have yoursite.com/view.php?pallete=143, you would then $_GET the pallete number ($pallette = $_GET["pallete"]; ) and then select the stuff from the database, where the ID is equal to $pallette. Thats a very simple explanation of it. |
And then you want to be sure the input is an id.
PHP Code:
|
You might not want to kill the rest of the page, but yeah, you should check to see if there is an id.
|
would be better to show a custom 404 page for a non-numeric value.
Also you might be better off checking for integer rather than numeric ;) |
The path I would take with this is to simply store the CSS file name in the database. That way you can save yourself a large number of columns in your database for saving colour values. When a member visits the page, you obtain the subsidiary CSS file they have selected and render the site based on that CSS file.
|
| All times are GMT. The time now is 03:37 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0