TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-05-2008, 10:48 PM   #1 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default Salve!

Hello!

My name is Gareth Price; I am 17 years of age and am a freelancer. I have been really inactive recently due to work, however :(

I can code xhtml / css proficiently, and have recently started looking into php / mysql / javascript by coding my own forum, which can be seen at SBB Demo (Powered by SBB).

I love some of your articles here and this is what has made me finally join up and post!

See you around, probably with me asking lots of questions!

Gareth.
Gareth is offline  
Reply With Quote
Old 01-06-2008, 10:51 AM   #2 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

Hi Gareth, welcome to TalkPHP :) I Like SBB, looking good.

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 01-06-2008, 01:20 PM   #3 (permalink)
The Contributor
 
Join Date: Dec 2007
Location: Florida
Posts: 73
Thanks: 12
danielneri is on a distinguished road
Default

Hey Gareth, welcome!

Great work on the forum, looks quite good.

I'm almost sure I've seen you somewhere else...did you used to own a site or something?
Send a message via AIM to danielneri
danielneri is offline  
Reply With Quote
Old 01-06-2008, 02:46 PM   #4 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

I own ImgBite.com, and I am on TFL as GarethP. There are two Gareths, the other one owns codedfx, pagehole etc.

Thanks for the welcome.
Gareth is offline  
Reply With Quote
Old 01-06-2008, 02:47 PM   #5 (permalink)
The Contributor
 
Join Date: Dec 2007
Location: Florida
Posts: 73
Thanks: 12
danielneri is on a distinguished road
Default

Ohh I recognized the name as in Gareth owner of CodedFX sorry about that
Send a message via AIM to danielneri
danielneri is offline  
Reply With Quote
Old 01-06-2008, 03:24 PM   #6 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

You aren't the first! T'is okay :)
Gareth is offline  
Reply With Quote
Old 01-07-2008, 11:50 AM   #7 (permalink)
The Reckoner
Advanced Programmer Top Contributor 
 
Karl's Avatar
 
Join Date: Sep 2007
Posts: 437
Thanks: 22
Karl is on a distinguished road
Default

Hey Gareth, welcome to TalkPHP
__________________
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
Karl is offline  
Reply With Quote
Old 01-08-2008, 06:10 PM   #8 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

Thank you Karl!

Just an update on Simply-BB, it can now be seen at

Simply-BB.com
Gareth is offline  
Reply With Quote
Old 01-08-2008, 06:21 PM   #9 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

Hey Gareth, I'm new too, but hello and welcome to TalkPHP. I had to post because I saw the link to your Simply-BB that you posted, and am quite impressed.

A bit of feedback:
1. As Metz pointed out under feedback, you can use the stripslashes() function when outputting posts without compromising security. But you might have done this already.
2. When you post without all fields filled in, try carrying over the $_POST values that were sent. This way, if I skipped the URL field, I still have my post at hand.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
Old 01-08-2008, 06:34 PM   #10 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

I will look into stripslashes() this evening, and thank you for your feedback!

Would there be an easy way to carry over the $_POST values?

Thanks again :)
Gareth is offline  
Reply With Quote
Old 01-08-2008, 06:41 PM   #11 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

Quote:
Originally Posted by Gareth View Post
Would there be an easy way to carry over the $_POST values?
Yup. For each input use something like:
PHP Code:
echo  '<input type="text" value="'.(isset($_POST['name']) ? mySafetyFunc($_POST['name']) : '').'" />'
Quote:
Originally Posted by Gareth View Post
Thanks again :)
No problem, glad to help! If you'd like me to take another look again some time, just send a PM my way.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
Old 01-08-2008, 06:49 PM   #12 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

Ahhh; interesting.. Is this written in "Shorthand" or am I such a "noob" I don't recognise the form?
Gareth is offline  
Reply With Quote
Old 01-08-2008, 07:03 PM   #13 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Gareth, for the (expression) ? if_true : if_false; code, read up on the ternary operator.
Salathe is offline  
Reply With Quote
Old 01-08-2008, 07:05 PM   #14 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

Yes and no, that is the ternary operator. It is an ultra-compact if-then-else statement. Like so:
PHP Code:
(isset($_POST['name']) // this evaluates to true/false in a strict boolean value
?  // this starts the "ternary" statement based off the preceding boolean var or statement (like an if-statement)
mySafetyFunc($_POST['name'])  // if the value was true, then return this
:  // ELSE
''); // Return the default here. 
A ternary statement must have a true and false result, so don't forget the colon. When the whole is wrapped in parenthesis the result of the statement is just a string, which can then be used like a variable. Like above.

For more on ternary operators see Matt83's article on them.

(Rats, beaten by Salathe. And I took time to write this up too. )
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
Old 01-08-2008, 07:14 PM   #15 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

Ahh amazing; haven't seen that before! Thanks guys! I really appreciate it :)
Gareth is offline  
Reply With Quote
Old 01-08-2008, 11:14 PM   #16 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

Welcome to TalkPHP Gareth ;)
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 10:18 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design