TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-28-2007, 02:42 PM   #1 (permalink)
ian
The Visitor
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
ian is on a distinguished road
Default 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?
ian is offline  
Reply With Quote
Old 10-28-2007, 02:59 PM   #2 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default

Do you need to actually create a page? Could you not put the information into a database and then create the page from that?
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 10-28-2007, 03:00 PM   #3 (permalink)
ian
The Visitor
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
ian is on a distinguished road
Default

Hm... Which would be more effective?
ian is offline  
Reply With Quote
Old 10-28-2007, 03:22 PM   #4 (permalink)
The Contributor
Upcoming Programmer 
 
Gurnk's Avatar
 
Join Date: Oct 2007
Location: US
Posts: 66
Thanks: 19
Gurnk is on a distinguished road
Default

I would recommend putting the information into a database.
Send a message via MSN to Gurnk
Gurnk is offline  
Reply With Quote
Old 10-28-2007, 03:23 PM   #5 (permalink)
ian
The Visitor
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
ian is on a distinguished road
Default

So once they submit it, and put it in the database. How do I have it automatically set up a page for it?
ian is offline  
Reply With Quote
Old 10-28-2007, 03:43 PM   #6 (permalink)
The Contributor
Upcoming Programmer 
 
Gurnk's Avatar
 
Join Date: Oct 2007
Location: US
Posts: 66
Thanks: 19
Gurnk is on a distinguished road
Default

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.
Send a message via MSN to Gurnk
Gurnk is offline  
Reply With Quote
Old 10-28-2007, 04:26 PM   #7 (permalink)
The Acquainted
 
Join Date: Oct 2007
Posts: 170
Thanks: 18
maZtah is an unknown quantity at this point
Default

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

PHP Code:
if(!is_numeric($pallette))
  exit(); 
maZtah is offline  
Reply With Quote
Old 10-28-2007, 05:43 PM   #8 (permalink)
The Contributor
Upcoming Programmer 
 
Gurnk's Avatar
 
Join Date: Oct 2007
Location: US
Posts: 66
Thanks: 19
Gurnk is on a distinguished road
Default

You might not want to kill the rest of the page, but yeah, you should check to see if there is an id.
Send a message via MSN to Gurnk
Gurnk is offline  
Reply With Quote
Old 10-29-2007, 10:10 AM   #9 (permalink)
Super Moderator
Advanced Programmer 
 
bluesaga's Avatar
 
Join Date: Sep 2007
Posts: 165
Thanks: 0
bluesaga is on a distinguished road
Default

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 ;)
__________________
Halo 3 Cheats
bluesaga is offline  
Reply With Quote
Old 10-29-2007, 01:15 PM   #10 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:47 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design