473,378 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

JS Cookie in PHP jigsaw puzzle game does NOT work.

tpgames
785 512MB
I've tried to get a PHP cookie to work in php game, no luck.
I've tried to get a JS cookie to work. NO luck.
I can't even get a response in the php forum, so gave up!
I've posted 6 or 7 times and NO REPLY!
Am I tired? yes! All I wish is the stupid code for cookies to do something!

What do I want it to do? Save the page exactly how the user left it, so they can come back and finish the jigsaw puzzle at a later time.

What happens? I get a new puzzle.

So, where in the code needs to be changed so that the cookie will work?
I don't know. No one will even look at the silly program to let me know if the php code is preventing all cookies from working! It doesn't help that the file uses another file to 'chop' the images up. Thus, I have 2 php files that might be causing the issue.

To make matters worse, NO TUTORIAL even tells me whether I need to put the cookie on the frame page, the PHP page, or where on the php page, if thats the correct page.

Will a JS cookie overcome all coding issues with the php program to make the thing save the game in its current state of undoneness?
OR am I wasting my time, and should find a forum that only deals with PHP and nothing else ever.

Sorry for my frustration, but I've been asking since March 5th! (9 days ago).

Link to php.txt file to view code and what I've tried:
PHP TXT

Link to chop.txt file to view code:
CHOP TXT

Link to HTML file that pulls everything together:
HTML

ALL help is greatly and hugely appreciated! I do NOT understand cookies, even though I did read the tutorials. Sorry for my ignorance, but I'm just a little dense yet.
THANKS!
Mar 13 '07 #1
7 2802
tpgames
785 512MB
EDIT: I should say that no tutorial tells me where to put a cookie when I am dealing with a jigsaw puzzle game with 2 PHP pages it could go on and a HTML page it could go on.
Mar 13 '07 #2
acoder
16,027 Expert Mod 8TB
First things first, you could start by naming your cookie functions in a more intuitive way instead of using some strange letters, but I think you've probably borrowed that script.

I think if you want to use cookies properly, use the scripts on PKK's website, see link. They're much easier to follow and understand.
Mar 14 '07 #3
tpgames
785 512MB
I did try the other code, and that doesn't work either. I'm confused. The 'read cookie' must actually do something, but I don't know what to put in the equation to make it save that page exactly as the user left it so that the user can go back and finish the jigsaw puzzle at a later time.

(I tried, in desperation, to use a cookie from the memory game that saves the high score, only because that cookie at least did something. However, I couldn't apply it the jigsaw puzzle game. That code just has 'zxc' in front of variable and all so that the JS will play nicely with other JS on the page. So, I just read the script without bothering with the zxc. Vic's scripts are the only scripts I don't have issues with when I put them with other scripts.)
Mar 14 '07 #4
tpgames
785 512MB
Just refresh the php txt page to see the NEW code with the new cookie code.Thanks!
Mar 14 '07 #5
tpgames
785 512MB
The problem is with the data I am trying to save is a
GAME IN PROGRESS, and not a high score.
Rather, I'm trying to save what jigsaw pieces are together, and which ones aren't. I'd like the User to be able to put in their name, and load the puzzle that they already have in progress.
Thanks!
Mar 14 '07 #6
acoder
16,027 Expert Mod 8TB
You will need to store the variables that will reproduce the game. So how about setting the cookie for each move. Perhaps set the position of each piece on each move.
Mar 14 '07 #7
tpgames
785 512MB
Okay, that will mean that I'll have to table this question until I learn PHP better and JS. I'm not sure what part of the code does what in order to save movements. I'll do some reading first. :>)

Thanks!
(I won't be able to get to this until after April)
Mar 15 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Developwebsites | last post by:
Hi all, I've made a sliding puzzle game in shockwave which works just fine, except I dont know how to have it solve itself. the URL is: http://members.aol.com/rglukov/games/selfsolve.htm ...
5
by: Greg Cyrus | last post by:
Hi, i recently joined an online.game which rules is not to use 2 diffenrent accounts on one computer. My girlfriend also wants to play - but we got 1 computer only - so I tried to trick the...
0
by: biya | last post by:
hey all!!! can anybody help me???i have to make a program of a puzzle game...there would be numbers from 1 to 15 randomly shown...n user have to make there sequence by using arrow keys...now problem...
1
tpgames
by: tpgames | last post by:
I don't understand how to write a JavaScript to save the users progress in a game, so they can go back to the game at a later time. There is two games that really need this functionality, a php...
1
by: androskyp | last post by:
i need a code for a 3*3 puzzle game.the user wins the game if the numbers are set as 1 2 3 1 2 3 4 5 6 OR 8 4 7 8 7 6 5
12
tpgames
by: tpgames | last post by:
I've tried JS cookie on the html page that contains the iFrame code linking to the php jigsaw puzzle game. That did NOT work. I've tried JS cookie on the php page; php cookie on the php page, php ...
4
by: honey777 | last post by:
Problem: 15 Puzzle This is a common puzzle with a 4x4 playing space with 15 tiles, numbered 1 through 15. One "spot" is always left blank. Here is an example of the puzzle: The goal is to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.