Make your own PHP adoptables system

Need help with the site/forum/pets? Ask questions and get help from other members here.

Re: Make your own PHP adoptables system

Postby Rolly-chan » Fri Aug 21, 2009 5:14 am

thenickdude wrote:That's what you expect to be in there. But what actually ends up there? Print it out with echo(), then use the trick of opening the resulting corrupt image in notepad to see the results.

While you're at it, PM me the code you're using.. :).


I can't save the image because it doesn't display any image if I echo those variables. o_O
And if I try it on Internet Explorer I can't save the image...
User avatar
Rolly-chan
 
Posts: 2790
Joined: Tue Nov 18, 2008 8:09 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Nick » Fri Aug 21, 2009 11:42 am

Works just fine if you use Firefox, just go directly to the URL of the image and save the broken page that results.
User avatar
Nick
Admin
 
Posts: 6349
Joined: Thu Jul 03, 2008 2:40 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Rolly-chan » Sat Aug 22, 2009 6:46 am

thenickdude wrote:Works just fine if you use Firefox, just go directly to the URL of the image and save the broken page that results.


Everything seems to be right. This is the line:

1250880051<br>3971<br>0<br><br>777<br>2246400<br>‰PNG

I inserted <br>s to isolate the single numbers. The first is the adoption date, the second the ID, the third time()-$row[1] ($row[1] is the adoption date), 777 is $age['date'] for the child and 2246400 is the $age['date'] for the adult. Everything is right. Since time() is the same as the adoption date it's right that it's 0. And the adoption date also seems fine to me.

I don't want to bother you too much, so I'll just try to solve it myself o_O It's a complete mystery to me but well. Maybe I'm doing something wrong... I need to think *lol*
User avatar
Rolly-chan
 
Posts: 2790
Joined: Tue Nov 18, 2008 8:09 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Nick » Sat Aug 22, 2009 2:24 pm

Time would only be the same as the adoption date in the first second after the pet was adopted. Surely that can't be the case here? If you PM me your code I'll definitely be able to spot the problem.
User avatar
Nick
Admin
 
Posts: 6349
Joined: Thu Jul 03, 2008 2:40 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Rolly-chan » Sat Aug 22, 2009 8:09 pm

I think I found the error. Where should I put the code to save the date so that it doesn't create a new adoptable the instant the image is refreshed? And how do I get access to the ID then? Because if I put the code on adopt.php I can't use the variable for the ID in simple.php... But when I put the code in adopttools or simple.php it always creates a new adoptable when I refresh.

Is there a code to only make the script run once?


EDIT: I did it *_* Everything works =3 Now I only need to find out how to encrypt and decrypt the id so that nobody can cheat. *_*
Or I'll just make that script which creates the owner's name on the image.
User avatar
Rolly-chan
 
Posts: 2790
Joined: Tue Nov 18, 2008 8:09 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Nick » Sun Aug 23, 2009 12:22 am

How could you cheat? Isn't all of the information about the pet on the server except for its ID number?
User avatar
Nick
Admin
 
Posts: 6349
Joined: Thu Jul 03, 2008 2:40 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Rolly-chan » Sun Aug 23, 2009 12:55 am

thenickdude wrote:How could you cheat? Isn't all of the information about the pet on the server except for its ID number?


Well, not right now. I'm too lazy to do everything at once (I tried to make them grow up after a set amount of days first), but you're right. Once everything is stored in the database nobody could cheat. Why didn't I think of that? ^^°
User avatar
Rolly-chan
 
Posts: 2790
Joined: Tue Nov 18, 2008 8:09 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Nick » Sun Aug 23, 2009 1:43 am

Okay, cool :D
User avatar
Nick
Admin
 
Posts: 6349
Joined: Thu Jul 03, 2008 2:40 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Dorumon » Wed Aug 26, 2009 7:50 am

Is there a simpler way to do PHP adoptable systems?
Image
Hello, this is Dorumon speaking. I have retired from colecting customs of my waja Neon and her mate Flaming Galaxy. Would you like a quest? PM me, I will send you on one. You must get proof that you compleated the quest by bringing me a screen shot (or if it's a pet, the image) and the page link. The quest sender LIVES!
User avatar
Dorumon
 
Posts: 924
Joined: Sun Jun 07, 2009 2:10 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Nick » Wed Aug 26, 2009 1:08 pm

No
User avatar
Nick
Admin
 
Posts: 6349
Joined: Thu Jul 03, 2008 2:40 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Who is online

Users browsing this forum: dunmer, Fluffmuffler and 6 guests