I have got a stupid problem. it took 2 days find out and i can not solve it now. When i try to insert the "wget " into the database it does not work. (there is space after wget) I get this error: Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. I am trying to replace it using str_replace. it does not work either. $to_replace = array("\r\n","|","wget ","\n","\\r\\n","\\n"); $title = str_replace($to_replace, " ", $title); $description = str_replace($to_replace, " ", $description); PHP: i do not know whatto do
I tried passing these values through your code: $title = "this is the word 'wget '.\n"; $description = "this is the word 'wget '.\n"; And the results were: $title: this is the word ' '. $description: this is the word ' '. This would seem to be the expected behavior because your replace string is " ".. you did not want to replace "wget " with just a space?
I changed the code to <?php $con = mysql_connect("localhost","user","pass"); if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("database name", $con); $title=$_POST['title']; $description=$_POST['description']; $title = str_replace("wget", "ddd", $title); $description = str_replace("wget", "ddd", $description); $query="INSERT INTO `filedetails` VALUES ('', '', '".$title."', '".$description."', '','0000000000')"; mysql_query($query); echo 'MYSQL ERROR IS: '.mysql_error(); mysql_close($con) ?> <html> <body> <form action="insert.php" method="post"> title:<input name="title" type="text" size="100" /> <br> desc:<textarea name="description" cols="150" rows="10"></textarea> <br> <input type="submit" /> </form> </body> </html> PHP: but same problem.If i try to insert "wget" it works. It changes to "ddd" but when i try "wget " i get this error Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.