所以,昨天我的代码非常适合我的网站......直到我意识到文档中没有人(1)出现!!!我已经搜索了整个代码,似乎没有任何问题!
我不知道这是否是 PHP (5.3) 中的错误,还是什么......它必须得到修复!
回顾:所有的(1)将因未知原因被删除)
我的代码在这里:
echo "Please wait while we submit your recipe...";
//getting form data
$thedate = Date("d-m-Y_H:i:s");
$title = $_POST['Title'];
$description = $_POST['Descript'];
$ingredients = $_POST['Ingredients'];
$instructions =$_POST['Instructions'];
$notes = $_POST['Notes'];
$name = $_POST['Name'];
//replacement for extra characters
$title = str_replace("\'" && "\"", "" , $title);
$description = str_replace("\'" && "\"", "" , $description);
$ingredients = str_replace("\'" && "\"", "" , $ingredients);
$instructions = str_replace("\'" && "\"", "" , $instructions);
$notes = str_replace("\'" && "\"", "" , $notes);
$name = str_replace("\'" && "\"", "" , $name);
$title = str_replace("\\", "" , $title);
$the_recipe_url="RecibaseWaitingList/".$thedate."--".$title.".txt";
$the_recipe_url = str_replace("'", "" , $the_recipe_url);
$the_recipe_url = str_replace("\"", "" , $the_recipe_url);
$the_recipe_url = str_replace("?", "" , $the_recipe_url);
$the_recipe_url = str_replace(chr(10), "_", $the_recipe_url);
//bugs show up before or after this
echo '...';
//Checking to see if all required fields are filled
if($title !== '')
{
if($ingredients !=='')
{
if($instructions !=='')
{
//writing to the file
$writetothefile = fopen($the_recipe_url, 'c');
fwrite($writetothefile, $name." submitted this recipe on ".$thedate." \r\n \r\n ");
fwrite($writetothefile, "Title: ".$title." \r\n ");
fwrite($writetothefile, $description." \r\n ");
fwrite($writetothefile, " \r\n ");
fwrite($writetothefile, "Ingredents:\r\n".$ingredients." \r\n");
fwrite($writetothefile, " \r\n ");
fwrite($writetothefile, "Instructions: \r\n ".$instructions." \r\n ");
fwrite($writetothefile, "\r\n ");
fwrite($writetothefile, "Notes: \r\n" . $notes . "\r\n \r\n ");
fwrite($writetothefile, "Thank you ".$name." for submitting this recipe! \r\n \r\n When you're done with the recipe, just click the back button.");
fclose($writetothefile);
//echo's for the user to see
echo '<br />Your recibase recipe url is <a href="' . $the_recipe_url . '">' . $the_recipe_url . '</a>.';
echo "<br />";
echo "<br />";
echo "Thank you for being so generous with your time and entering your recipe. We hope you enjoy using the rest of the site!< br />";
echo "<br />";
echo '<a href="http://recibase.musicsuper.org/input.php">Click Here</a> to enter in another recipe.<br />';
echo "...and we're done!";
}else{echo "Go back, and enter the <b><i>Instructions</i></b> of your recipe please!".'<br><br><a href="javascript:history.go(-1);">'.'<--- Go Back</a>';}
}else{echo "Go back, and enter the <b><i>Ingredients</i></b> in your recipe please!".'<br><br><a href="javascript:history.go(-1);">'.'<--- Go Back</a>';}
}else{echo "Go back, and enter the <b><i>Title</i></b> of your recipe please!".'<br><br><a href="javascript:history.go(-1);">'.'<--- Go Back</a>';
是什么导致1的消失?为什么会这样?
任何想法将不胜感激。
如果您想通过示例配方查看此代码的产品,请访问此处:http ://recibase.musicsuper.org/AllOfYourRecipes/RecibaseWaitingList/15-02-2013_13:38:17--Deer%20Liver% 20Pate.txt