Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. when I "Save as.." the filename is in an editable text field, and I can change it. As in, remove the current extension, so it only saves as blah.jpg. If for some reason you can't do that, you can rename it after the file is saved, by rightclick > rename or rightclick > properties (windows).
  2. $allowed = explode(' ',$allowed); if (in_array($row['Level_access'], $allowed)) { return TRUE; } else { return FALSE; }
  3. Turn your error reporting on. At the top of your page, put ini_set("display_errors","2"); ERROR_REPORTING(E_ALL); Add ..or die(mysql_error()); to the end of all of your msql function calls. Any error messages display? The error messages from the ..die()'s are pretty straight forward. You should be able to fix it from there, no problem. If not, post the error message. No error messages? Make sure you are using the right column names when assigning the fetch_assoc array data to your "easier to handle" variables. Case sensitive!. Everything line up? Check your database directly to ensure that the data you expect to be there, is there. Run your query directly in the database. Expected info return? Still no dice? Obviously, what we have here is a case of spiderbots feasting on your data while its in transit from the db to your php script. True story.
  4. <?php if (true) { echo "htmlcontenthere"; } else { // do something else } ?> <?php if (true) { ?> html stuff here <?php } else { // etc...
  5. that eregi matches letters, a single quote, a space or a dash. no numbers. It also matches up to 14 chars. Also, you don't want to use eregi, because it will no longer be part of the core in php6, because the posix functions (eregxxx) suck compared to the pcre functions (pregxxx) If the preg_match one didn't work for you, try trimming the posted var first.
  6. Being able to not have to plug something in is so awesome. It's going to make things so much more efficient and less work and wait...no it's not. Okay so it's going to be awesome because now I don't have to restrict myself to where the plug is...no wait, wait, I'm still going to have to restrict myself to a "zone." Well damn, what's so cool about this again?
  7. Sorry dude, but there's nothing there to uniquely identify those things. If there will be no other tables/td tags before that stuff, and the first 4 td tags will always have the stuff you want, you could regex that, by just matching stuff between td tags in general, and just taking the first 4 matches: preg_match_all('~<td>.*?</td>~is',$content,$matches); $info = array($matches[0][0] => $matches[0][1], $matches[0][2] => $matches[0][3]);
  8. I don't even want to know how you know this... Seems like common sense that when the purpose of a bomb is to explode and kill/destroy things, giving some kind of warning i.e. a beep seems counter productive. Anyways, it looks like it somehow found its way there and people weren't sure what it was so they were chillin' and looking at it, taking pics, etc.. (first pic), and someone was taking a pic when people realized it might be a bomb and started running (second pic).
  9. well, what do you mean by wanting it to "work?" You are asking for the best way for one class to "inherit" another class. You need to be a lot more specific with your scenario than how you're being now, if you want any meaningful answers. Depending on what you are wanting to do, you may just need to instantiate an object of your database class, and use that in your new class. Or your situation may call for extending the database class. Or you may end up needing to bust out with an interface. Who knows? Without details, we cannot give you any good advice.
  10. I suggest you post your 2nd question on the smf board. At the very least, you'll probably get a faster answer on where to look, as far as them telling you to do it yourself. But if you're lucky, there might already be a mod for that, or someone willing to make one, since that's what they focus on, there.
  11. are you wanting this new class to be an extension/addon to the database class or are you just wanting to use a database object inside some other class?
  12. negative character classes are just like positive character classes: they only match alternatives or ranges for one character match. So when you do [^\>] you aren't matching anything that's not "\>" you're matching anything that's not "\" or ">" You can use lookahead for that, or you can look at it as "no matter what, the end of the tag is ">" so why do I need to even check whether it has a \ or / there or not?" and just do [^>]
  13. You can still use javascript validation to do a more "live,interactive" validation, like only allowing numbers to be pressed for phone number or zipcode fields, popups saying blahblah isn't right, whatever. But you need to also validate everything server-side, no matter what, so that if the user doesn't have javascript turned on, or turns it off on purpose, or tampers with the coding to get around it, it's still being validated in a place the user can't mess with. You would server-side validate it 100% of the time, no matter what. Just think of javascript validation as a way to reduce requests to your server. Most people aren't out to get you, so you can use javascript to validate their stuff and not have request after request sent to your server before they fill out the form right. If this is on a closed network and you know everybody who will access it and trust them, then by all means, stick with javascript validation if you want.
  14. http://www.phpfreaks.com/tutorial/php-basic-database-handling
  15. I notice in that one you have $friend = new se_user(); in your loop
  16. or just: while($app_info = $database->database_fetch_assoc($app)) { // CREATE AN OBJECT FOR FRIEND $user_info[user_id] = $app_info[user_id]; $user_info[app_info1] = $app_info[app_info1]; //$user_info[app_info3] = $app_info[app_info3]; $user_info[item_id] = $app_info[item_id]; $user_info[profile] = $app_info[profile]; $user_info[name] = $app_info[name]; $user_info[height] = $app_info[height]; $user_info[width] = $app_info[width]+10; // SET FRIEND ARRAY $app_array[] = $user_info; }
  17. okay so what's to stop someone from opening up your output in an editor (or even right there live on your page, with widely available and used puglins), putting invalid data into your fields, stripping out the js validation, and sending along your thumbs up boolean to php? php then happily does whatever it does with the data, expecting it to be sanitized, and next thing you know, your database is dumped and going to www.yoursite.com yields a "J00 G0T PWND BY L337 H4XX0RZ !1!!!!!1111!!!!!!ONE!!11!1!!". If you're lucky, that's all someone will do.
  18. or actually i guess that won't work. how about using an array instead of an object?
  19. For some reason your php5 doesn't like objects being made on the fly like that. Dunno why though. How about just cutting out the middle man though, and just doing this in your while loop intead: while($app_info = $database->database_fetch_assoc($app)) { // CREATE AN OBJECT FOR FRIEND $app_array[] = $app_info[user_id]; $app_array[] = $app_info[app_info1]; //$app_array[] = $app_info[app_info3]; $app_array[] = $app_info[item_id]; $app_array[] = $app_info[profile]; $app_array[] = $app_info[name]; $app_array[] = $app_info[height]; $app_array[] = $app_info[width]+10; }
  20. okay so you print_r before the loop so it's being returned like that. So the next thing I would do is go to the function you posted and print_r($app_info) inside the while loop to see if database_fetch_assoc is returning the right stuff.
  21. I don't know any prefab scripts offhand but you would probably have better luck searching in an ajax forum or ajax focused site.
  22. I don't see anything immediately wrong with that, except for maybe you meant to do $this->user_info[..] = $app_info[..]; on each of those lines. But for the way you have it setup, it should return what you want anyways, so I don't think that's what's causing the error. So...I would fastfoward to whatever is calling that method and look at what's responsible for looping and displaying the $app_array that's returned from this method. If that looks good, I would look in the database_fetch_assoc method.
  23. You aren't actually echoing the vars in your loop. Do: <?= $variable ?> or better yet (for compatibility), <?php echo $variable; ?>
  24. Your problem is probably that you have hyphens listed in your character classes (the stuff between the [..] brackets) but it's on the end. Inside a character class, hyphens are special characters and denote a range from one thing to another. The short, simple answer is that unless you list a hyphen as the first character in the character class, you might get unexpected results. So for instance, in your first character class in your pattern: [_a-z0-9-] change it to [-_a-z0-9] but as premiso posted while I was typing, use preg_match instead, as the posix functions (eregxxx) are deprecated.
  25. or you could possibly str_replace it with the quote you want. or you could possibly look into using utf8_encode or similar (follow the link and similar methods in the manual).
×
×
  • 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.