Jump to content

requinix

Administrators
  • Posts

    15,072
  • Joined

  • Last visited

  • Days Won

    414

Everything posted by requinix

  1. You can't. Which is why you'll have to come up with something that lets you (and mod_rewrite) tell the difference.
  2. Use a JOIN, like JOIN this table again ON this table's parentid = the joined table's id and include this table again.name as one of the fields you retrieve. Throw in a few aliases while you're at it.
  3. Do you have access to anything related to cron?
  4. Can you not fix the links to output in the right form?
  5. Good, because I didn't want to try explaining things if you didn't care about it (no offense, I'm just lazy). You're looking for the exact string "" (case-insensitive). Regular expressions are overkill for that, but you need a count of matches and there is no built-in PHP function that can do that*. So now you have to create a regular expression meaning "literally ''". Two things: expressions need delimiters and [ and ] are special characters. What you had before "worked" because preg_match() accepts a [] pair as delimiters, but that meant you were actually only searching for "img". If you had the string To use img tags use "[img]". there would have been two matches. So the slashes in the expression are the new delimiters, preg_quote() turns an arbitrary string into something safe for regular expressions (turning the [ and ] into \[ and \]), and the /i flag means case-insensitive. Now that you're in the Regex forum, take a look at the stickies we have here. * substr_count() is case-sensitive.
  6. Get the dates as timestamps, like what you get from mktime() and strtotime(), and just subtract the two. Timestamps themselves are seconds so the difference between them is also in seconds.
  7. preg_match does much more than just look for a simple string. It requires you to actually learn how to use the function rather than just throw stuff at it. if (preg_match_all("/" . preg_quote($string) . "/i", $paragraph, $matches)) {
  8. This topic has been tr///ed to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=354498.0
  9. You don't need the is_numeric() check because you just floatval()ed it. It will be numeric. Or if you want to reject the request because it wasn't numeric (probably a good idea), move the is_numeric() to before you floatval() it.
  10. You intval()ed it. There's nothing else you have to do - including is_numeric() on it, because it will always be numeric (you made it so).
  11. You're missing parentheses. As well as a description of your problem. It's nice to include that so we don't have to guess at what you want.
  12. If you have multiple inputs with names like "area" then PHP will create one $_POST["area"] and overwrite it for every one in the form. However you can name them with a special array syntax and $_POST["area"] will be an array rather than a single value. You can extend this to multiple arbitrary array keys (so long as there's at most one "[]" and it probably has to be at the end). With that second syntax, "0" would be the ID number of the row, otherwise you'd have to put the ID in the form in its own special hidden field. foreach ($_POST["area"] as $id => $area) { // update #$id, set area = $area }
  13. This topic has been belatedly moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=354420.0
  14. It does mean "last", as in "this is the last rule for this cycle, don't process any more". Thus mod_rewrite will do the redirect, the rule won't match the next time around, and the silent URL rewriting proceeds as normal.
  15. Huh. Right. It would. Derp. Two rules. RewriteEngine on # generic HTTPSify rules, but only gets applied to the profile stuff RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} !profile\.php RewriteCond %{REQUEST_URI} /([^/]+)/([^/]+)/([^/]+) RewriteRule !\.(gif|jpg|png|css)$ https://%{HTTP_HOST}%{REQUEST_URI} [L] # URL rewriting RewriteCond %{REQUEST_URI} !profile\.php RewriteCond %{REQUEST_URI} /([^/]+)/([^/]+)/([^/]+) RewriteRule !\.(gif|jpg|png|css)$ profile.php?shopid=%2&shop=%3
  16. Add a RewriteCond %{HTTPS} off and change the destination of the RewriteRule so that it goes to the HTTPS location.
  17. Use whatever phpMyAdmin offers for uploading and importing. What I gave is (apparently) not what you'd need to use.
  18. Does the remote software offer any logs you can look at? Are the two machines the last in the "list" or are they located at random within? If you shuffle the "list" does the situation change? In your shoes I would be trying three things: finding more information (eg, logs, adding whatever debugging/verbosity options you have available), looking for patterns and similarities and differences (eg, two machines on a different subnet, not all running the same software with the same settings), and trying to change the outcome by manipulating the circumstances (eg, running the commands manually, rearranging lists).
  19. Running the same command PHP tries to run: $ /var/www/html/slot_uptime/telnet_pots.sh $msan_ip $slot > /var/www/html/slot_uptime/uptime_pots.txt (after substituting values for those two variables, of course). And as a sanity check, echo out that command and make sure it is what you expect.
  20. So it works when you try the bash script manually? What if you try manually running the exact same command the PHP script runs?
  21. Simply calling rename() will have absolutely no effect on the HTML or CSS your script generates. The problem is elsewhere. Look at the actual HTML and CSS, before and after, and see what has changed that shouldn't have changed.
×
×
  • 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.