Minimeallolla Posted November 8, 2010 Share Posted November 8, 2010 if(isset($_COOKIE['ID_my_site'])) { $username = mysql_real_escape_string( $_COOKIE['ID_my_site'] ); $pass = mysql_real_escape_string( $_COOKIE['Key_my_site'] ); $check = mysql_query("SELECT * FROM users WHERE username = '$username' AND password = '$pass'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { if ($pass == $info['password']) echo "$username"; } } if (isset($_POST['submit'])) { $firstname = ($_POST['firstname']); $lastname = ($_POST['lastname']); $filename = "***/$username.info.php" or exit("Unable to open file!"); $handle = @fopen($filename, 'x+')or die(mysql_error()); $content = "nothing i enter here gets inserted into the file"; @fwrite($handle, $content)or die(mysql_error()); @fclose; } Link to comment https://forums.phpfreaks.com/topic/218093-fopen-fwrite-fclose-doesnt-work-need-help-using-variables/ Share on other sites More sharing options...
gizmola Posted November 8, 2010 Share Posted November 8, 2010 We need to know more about what problem you are having. You should remove the @ symbol from the front of the functions you are calling, as they suppress ordinary error handling. Link to comment https://forums.phpfreaks.com/topic/218093-fopen-fwrite-fclose-doesnt-work-need-help-using-variables/#findComment-1131720 Share on other sites More sharing options...
Minimeallolla Posted November 8, 2010 Author Share Posted November 8, 2010 If i remove the @ infront of fwrite it turns into a function error -.- and no error message comes up the way it is, it just doesnt echo anytihng Link to comment https://forums.phpfreaks.com/topic/218093-fopen-fwrite-fclose-doesnt-work-need-help-using-variables/#findComment-1131721 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.