473,770 Members | 7,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JS Cookie in PHP jigsaw puzzle game does NOT work.

tpgames
785 Contributor
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 2825
tpgames
785 Contributor
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 Recognized Expert Moderator MVP
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 Contributor
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 Contributor
Just refresh the php txt page to see the NEW code with the new cookie code.Thanks!
Mar 14 '07 #5
tpgames
785 Contributor
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 Recognized Expert Moderator MVP
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 Contributor
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
6109
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 There are lots of these on the net, made in java, flash, C++, javascript, etc. and as shareware, but none seem to be solving the puzzle by
5
1780
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 thing. This Game-Web-Service notices a single computer - although i installed another account with a different Browser Netscape insteed of IE (so different Cookie-Directory) - but this game-server still acknoledges the compter as the same for both...
0
1527
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 is this i have to make it in full c++ concepts...not C...n one more thing...it will be user's problem to make sequence of number...i just have to provide them with a game...can anybody give me some kind of hint...i dont know how to write code for...
1
2597
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 jigsaw puzzle, and a role playing puzzler game combining image maps and several games (written by others) that are held together by a common story line and goal, and probably won't be in frames. (No link available yet, as I'm still working on it.) The...
1
2387
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
2340
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 cookie on the html page, and none of those have worked. <?php session_start(); $rating1=$rating; session_destroy(); $today=time(); $atoday=getdate($today); //Get the date into an array $atoday->mon++; //set the month to next...
4
19995
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 get the tiles in order, 1 through 15, from left to right, top to bottom, by just sliding tiles into the empty square. In this configuration, the goal would be to get the 14 and 15 to switch places, without affecting any of the other squares. Your...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.