Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. To help prevent SQL injection, you should start looking here: http://php.net/manual/en/function.mysql-real-escape-string.php You should also look through some of the other resources available through Google: https://www.google.com/search?q=php+sql+injection
  2. With regard to the error, see the notes about session_start() here: http://php.net/session_start
  3. Once AddGraph has done it's thing, it could call another method to close the tag.
  4. Instead of calling the AddContent method directly, the AddGraph method could perform the call. Side note: some of the basics for creating classes in PHP have changed. For example, "var" is no longer required. More information can be found here: http://php.net/manual/en/language.oop5.php
  5. If you don't want the page to reload, you'll need to use something like JavaScript to populate the fields based on a drop-down selection. If you need to pull information from a database, you could use AJAX to connect with a PHP script. Or you could look into pre-loading the information into JavaScript. What in the form are you trying to auto fill?
  6. To center content blocks on the screen, you could define the width of those content blocks and then use "auto" for the left/right margins to center the blocks. Here's a quick example: <html> <head> <style type="text/css"> .centerContent { color:#FFFFFF; background-color:#000000; margin:0 auto; width:600px; } </style> </head> <body> <div class="centerContent"> <ul> <li>Item 1</li> <li>Item 2</li> </ul> <p>Paragraph goes here</p> </div><!-- centerContent --> </body> </html>
  7. To change your signature on PHPFreaks Click your username (NebuJohn) in the upper-right corner of the website Click My Settings Click Signature
  8. Sorry, it's unclear what you're asking. If you're looking to redirect to a different page, try using header redirects: http://php.net/manual/en/function.header.php Just be sure to use the header() function before any output to the screen. If you're looking for something else, please describe the issue a little further. Are you getting errors? If so, what are the exact errors? If you post more code, please surround it with tags. This makes the code and your post easier to read.
  9. The links for both file() and in_array() provide examples. You just need to put the pieces together.
  10. You could try using array_diff() to get the difference. And then adapt the solution provided a few days ago to get unique domains: http://forums.phpfreaks.com/topic/284098-pick-a-random-email-address-out-of-a-maillist/?do=findComment&comment=1459187
  11. Nevermind....I just re-read the question and noticed my solution doesn't quite meet your needs.
  12. You could try reading the file into an array with file(): http://www.php.net/file You could then use in_array() to check if the code exists: http://www.php.net/in_array
  13. Does array_diff() return the desired results? If so, you could assign the results back to the variable holding list 1.
  14. Or you could just use file_put_contents() and file_get_contents(): http://www.php.net/file_put_contents/ http://www.php.net/file_get_contents/ Did you visit the link? It's used to write to text files.
  15. So are you just wondering how to write something to a text file? If so, check out file_put_contents(): http://us1.php.net/file_put_contents
  16. Have you looked into array_diff(): http://us2.php.net/manual/en/function.array-diff.php
  17. Have you tried echoing the other variables to see if they contain expected values? As $chachg_time changes, for example, you could add the following to see what it contains: echo '<pre>' . print_r($chachg_time, true) . '</pre>';
  18. Topic moved to the Website Critique forum.
  19. I think the issue is that you were originally passing 'l' to the date function which gives you a value from "Sunday" through "Saturday". Have you tried "j"? $today = date('j'); That gives you the day of the month 1 to 31.
  20. For validating email addresses, you'll want to review the following: http://php.net/manual/en/filter.examples.validation.php
  21. @grucker - When posting the code, please surround it with tags. It makes the code and the post easier to read.
  22. For that JavaScript line, it looks like you need to escape all the single quotes. Try (function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute(\'data-cfemail\');if(a){s=\'\';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
  23. FYI, Dreamweaver also indicates that you have an extra comma in the if statement here: if (!filter_var(trim($_POST['email']),, $email1)){ echo 'Email is incorrect'; It also doesn't like this line: (function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute(\'data-cfemail\');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})(); Perhaps that will narrow things down.
  24. You should be able to copy/paste the code blocks, but yeah it can be a lot of work. Bug hunting isn't always fun.
  25. Perhaps your server is set to hide errors. In addition to enabling error, try adding a line to display them: error_reporting(E_ALL); ini_set('display_errors', 1); If you still don't see any errors, you could try removing all the code which prevents the page from running. Then slowly add everything back (one block at a time) until the page breaks. That should help you figure out which block of code is causing the error.
×
×
  • 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.