-
Posts
1,893 -
Joined
-
Last visited
-
Days Won
8
Everything posted by AbraCadaver
-
Might want to pay attention to other posts that you have made: http://forums.phpfreaks.com/topic/282391-whats-wrong-with-my-code/
-
OK, what was it?
-
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)
-
Or, assuming a constant pattern for your string: $new_string = strrev(strtok($string, ' ')) . ' ' . strtok(' '). ' ' . strrev(strtok(''));
-
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);
-
Don't try and modify $rows in the loop. Try: foreach($rows as &$row) { $row['content'] = self::trunc($row['content'], 60); } return $rows;
-
Attempting to understand Win7 Webservice to linux client scenario
AbraCadaver replied to straygrey's topic in PHP Coding Help
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. -
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;
-
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;
-
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?
-
Остави Одговори: Вашиот е-мејл адреса нема да бидат објавени. Задолжителни полиња се означени *, Име, Е-пошта, веб-страница
-
Can the numbers be reused later?
-
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?
-
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.
-
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?
-
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"; }
-
Where do the numbers come from?
-
Looking for the best approach (Setting an order)
AbraCadaver replied to tryingtolearn's topic in PHP Coding Help
Maybe a better way, but you could have a large increment in the order numbers, like 100, 200, 300, etc... -
echo "<script type='text/javascript'>alert('$myInfo Your input is correct');</script>";
-
Form submission prompts encryption message on select browsers
AbraCadaver replied to frshjb373's topic in PHP Coding Help
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. -
What about: echo "<script type='text/javascript'>alert('$myInfo');</script>";
-
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.
-
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 }
-
Call to undefined method PDOStatement::exec()
AbraCadaver replied to taveleiro's topic in PHP Coding Help
Use The Force young taveleiro. -
Call to undefined method PDOStatement::exec()
AbraCadaver replied to taveleiro's topic in PHP Coding Help
Maybe because there is no exec() method: http://us2.php.net/manual/en/pdostatement.execute.php