Using php skript from BMax?

BlitzMax Forums/BlitzMax Programming/Using php skript from BMax?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I have try this :

Php Script :

<?php
	$newscore = $_GET['a'];
	$newname = $_GET['b'];
	$newlevel = $_GET['c'];

	//implement your own security check with these!
	$scoretest1 = $_GET['c']; 
	$scoretest2 = $_GET['d'];
	$scoretest3 = $_GET['c'];

	//LOAD SCORES
	$handle = fopen("scores.txt","r");
	for ($i = 0;$i<2000;$i++) {
		$name[$i] = str_replace("\r\n","",fgets($handle));
		$score[$i] = str_replace("\r\n","",fgets($handle));
		$level[$i] = str_replace("\r\n","",fgets($handle));
	}
	fclose($handle);


	if($newscore && $newname) {
		//NEW SCORE
		for ($i = 0;$i<2000;$i++) {
			if ($newscore > $score[$i]) {
				for ($a = 2000;$a > $i;$a--) {
					$score[$a] = $score[$a-1];
					$name[$a] = $name[$a-1];
					$level[$a] = $level[$a-1];
				}
				$score[$i] = $newscore;
				$name[$i] = $newname;
				$level[$i] = $newlevel;
				break;
			}
		}
	}


	//SAVE AND PRINT SCORES
	$handle = fopen("scores.txt","w");
	for ($i = 0;$i<2000;$i++) {;
		fwrite($handle,$name[$i] . "\r\n");
		fwrite($handle,$score[$i] . "\r\n");
		fwrite($handle,$level[$i] . "\r\n");
		
		// echo ($i+1) . '. ' . $name[$i] . " " . $score[$i] . "\r\n";
	}
	fclose($handle);



?>


and this bmax code to connect :

'First, we gonna set up the strictmode
Strict

Function inetscript:String(myurl:String)

	'Now we gonna open the requested URL to read
	Local myip:TStream		= ReadStream(myurl$)
	
	'We need a var to store the string that will be given
	'back by the php script
	Local ipstring:String	= ""
	
	'Successfully opened the requested URL?
	If Not myip
		
		'If not then we let the user know
		ipstring$ = "Error!"

	Else

		'If yes then we read all that our script
		'has for us
		While Not Eof(myip)
		
			'And store the output line by line
			ipstring$ :+ ReadLine(myip)

		Wend
		
		'Don't forget to close the opened stream in the end!
		
		
	EndIf

	'Don't forget to close the opened stream in the end!	
	CloseStream myip

	
	'Just return what we've got	
	Return ipstring$
	
End Function

Print inetscript$("http://www.blitz3dfr.com/score.php?a=13000&b=LOLO&c=16")


Seem don't work ? but a direct acces from a browser with this adress :

http://www.blitz3dfr.com/score.php?a=13000&b=LOLO&c=16

Work !? You can show the result :
http://www.blitz3dfr.com/scores.txt

Any idea ?