Page 1 of 1

wrapper does not support writeable connections...

Posted: Sat Apr 17, 2004 5:04 pm
by 1veedo
Real simple source. It's chmod'ed and everything. Just gives my this error:

Code: Select all

Warning: fopen(http://mwbg.1veedo.com/users/.data.txt): failed to open stream: HTTP wrapper does not support writeable connections. in /home/x1veedo/public_html/mwbg/newUser.php on line 4

Code: Select all

<?php
$sn = $_POST['sn'];

$handle = fopen("http://mwbg.1veedo.com/users/".$sn.".data.txt", "w");
$data = $_SERVER['REMOTE_ADDR']."    ".$_SERVER['HTTP_USER_AGENT'];  //just thought I'd try this, I wont use it for anythnig.  Heard people talking about loging IPs for users.. I figure this is how you do it
fwrite($handle, $data);
fclose($handle);

$handle2 = fopen("http://mwbg.1veedo.com/users/".$sn.".login.txt", "w");
$p = $_POST['password'];
fwrite($handle2, $p);
fclose($handle2);

$heath = 10;
$level = 1;
$exp = 0;

if($_POST['PlayerType'] == 1) //attack
{
	$speed = 3;
	$attack = 6;
	$defense = 2;
}
if($_POST['PlayerType'] == 2)
{
	$attack = 4;
	$defense = 3;
	$speed = 4;
}
if($_POST['PlayerType'] == 3) //defense
{
	$speed = 3;
	$attack = 2;
	$defense = 6;
}
if($_POST['PlayerType'] == 4) //speed
{
	$speed = 5;
	$attack = 4;
	$defense = 2;
}

$handleH = fopen("http://mwbg.1veedo.com/users/".$sn.".stat.h.txt", "w");
$handleL = fopen("http://mwbg.1veedo.com/users/".$sn.".stat.l.txt", "w");
$handleX = fopen("http://mwbg.1veedo.com/users/".$sn.".stat.x.txt", "w");
$handleS = fopen("http://mwbg.1veedo.com/users/".$sn.".stat.s.txt", "w");
$handleA = fopen("http://mwbg.1veedo.com/users/".$sn.".stat.a.txt", "w");
$handleD = fopen("http://mwbg.1veedo.com/users/".$sn.".stat.d.txt", "w");
fwrite($handleH, $heath);
fwrite($handleL, $level);
fwrite($handleX, $exp);
fwrite($handleS, $speed);
fwrite($handleA, $attack);
fwrite($handleD, $defense);
fclose($handleH);
fclose($handleL);
fclose($handleX);
fclose($handleS);
fclose($handleA);
fclose($handleD);
?>
I dont have the slightest clue.
http://mwbg.1veedo.com/signup.php

The rest of the game isn't written yet, just thought I'd get registration out of the way.

Posted: Sat Apr 17, 2004 6:09 pm
by 1veedo
I asked the support for my server sense three people seemed to think it was the server.. they told my to use a direct path ;)

Posted: Sun Apr 18, 2004 2:51 am
by JAM
Yah, it's a setting in the php.ini that can be tweaked to make this work.

http://www.php.net/manual/en/ref.filesy ... -url-fopen

But this is for reading files. (Added after looking at the posts abit more...)

Glad it worked out.

Posted: Sun Apr 18, 2004 3:03 am
by redmonkey
You cannot write to file opened by a basic HTTP request. If that were the case you could just go around writing files on any server you wished.

As the files you want to write to are on the same server, try referencing the file using the filesystem path, I have no idea as to your paths but perhaps instead of...

Code: Select all

$handle = fopen("http://mwbg.1veedo.com/users/".$sn.".data.txt", "w");
try.....

Code: Select all

$handle = fopen($sn.".data.txt", "w");
This will be the case for all your other fopen calls

Posted: Sun Apr 18, 2004 5:16 pm
by 1veedo
that's exactly what they told me to do redmonkey ;)

JAM, it's not my server :lol:

Posted: Sun Apr 18, 2004 5:24 pm
by redmonkey
1veedo wrote: that's exactly what they told me to do redmonkey ;)
And I assume it works okay?

Posted: Tue Apr 20, 2004 7:07 pm
by 1veedo
yep :wink: