ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Awesome, I tried the nl2br tag (sorry, it seemed the easiest lol) and it worked.
Now, another question begs to be asked. When I try to translate HTML into plaintext, I'm using the code
PHP Code:
$replybody=preg_replace("<","<",$replybody);
However, this code results in this on the actual posting page:
Warning: No ending matching delimiter '>' found in /drive2/fpgshttpd/speakfree/forum/replyinsert.php on line 156
Now, remember, I don't want to DELETE the tags, I want to simply make them so a browser won't recognize them as tags. I thought that replacing the < symbol with it's HTML code would accomplish that... but apparently it doesn't.
Edit: Also, you are still using preg_replace in that but not using a regular expression for your pattern. Either convert that to a regular expression or use str_replace. Or maybe there is some other sort of HTML encoding function in PHP as well.
Now, here's the thing. I have this forum and I want people to have the ability to upload their own avatar. I want the avatar to be stored in an SQL table, but I don't think this is at all feasible. I saw something about the SQL type "blob" being able to hold images and such, but if I wanted to make a table like
USERNAME | AVATAR
and have AVATAR actually hold the physical image rather than a link to the image, would that be possible at all? And what about delivery to the HTML page? Could a PHP variable be an image? I'm just so confused about how to make this work effectively. If you have any idea at all, please let me know
To display the image you probably want to create a second php file called "avatar.php" which is called from the image's src tag and takes a parameter like "user=123", you can then lookup user 123's image and send it back to the browser.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.