Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. You could make a function like this: clean($text){ return trim(html_entities(strip_tags($text))); } Then use that instead of three times. $firstname = clean($_POST['FirstName']); You may also want to check for words like "mime-type" as that's a sign someone is trying to hijack an email form. There's plenty of good articles out there about preventing email form hijacking.
  2. You can use that, but if the variable isn't set, it will produce notices when error reporting is set to show notices. It's considered poor practice - it's a bad habit I have and I am still learning how to avoid notices. We'd need to see more of the code to tell if it really is needed here. isset() will return true if the variable is set - but if the variable is FALSE, isset will return true. Just an if() will return false if the variable is false or not set or = 0, etc.
  3. You could use ajax to do that, or just use checkdate() on the date created to make sure it's valid.
  4. Basically what you're saying is there are two forms, and you want to consolidate them into one? Let me take a look at the files and see what the deal is. Edit: both of the forms go back to index.php - We'd need to see that, and I have a feeling it's a whomper of a file. This code doesn't sanitize any user data, it suppresses errors and doesn't check for them... What is it? Like, what did you buy the site for, what does it do?
  5. isset is for checking if any variable is set. What is the actual problem here?
  6. I assume it's in the attached file. You should ask the programmers who wrote it for some support.
  7. If you show us some of the code or a link to the site we can help better.
  8. So you're trying to set headers after you've output text to the browser. You have to do your setcookie BEFORE printing that HTML.
  9. $birthdate = $year.'/'.$month.'/'.$day; To help any more we'd need to see CODE.
  10. $arr = $_POST['alsolike']; print_r($arr);
  11. headers already sent by (output started at /www/cida.ge/doc/index.php:42 What is line 42?
  12. Make the name alsolike[] - this will $_POST an array of the values selected.
  13. Does anyone use a PHP Documentation Generator? I'm trying to decide which one I should use, if any. Any comments on which ones you prefer would help
  14. You need to post your code within the code tags, so we can see what is really going on there. And keep proper indentation.
  15. $member LIKE ('alpha%')
  16. If the name is a string, it needs to be in quotes in your sql. $schoolname = $_POST['school']; $school = mysql_query("SELECT school_id FROM tbl_school WHERE schoolname = '$schoolname'");
  17. Knowledge is so scary, I can see why you'd want to avoid basic knowledge on a technology you're using at ALL COSTS. Good choice. Cumbersome and messy: <cfif Request.ID IS "47"> vs if($_REQUEST['id'] == 47){ I can see how they're so confusingly different and PHP's version is incredibly hard and just makes no sense at all.
  18. Post the new code. A blank screen likely means you have an error. Turn on error_reporting.
  19. You could just print it instead of using an input, that way they won't even try to edit it.
  20. Well there you go, it's called desil, not test... Are you actually selecting any?
  21. I think you need to read some basic tutorials and perhaps pick up a teach-yourself book so you can learn the basics.
  22. echo 'You selected ',$n ,'<br />'; You need . not ,
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.