View Single Post
  #10  
Old 11-09-2014, 10:47 AM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 22,385
IntoRain is on a distinguished road
Default

Quote:
Originally Posted by parayna View Post
Um, I'm not really sure to be honest ^_^'' I do know that I want it to be done in the easiest way possible (although I don't mind having to do a few code edits, obviously). The first way you stated seems like it could be better to do.. (but I don't know). Would you be able to reuse the same page whenever you change the monthly adopts? If so, I would like to use that way XD I just need it to be easy enough so that I don't need to create a different page whenever I want to add another adoptable onto the site. That might become tedious. But if it is a simple matter of just changing the codes on one page (say when they click an image, the corresponding adopt is added into the database) and then just change it every time more is released, I don't mind doing that!

But I may need a bit of help... (although I do have an idea on how it can be done.. but I am not confident enough to have a go myself XD)

~Parayna
With the first one you can create 1 page, for example a "get" page (so 2 files, get.php and getview.php inside the view folder)
So the image would be linked like

<a href="yoursite.com/get/1">image</a>

You'd just need to change the links in this case.
The number after the link would match the IDs in your adoptables table. So when someone visited a get/ID page, you would need to:

1) Cut the link to get the last part (the ID)
2) Check if ID exists
3) Check if ID is actually an adoptable that can be adopted through this way (people WILL try to adopt other adoptables through this link).

You can do a manual check (for example if your monthly adoptables are 1, 2 and 5 you can check if the ID in the link is 1, 2 or 5).

Or you can try to pull the ID from the adoptables table to see if it exists. To check if it is one of your monthly adoptables, you can add an extra column to the table called "active", which would contain "true" if it is currently obtainable or false otherwise. Then with the ID you would check the contents of that column

If it passes the verifications, do a db insert. If not, throw an error


I can try to help you go through each step
__________________


asp.net stole my soul.
Reply With Quote