TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   More PHP Help (http://www.talkphp.com/general/1351-more-php-help.html)

ian 10-28-2007 02:42 PM

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?

Jmz 10-28-2007 02:59 PM

Do you need to actually create a page? Could you not put the information into a database and then create the page from that?

ian 10-28-2007 03:00 PM

Hm... Which would be more effective?

Gurnk 10-28-2007 03:22 PM

I would recommend putting the information into a database.

ian 10-28-2007 03:23 PM

So once they submit it, and put it in the database. How do I have it automatically set up a page for it?

Gurnk 10-28-2007 03:43 PM

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.

maZtah 10-28-2007 04:26 PM

And then you want to be sure the input is an id.

PHP Code:

if(!is_numeric($pallette))
  exit(); 


Gurnk 10-28-2007 05:43 PM

You might not want to kill the rest of the page, but yeah, you should check to see if there is an id.

bluesaga 10-29-2007 10:10 AM

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 ;)

Wildhoney 10-29-2007 01:15 PM

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