knight47 Posted February 6, 2007 Share Posted February 6, 2007 I have no idea why this is giving the die() error, everything seems to be fine, can anyone spot any errors: <?php $name = htmlspecialchars($_POST['name']); $msg = htmlspecialchars($_POST['msg']); $clean_name = stripslashes($name); $clean_msg = stripslashes($msg); $cleaner_name = rtrim($clean_name); $card = '<HTML CODE IS HERE>'; $link = "$cleaner_name" . ".htm"; if ($_POST['Submit'] && !empty($cleaner_name) && !file_exists($link)) { $create = fopen($file, 'w') or die("Hm... There seems to be an error!"); fwrite($create, $card); fclose($create); echo '<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.site.com/cards/' . $link . '">'; } else { echo "Sorry, there seems to be a few problems, either 1, you left the Name field empty, if so, click back in your browser button, or that $cleaner_name has already been submitted, please visit <a href=\"http://www.site/cards/" . $file . ">www.site.com/cards/" . $file . "</a> to view the already existing card, thanks!"; } ?> I keep getting this: "Hm... There seems to be an error!", which is supposed to be the error message if something goes wrong, but I have no idea what is wrong. The folder is chmod to 777, and the php file is chmod to 755. Thanks Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 6, 2007 Share Posted February 6, 2007 You never define $file. Quote Link to comment Share on other sites More sharing options...
knight47 Posted February 6, 2007 Author Share Posted February 6, 2007 You never define $file. jesirose... if I could pay a penny every time you helped me, you would be rich! thank you so much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.