Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need a code to allow comic readers to see something 1 time.
Old 04-04-2008, 12:45 PM Need a code to allow comic readers to see something 1 time.
Junior Talker

Posts: 4
Trades: 0
My friend was talking about his ideas for his comic (and i made the website for him) and he was saying that he wanted to have 5 different endings for his comic, but the readers can only see 1 of them.

I dont know how they would choose, but i was thinking of like 5 buttons, and they choose one, and they cannot go change their mind and choose a different one.

Is this even possible?
xGAx is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-04-2008, 01:34 PM Re: Need a code to allow comic readers to see something 1 time.
Skilled Talker

Posts: 90
Location: Savannah, GA
Trades: 0
When a user sees an ending page a record is made, if that record is present then only the first ending they viewed would be delivered. This can be accomplished by either storing their IP or Session ID in a database, or giving them a cookie. Obviously both can be undermined however if the reader doesn't know that there are alternative endings they may not be looking for a way around it.

page1.php -> page2.php -> end.php

end.php
step 1) look for cookie, if isset(cookie) then echo cookie.jpg
step 2) if !isset(cookie) then $deliver = random(image), then setcookie(cookie, $deliver) then echo $deliver

thats one way
-Mike
__________________
-Mike
-
Please login or register to view this content. Registration is FREE
mgarde is offline
Reply With Quote
View Public Profile Visit mgarde's homepage!
 
Old 04-04-2008, 05:54 PM Re: Need a code to allow comic readers to see something 1 time.
Junior Talker

Posts: 4
Trades: 0
I understand some of it, but i dont really know php.


end.php
<?php
Code
?>

thats all i basically know how to do in php, im a HTML/CSS coder (not strict).


So in other words, could you give me a block of code to use? please?
xGAx is offline
Reply With Quote
View Public Profile
 
Old 04-07-2008, 02:38 PM Re: Need a code to allow comic readers to see something 1 time.
Skilled Talker

Posts: 90
Location: Savannah, GA
Trades: 0
I do see a point in delivering different endings to a story because you can then analyze how your audience responds and then push the ending that is most effective. But if your not going to be analyzing this traffic then why do you want to spend time coding something that offers no benefit to you or your end user?

It sounds like using a random image selector written in Javascript will suffice.

Google Search

If you are determined to only deliver a single ending I would get over to php.net and use this as an opportunity to learn a little PHP. I think you will find the more you understand it the more you will want to use it.
__________________
-Mike
-
Please login or register to view this content. Registration is FREE
mgarde is offline
Reply With Quote
View Public Profile Visit mgarde's homepage!
 
Reply     « Reply to Need a code to allow comic readers to see something 1 time.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13612 seconds with 12 queries