Jump to content

mazman13

Members
  • Posts

    156
  • Joined

  • Last visited

    Never

Everything posted by mazman13

  1. I'm saving text to a TEXT file instead of a database, so if i use "" or '' to say something, PHP adds the \ before it. I've tried the stripslashes($string) before it loads to the text file and when I call the info (not both at the same time)...but the \ is still there. Any ideas?
  2. Thanks again Andy I did this: $row = mysql_fetch_array($result,MYSQL_ASSOC); extract($row); [b] nl2br('$dub_body'); [/b] echo "<b>$dub_title</b> - <a href=\"$_SERVER[PHP_SELF]?action=delete_post&dub_id=$dub_id&name=$dub_title\">[Delete]</a>&nbsp;&nbsp;<a href=\"$_SERVER[PHP_SELF]?action=edit_post&dub_id=$dub_id&dub_title=$dub_title&dub_body=$dub_body\">[Edit]</a><br />"; echo "$dub_body<br><font size=\"1\"><i>$dub_date</i></font><br /><br />"; My input was: this is a line i hope this breaks My output was: this is a line i hope this breaks I've been having this problem all weekend.
  3. Here is what happens after someone types in the text field and clicks submit: if($action == "add") { //If ADD, send info to Datebase //Grabs date and time $dub_date = date("Y-m-d H:i:s"); //Converts to Uppercase words in the TITLE $rewrite = ucwords("$dub_title"); $dub_title = $rewrite; //Removes PHP and HTML tags in the TITLE $rewrite = strip_tags($dub_title); $dub_title = $rewrite; [color=orange]//Checks info str_replace(array("\r\n", "\n", "\r"), " ", $dub_body); echo($dub_body);[/color] [b]THIS DOES NOT WORK, I've tried using nl2br() and nothing happens. I don't know if the textbox sends the \n when we submit it.[/b] //Adds info to Datebase $query = "INSERT INTO $database (dub_title,dub_body,dub_date) VALUES('$dub_title','$dub_body','$dub_date')"; $result = mysql_query($query) or die ("Can't do anything with the query!"); echo "New blog added.<br>"; };
  4. Thanks Andy. I'll prob, just scratch that idea for now. :) But the enter thing is something I need for sure. If anyone knows how to do this, that would be great.
  5. Looks like the error is in the file you are including.
  6. I'm making a blog for someone who has no, HTML knowlegde. So I want to make it easy. It's something very simple, just a title, body, and it holds the date and time in the Database. Everything is working great... I just need 2 things... I want it so that, when they press "enter" it auto. adds the breaks and spaces. I already know about nl2br(); but it's not doing anything. Is it possible that the textbox is not sending /n?? What can I do for PHP to know that there is an end? Also, is there a pretty simple way to do this? "and check out my website at www.michaelzavala.com..." And have PHP fine that www. and .com and add HTML to it auto? I hope you guys understand! I hope yall can help!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.