Jump to content

AbraCadaver

Staff Alumni
  • Posts

    1,893
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by AbraCadaver

  1. Might want to pay attention to other posts that you have made: http://forums.phpfreaks.com/topic/282391-whats-wrong-with-my-code/
  2. So if they are really regex expressions being used (if not use strpos()) then if the regex does not contain / then change all eregi() patterns to: preg_match("/$header_injection_regex/i", $whatever)
  3. Or, assuming a constant pattern for your string: $new_string = strrev(strtok($string, ' ')) . ' ' . strtok(' '). ' ' . strrev(strtok(''));
  4. PHP >= 5.3.0 $new_string = preg_replace_callback('/[a-zA-Z]+/', function($m) { return strrev($m[0]); }, $string); PHP < 5.3.0 $new_string = preg_replace('/([a-zA-Z]+)/e', 'strrev("$1")', $string);
  5. Don't try and modify $rows in the loop. Try: foreach($rows as &$row) { $row['content'] = self::trunc($row['content'], 60); } return $rows;
  6. I have no idea what you're asking or why you are using that objectToArray() function. Just post a var_dump() of $result and ask what you want to do with it.
  7. I'll be damned! date_default_timezone_set('America/New_York'); mt_srand(date('Ymd')); $number = mt_rand(50, 5000); mt_srand(); //reset for other calls echo $number;
  8. Not extensively tested, but try: date_default_timezone_set('America/New_York'); $file = 'number.txt'; $date = $number = 0; if(file_exists($file)) { list($date, $number) = file($file, FILE_IGNORE_NEW_LINES); } if((time()) > strtotime('+24 hours', $date)) { $date = strtotime('midnight'); $number = mt_rand(50, 5000); file_put_contents($file, "$date\n$number"); } echo $number;
  9. So you are going to use a random number for the number of changes? So this is not meant to be accurate? Just something to get them to download the pdf?
  10. Остави Одговори: Вашиот е-мејл адреса нема да бидат објавени. Задолжителни полиња се означени *, Име, Е-пошта, веб-страница
  11. Well, I meant the rules or conditions pertaining to the numbers. I guess I'm trying to get more information. When does the 24 hours start? Midnight? Noon? Another time?
  12. No, you would add: $_SERVER['REMOTE_ADDR'] to whatever variable contains the rest of the email message. Maybe $message or something like that. Post the email message code and it should be easy.
  13. It's pretty easy to do, but can the numbers just be random? What parameters do they have? Are they any number between 0 and infinity or what?
  14. Well, you didn't state why you think something is wrong with it (I assume it's not working), but: if($ip == '35.235.53.176') { echo "Connection Is Set up"; } else { echo "Connection Is Not Set UP"; }
  15. Maybe a better way, but you could have a large increment in the order numbers, like 100, 200, 300, etc...
  16. echo "<script type='text/javascript'>alert('$myInfo Your input is correct');</script>";
  17. I have no idea about Magento but I just did a quick magento getUrl( Google search and came up with possibly the _secure parameter. So maybe: getUrl('ccfp/form', array('_secure' => true)) Just a guess based on the docs. There is also a _forced_secure.
  18. What about: echo "<script type='text/javascript'>alert('$myInfo');</script>";
  19. Yes, but try and steer him in the direction of not using regex if it is not needed. As you know strpos() will be much faster than preg.
  20. Well make it a link to another page like project.php and pass it the 1 parameter but I'm not sure where you get the 1 one the original page. Is there a projectHuvudId column in the huvudProject table or does the 1 come from the categoryProject column? echo "<li><a href='http://www.testlink.com/project.php?id=" . $row['projectHuvudId'] . "'>" . $row['huvudProjectName'] . "</a></li>"; //project.php if(isset($_GET['id'])) { $id = (int)$_GET['id']; //SELECT * FROM `project` WHERE `projectHuvudId` = $id }
  21. Maybe because there is no exec() method: http://us2.php.net/manual/en/pdostatement.execute.php
×
×
  • 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.