PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 11th, 2000, 03:13 AM
hkccm hkccm is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Hong Kong
Posts: 24 hkccm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have written a dicussion board program.
Indeed,this is my first PHP/MySQL program.
I found a bug that I have no idea how to solve it.

If a user entered a message with a ' in it,
the MySQL will prompt a error message.

I am using a <textarea></textarea> in HTML

my program can be reach at http://www.hkccm.com/msgboard/easyphpboard.phtml
the speed maybe slow, since I am using a 9 bucks/month webhosting service.

Reply With Quote
  #2  
Old March 11th, 2000, 05:32 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 17
Send a message via AIM to rod k
You need to addslashes() to the text before inserting.

$text=addslashes($text);

Reply With Quote
  #3  
Old March 11th, 2000, 06:30 AM
ccm ccm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Hong Kong
Posts: 73 ccm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 31 m 9 sec
Reputation Power: 14
Thanks Rod!
it works!
hehe

also thanks for your Next/Prev buttons code in PHPBuilder.com

Reply With Quote
  #4  
Old March 11th, 2000, 07:12 AM
ccm ccm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Hong Kong
Posts: 73 ccm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 31 m 9 sec
Reputation Power: 14
ahhh, my code got another problem.....

if I input:
---------------
This is a Test
This is a Test
---------------

the output will be:
-----------------------------
This is a TestThis is a Test
-----------------------------

is there a PHP function for displaying the string correctly?

Reply With Quote
  #5  
Old March 11th, 2000, 09:27 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 17
Send a message via AIM to rod k
If you output it as HTML it will do that just as if you typed that in your HTML code (returns not displayed).

You can use the HTML <PRE> tag or you can use PHP's nl2br() function which converts new lines to <br>s

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > a bug in my program (MySQL/PHP)

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap