Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. As for security, follow all the normal guidelines as a start. You can find some penetration/vulnerability testing tools to check for things like XSS, SQL injection, etc. Also you could post your site on the Beta Testing forum and let people test it.
  2. The server change shouldn't effect anything, as long as everything works the same afterwards. But, if you expect down time you should use an HTTP 503 Temporarily Unavailable header, so that search engines know to try again later and that it is not a permanent problem.
  3. Ok.
  4. Using a multi-dimensional array is no more or less safe than using a one-dimensional array.
  5. PHP6 was scrapped and most of the features were rolled into PHP5.4. PHP5 will be supported for many years to come.
  6. What are the specs of the laptop, and what do you want to do with it? You can run a simple LAMP stack on some pretty lowend hardware.
  7. The only way is to use Javascript's onunload event. It's easily bypassed, so it can't be relied on.
  8. The problem is that strpos() is returning 0 (because that is the position of the match), which PHP is interpreting as "false" (because PHP is a loosely-typed language). You tried if (strpos() === true), but that won't work because strpos() never returns boolean true. It only returns the position (if found) or boolean false (if not found). So, the solution is thus: if (strpos($value, 'MC#') === 0) { EDIT: Actually, if you want to check if "MC#" exists anywhere in the string, you can go with: if (strpos($value, 'MC#') !== false) {
  9. If i understand correctly, something like this should work: <?php $count = 1; echo '<tr>'; while($row = mysql_fetch_array($query)){ echo "<td align=\"center\"><h3><img src=\"". $row['Image'] ."\" alt=\"" . $row['First_Name'] . " " . $row['Last_Name'] . ", " . $row['Prefix'] . "\" width=\"100\" height=\"139\" class=\"docphotos\" /></h3>"; echo "<h3><a href=\"./doctors.php?action=bio&name=" . $row['Last_Name'] ."\">" . $row['First_Name'] . " " . $row['Last_Name'] . ", " . $row['Prefix'] . "</a></h3></td>"; if ($count % 2 == 0) { echo '</tr><tr>'; } $count++; }
  10. It's kind of not-that-useful, though. For example: $a = 'a'; var_dump(isset($a) ?: false); = (bool)true, not "a" It's really only useful if you can do something like: $a = 'a'; var_dump($a ?: false);.But, then you have to make sure the variable is initialized first. So yeah, it exists, but it's not terrible useful. EDIT: If you want to assign a variable, you can do something like: <?php $foo = 'bar'; isset($foo) AND $bar = $foo; But, unfortunately you can't echo that way.
  11. Don't leave us hangin' like that.
  12. This topic has been moved to MySQL Help. http://forums.phpfreaks.com/index.php?topic=364026.0
  13. In addition to my previous reply, try changing LEFT JOIN `users` as f5 to INNER JOIN `users` as f5
  14. ON f4.user_id = f5.user_id AND f5.username = '" . $_SESSION['username'] . "' That should work I think.
  15. How many rows should there be? You have a lot of code going on there. Try reducing it a bit until you're sure everything works. What does this give you? $sql = mysql_query("SELECT courseID, courseName, courseTYRS FROM courses") or die(mysql_error()); echo mysql_num_rows($sql) . ' rows returned';
  16. That really shouldn't be in a template file. You're using Smarty, which means you have an exceedingly easy way to separate application logic from presentation logic.
  17. He's not connecting to MySQL, he appears to be connecting to a game server with a socket. As for you, you probably didn't have the MySQL config set properly. You have to explicitly allow remote connections.
  18. Yeah, I forgot to mention that. Using the class name as the constructor is oldschool PHP4 stuff. PHP5 supports __construct, so use that instead.
  19. I disagree. PHP was not meant to be a strictly typed language, and a lot of things wouldn't work in their current state if it was. There are many other languages that follow suit. I don't think it is a huge deal. As long as you understand the difference between == and ===, you shouldn't ever have any problems.
  20. What do you get by echo'ing $errstr and $errno? Also, you might try raising the timeout to 5 or 10 seconds.
  21. If it is a shared hosting server, the outgoing port is almost definitely going to be blocked. If it is a VPS/dedi you'll need to allow ports through the firewall.
  22. You will need to use an array. You'll have to use an array for $replace too, and the keys have to match up. $search = array( '/\[link\](.*?)\[\/link\]/si', '/\[b\](.*?)\[\/b\]/si', '/\[i\](.*?)\[\/i\]/si', ); $replace = array( '<a href="$1">$1</a>', '<b>$1</b>', '<i>$1</i>', );
  23. You didn't provide the code for your User class, so we don't know what the $this->loggeduser holds. $this->loggeduser = (!isset($_SESSION['userid'])) ? NULL : new User($_SESSION['userid']); Here, you are assigning $this->loggeduser to NULL if the $_SESSION['userid'] is unset. So, in that case, $this->loggeduser->userlevel will be undefined (and thus the error you're getting). What you should do instead is return an empty object with empty values from the User class, or check that userlevel exists first.
  24. This topic has been moved to PHP Regex. http://forums.phpfreaks.com/index.php?topic=363997.0
×
×
  • 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.