![]() |
#1
|
||||
|
||||
![]()
I'm coding a few events (one is a continuous puzzle collecting event that updates once a month with a new puzzle) and want to have it set up so that once a user "finds" a piece it shows up on a new page (tentatively titled 'puzzle', it would show up as 'puzzle.php?user=$username') that's linked from their profile.
Once a puzzle is completed they should get an message from the system that congratulates them, and hands out a promo code for a limited edition adoptable (only two available per user). Before I can get it ready I'll need to create the puzzle page that's linked, and a way to see what pieces users have in MySQL to check against my puzzle file (which you can see below). How would I go about doing this? I'm a little lost on what I need to code. (PS: My puzzle file which lists all parts of the puzzles) PHP Code:
__________________
|
#2
|
||||
|
||||
![]()
Well to create a subpage in a script file, the easiest way is to define variables such as $page, $act or $more as super global array $_GET['page'], $_GET['act'], or $_GET['more']. This way you can continue to create a PHP form that direct the user to a certain page under certain conditions. The page and url info is stored in the super global $_GET, and thus can be readily extracted to use.
A very good example is account.php, in which the variable $act can have several values, each leading to a different subpage that users can edit their account info. A problem arises if you are creating a game script incase you do not want users to be able to cheat with the 'refresh' and 'back' button. The manipulation of PHP session variables will resolve this issue, but for now its your best interest not to worry about it till later.
__________________
![]() Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Looking for someone to code for me :) | Infernette | Staff Central | 33 | 02-03-2014 04:44 PM |
PHP Code. | Aasixx | Questions and Supports | 2 | 09-17-2012 05:15 PM |
Could some one code this..? | Abronsyth | Questions and Supports | 5 | 04-13-2012 07:27 PM |
Invite Code/Alpha Code | Shex | Questions and Supports | 0 | 03-07-2011 04:08 AM |
Need a code to vote | Cosma | Questions and Supports | 0 | 01-25-2010 04:24 PM |
What's New? |
What's Hot? |
What's Popular? |