The Daily Click ::. Forums ::. Klik Coding Help ::. Please help I'm gunna cry.. lol
 

Post Reply  Post Oekaki 
 

Posted By Message

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
15th October, 2006 at 07:26:52 -

A MooSock problem. WAIT dont go!!

Highscores (PHP and MySQL)

This has been playing up so much and wont seem to work... firstly, the submissions work if you enter the address in your browser, e.g. http://www.silvernova.co.uk/addscore_sq.php?id=1&name=TDC&score=12345

If you go to http://www.silvernova.co.uk/highscore.php you can see that it has been added.. you can change the name and score in the address above and see that it has been added to the table and will be in highscore.php.

SO, the problem must clearly lie with the game? Right? :S

Here's a screenshot of what I have:

http://www.silvernova.co.uk/highscore.jpg

Image

Hopefully HTML works here? :\

Anyway, can anybody see that I'm doing anything wrong? If anyone can help in any way I'd be deeply thankful

Image Edited by the Author.

 
http://www.SilverNova.co.uk


axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
15th October, 2006 at 09:41:50 -

addscore_sq.php gives me error 500, maybe that's got something to do with it

Hah, I don't know much MooSock, it looks okay to me. If you're really desperate, you could just use Browser object to open that URL in the user's default browser.

 
n/a

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
15th October, 2006 at 10:54:10 -

Ok i've added an addscore.php too which doesnt have a 500 error...

But I still cant get the game to enter it to the database!

 
http://www.SilverNova.co.uk


Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
15th October, 2006 at 11:00:41 -

http://klikacademy.com/viewarticle.php?id=12
way old but yeah, should work

also, still server error

Image Edited by the Author.

 
My signature is never too big!!!

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
15th October, 2006 at 11:29:08 -

You don't have a space in between your POST command and the URL - get rid of the " + " and put a space in instead. I also don't think you need the "HTTP/1.0" at the end - it's always worked without it for me. If you do leave it in, put a space in before it - otherwise it will probably be treated as being added to the Score field.

If you want to verify that your data is being sent, don't disconnect after sending but listen on port 80. Then, On Received, set the text of an edit box to Edittext$("Edit Box") + RecvLine$("MooSock"). This will display the text output from the PHP page, if there is one.

Going to the addscore page gives a server error for me as well.

 
http://www.davidn.co.nr - Games, music, living in America

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
15th October, 2006 at 11:30:58 -

I've got to the new addscore.php, but I'd need to see the code to see what's wrong with that.

 
http://www.davidn.co.nr - Games, music, living in America

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
15th October, 2006 at 12:34:29 -

@Mighty Joe - Yeah that's straight where I've got all my info so far from..

@Wong -

I tried your listening on port 80 suggestion but nothing really happend so I guess nothing's going on there? :|

This is addscore.php:

[code]

<?php

$name=$_GET['name'];
$score=$_GET['score'];
$game_id=$_GET['game_id'];

include("config.php");

// connect to the mysql server
$link = mysql_connect($server, $db_user, $db_pass)
or die ("Could not connect to mysql because ".mysql_error());

// select the database
mysql_select_db($database)
or die ("Could not select database because ".mysql_error());

mysql_query( "INSERT INTO scores (id, name, score, game_id) VALUES (NULL, '$name', '$score', '$game_id')" );

?>

[/code]

I also changed the text line that's sent to:

"POST""http://www.silvernova.co.uk/addscore.php?id=1&name=" + Edittext$( "Edit" ) + "&score=" + Str$( value( "Score" ) )

and also tried

"POST""http://www.silvernova.co.uk/addscore.php?id=1&name=" + Edittext$( "Edit" ) + "&score=" + Str$( value( "Score" ) ) + "HTTP/1.0"

But still nothing

 
http://www.SilverNova.co.uk


David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
15th October, 2006 at 14:50:17 -

What I'd do there is put in some echo commands to let you know what the PHP thinks is happening - at the moment, nothign is output as long as the MySQL connection works. Try putting in echo ($name . ", " . $score . ", " . $game_id) or something similar just after you've set those variables - that way you'll be able to tell what's going into the database.

Build up the query in a separate string as well and echo that just before you run it:

$thequery = "INSERT INTO ... etc etc etc
echo $thequery
mysql_query($thequery);

Finally, I can't see anywhere that you're passing anything called "game_id" to the PHP page - I don't think this should prevent it from working, though.

 
http://www.davidn.co.nr - Games, music, living in America

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
15th October, 2006 at 15:08:33 -

It would, because nothing is being entered in that field, so it would either return an error, or put nothing there... but that means nothing could be got for the game

 
My signature is never too big!!!

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
15th October, 2006 at 19:30:34 -

Even using http://www.silvernova.co.uk/addscore_sq.php?game_id=1&name=TDC&score=12345 it will not work when i use it with MooSock.

There almost seems to be nothing at all preventing this from working...... its pathetic and extreeeemely frustrating and annoying. The php works fine because you can enter the (adding the score) address from a browser and it works fine. Its either just not connecting or sending info or accepting something but i just dont know WHAT!!!!!!

 
http://www.SilverNova.co.uk


David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
15th October, 2006 at 19:46:58 -

I put together a small application to send the data to your page, and it's working fine for me. Have a look and see what's different from the events you have already.

http://wired.st-and.ac.uk/~wong/dxn-moosock.mfa

 
http://www.davidn.co.nr - Games, music, living in America

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
16th October, 2006 at 07:07:19 -

WOOOOOOOOOOOOOOOOOOOO Thanks Wong, though I have been using MMF1.5 to make this game, I'm gunna have to switch over to mmf 2 now anyway whilst following your example..

I guess somehow it prefers to get text from an edit box rather than a string or counter... As I set the other two edit boxes you created to "1" for the ID and Global Value A for the other edit box, and it worked fine!!!

Many thanks You can expect your name in the credits of Squidge

 
http://www.SilverNova.co.uk


David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
16th October, 2006 at 10:43:23 -

Hooray for me.

 
http://www.davidn.co.nr - Games, music, living in America

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
16th October, 2006 at 14:17:04 -

you also might want to change the name of the addscore page, or add some security to it

 
My signature is never too big!!!

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
16th October, 2006 at 17:57:41 -

Lol yeah that's all sorted a long time ago

 
http://www.SilverNova.co.uk

   

Post Reply



 



Advertisement

Worth A Click