473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Guestbook entries question

Hi

I am new to PHP and am working on creating a guestbook from scratch to
experiment.
I am using several tutorials online.
I have a question about dealing with entries made to my guestbook as it
will eventually go on my website and I don't want people to write
nonsense or insults or whatever.
How do I do that?Shall I have the entries sent to my mailbox?
Or shall they be sent to files on the server until I get to read them?
My server is running mysql.
I am not sure if sent to me by email how I should enter them to the
database.Manually?Or is there a way to automate that with code after
review.
Sorry for being a newbie.

Thanks for your help

Patrick

Jul 17 '05 #1
1 4635
On 6 Jan 2005 10:27:41 -0800
"varois83" <va******@netzero.net> wrote:

:Hi
:
:I am new to PHP and am working on creating a guestbook from scratch to
:experiment.
:I am using several tutorials online.
:I have a question about dealing with entries made to my guestbook as it
:will eventually go on my website and I don't want people to write
:nonsense or insults or whatever.
:How do I do that?Shall I have the entries sent to my mailbox?
:Or shall they be sent to files on the server until I get to read them?
:My server is running mysql.

There are all sorts of issues with "form validation" that you should
Google into. You don't want people posting html to your guestbook,
f'rinstance, so you want at the very least to use strip_tags().

I keep a "dictionary" of naughty (and spam) words, one word per line,
and I check the name and the comment field against it. I have two
options, one simply rejects the message if finds a no-no, and the
other replaces the no-no with ###. For the latter you need to know about
file_get_contents() and explode() and str_ireplace(). For the former,
in_array() is your friend, along with preg_split().

Only after the text has been completely validated should you even
consider storing it to a db or sending it to a web page. You should be
able to do _all_ the validation with PHP. Some simple client-side
stuff can be done with Javascript (are the fields all filled in,
f'rinstance) but some people have turned their JS off, so it's not a
great idea. You shouldn't have to email the stuff to yourself or read
files or write the stuff into the db manually.

I recommend O'Reilly's PHP Cookbook.

--
Tony Reed
<tr***@altern.org>
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dariusz | last post by:
I am a beginner in PHP and MySQL, and am working through a book and various online tutorials on PHP and MySQL and now stuck - installed everything on "localhost" and it all works fine. My question...
4
by: knoak | last post by:
If a filter with bad words etc. isn't what you mean, you could put an extra field in the DB, called 'OK' or something like that. When someone enters a message in the GB, the initial value of...
1
by: Rune Runnestř | last post by:
Hi, I have made a small program that doesn't work quite the way it should. It is a guestbook for the web, where visitors can write back their greetings. The program consists of 3 files: -...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
1
by: Viken Karaguesian | last post by:
Hello everyone, Just wanting some advice. I'd like to start removing the Microsoft-generated guestbook (a feature of FrontPage) on my websites but I'm not sure if it can be done just using HTML....
6
by: Mathieu Maes | last post by:
Hello everyone, I have created a simple guestbook for my bandsite (http://www.thefirm- online.be). As you might expect, some spambots have jumped on it as soon as it went online. At the moment,...
4
by: infoseekar | last post by:
HI Guys I am a beginner. I am trying to create a guestbook. I have the code for it and it is in three parts. Part 1 "dp.php" to open database and make connection Part 2 "index.php" which will...
5
Thekid
by: Thekid | last post by:
Hi, I'm using xampplite and I'm trying to make a guestbook and a forms page where you can post to the guestbook with PHP & MySQL. I got the code from a website but it wasn't working so I tinkered...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.