Help - Search - Members - Calendar
Full Version: Php Signup Page Problem
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
ultimategamer50
I'm having trouble with my signup page, it keeps giving me this error when I try and test the signup:
CODE
Warning: fopen() [function.fopen]: Unable to access ./test/siteinfo.txt in /www/vndv.com/b/d/c/bdcadmin/htdocs/signupen.php on line 8

Warning: fopen(./test/siteinfo.txt) [function.fopen]: failed to open stream: No such file or directory in /www/vndv.com/b/d/c/bdcadmin/htdocs/signupen.php on line 8
can't open file CHMOD it to 777

I've tried getting it right for a hour now and still working on it but I keep getting errors, here's my PHP code:
CODE
<?php
if (file_exists("./$_REQUEST[username]/")) {
echo '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <img src="BDC.bmp"/> <br> <br>';
echo '<h1>That Name Already Exists! Please Try Again by Hitting the Back Button</h1>';
} else {
mkdir("$_REQUEST[username]");
$myFile = "./$_REQUEST[username]/userinfo.txt";
$fh = fopen($myFile, 'w') or die("can't open file CHMOD it to 777");
$stringData = "password: $_REQUEST[passname] userabout: $_REQUEST[aboutuser]";
fwrite($fh, $stringData);
fclose($fh);
$myFile2 = "./$_REQUEST[username]/password.html";
$fh2 = fopen($myFile2, 'w') or die("can't open file CHMOD it to 777");
$stringData2 = "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <img src=BDC.bmp/> <br> <br> Pending Account...<img src=lock.png />";
fwrite($fh2, $stringData2);
fclose($fh2);
echo '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <img src=BDC.bmp/> <br> <br> Signup Complete! <img src=check.png/> <br> View Account <a href=http://bdcadmin.vndv.com/$_REQUEST[username]/password.html>Here<a/>';
}
?>
Ed
Create a directory and give it write access for group, then point the creation etc to that directory.
ultimategamer50
QUOTE(Bread @ Jul 27 2009, 12:12 AM) *
Create a directory and give it write access for group, then point the creation etc to that directory.

It didn't work, it still says the same error (I made a "user" directory and CHMODed it to 777 then changed the PHP's directory writing and it still didn't work.)
trut2
i know im late but:

Double Check this:

All Directories UP TO the file are CHMOD 777
ex:
if the files is at 1/2/3/4/5/6/text.txt
make sure 1, 2, 3, 4, 5, and 6 are ALL 777

and:
Make sure the file doesn't exist.
ex: During FTP/File Upload ensure you don't upload text.txt, it always throws me off.

if neither work, google alternatives...


Hope this helped (4 months late,sorry)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.