emorjon2 0 Newbie Poster

Hi all!

I am developing a java-game where you are building with balls. It will connect to a server to create a huge map available for everybody playing this game.:)

For this, I need a PHP-file who will append some urldata into the file data.txt, for adding a ball into the server map.

But when I run this file for testing, something very stranged happend. I can't explain it, but I must fix it if i want to be done with my game.:S

the PHP file is called addball.php and the url goes like this:


the data I want to transport to see if it work is


But when the PHP file appended it to the data file, the file goes from empty into this


I tried to add some code the urldata goes from this in the URL


to this in the file:


but still, it would be this:



heres the code for it. I don't know what code does manipulate the data but I hope that
you guys would found it.

if (isset($_REQUEST["ball"])){
	 $fname = "data.txt";
	 echo $_REQUEST["ball"];
	 $f = fopen($fname, "a");
	 $filedata = str_replace("o", "x", $_REQUEST["ball"]);
	 echo $filedata;
         //here it starts to go something wrong
	 fwrite($f, str_replace("o", "x", $_REQUEST["ball"]) + "_");

PLEEEEEEEEEEEAAAAAAAAAAAAASE can someone help me?????? :'( I will be SOOOOOOOOO happy
for answers!

PS. If there's any bad english in here, I'm sorry. I'm swedish

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.