Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
|
|
very proud of this - I love it |
Page: 1 2 | Reply |
Nov 17th 2003 | #129348 Report |
Member since: Mar 29th 2003 Posts: 1326 |
It is for me. So I just won't post empty. But its not hard to check for that. I'll put it in sometime. if (!isset($_POST['title'])) { echo "Put in a title, bitch!"; exit; } tom |
Reply with Quote Reply |
Nov 17th 2003 | #129367 Report |
Member since: Nov 26th 2001 Posts: 2586 |
I would check for empty string values. $string = "" is considered "set", it only checks to see if the variable is existing. Just check if the string is empty: if ( $_POST['title'] == "") { do something } |
Reply with Quote Reply |
Nov 18th 2003 | #129400 Report |
Member since: May 22nd 2003 Posts: 315 |
if(!isset($_POST['title']) || $_POST['title'] == "") { do something //everyone wins today =] } |
Reply with Quote Reply |
Nov 18th 2003 | #129405 Report |
Member since: Nov 26th 2001 Posts: 2586 |
[QUOTE]Originally posted by Doolittle [B]if(!isset($_POST['title']) || $_POST['title'] == "") { do something //everyone wins today =] } [/B][/QUOTE] You can do that, but if you $_POST an empty variable it will exist, it will just be blank. isset() is checking for NULL or a variable that hasn't been initialized. But when you hit submit it initialises the post variable regardless if there is anything in it. |
Reply with Quote Reply |
Nov 18th 2003 | #129426 Report |
Member since: Mar 29th 2003 Posts: 1326 |
Good point. Thanks for pointing that out. I think I might install a profanity filter, too. Should be fun. Working on scripts that are already there is so much easier than trying to make one. :D *edit - Some updates. Name is now optional. Date is auto-included. You have to fill in a post and a title. Yippy-kay-yay! I'm going to mess with presentation now I think. In some nice table with formatting or something. I dunno. :D tom |
Reply with Quote Reply |
Page: 1 2 | Back to top |
Please login or register above to post in this forum |
© Web Media Network Limited. All rights reserved. No part of this website may be reproduced without written permission. Photoshop is a registered trademark of Adobe Inc.. TeamPhotoshop.com is not associated in any way with Adobe, nor is an offical Photoshop website. |