First script is done, yay!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ibelimb
Forum Newbie
Posts: 18
Joined: Wed Jun 19, 2002 2:59 pm
Location: New York, USA

First script is done, yay!

Post by ibelimb »

Hey guys,

Finished my firts script! its a guestbook that uses PHP and MySQL to store/retreive data. check it out here and see if you cna find any bugs.

Thanks,
Limb
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

interesting .. after signing your guestbook with only the name and a comment i was redirected to Canon USA
ibelimb
Forum Newbie
Posts: 18
Joined: Wed Jun 19, 2002 2:59 pm
Location: New York, USA

Post by ibelimb »

Ahh yes, forgot to change that on that site's script :X (canon.com was the only place i knew to get the refer script at the moment).. fixed, thanks for finding the first bug! lol

Later,
Limb

EDIT: Man i need to learn to type!
Last edited by ibelimb on Fri Jun 21, 2002 11:09 pm, edited 2 times in total.
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

hehe, glad to help out :lol:
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

i found a bug....use header() instead of meta tag redirects...because i just posted like 4 blank messages...

also, make the name and email required, so i can't post blank things.
ibelimb
Forum Newbie
Posts: 18
Joined: Wed Jun 19, 2002 2:59 pm
Location: New York, USA

Post by ibelimb »

how do i use header()?

and im making it to see if any fields are blank like this:

Code: Select all

if ($name == " " || $email == " " || $site == " " || $comments == " ")

but it dont work, so what can i do to make it halt if a field is left empty?


Thanks,
Limb
User avatar
e+
Forum Commoner
Posts: 44
Joined: Mon Jun 17, 2002 7:07 am
Location: Essex, UK

Post by e+ »

how about testing if there is something in the variable, telling them they need to fill it in and then sending them back.
if (!$name)
{
echo 'You have not entered a name, please do so'
// some funky code to either give them the ability to enter the field here or send them back
}
//more of the same
Ok I admit that's about the worst bit of code snippet ever but it illustrates the point (it's only 7:30 in the morning here and I haven't had any coffee yet 8O )
epsilon
Forum Newbie
Posts: 11
Joined: Fri Apr 19, 2002 10:20 am
Location: Belgium
Contact:

Post by epsilon »

ibelimb wrote:how do i use header()?

and im making it to see if any fields are blank like this:

Code: Select all

if ($name == " " || $email == " " || $site == " " || $comments == " ")

but it dont work, so what can i do to make it halt if a field is left empty?


Thanks,
Limb
use:

Code: Select all

if ($name == "" || $email == "" || $site == "" || $comments == "")
No blank space between the ""
Post Reply