Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. That's a pretty stupid argument. Most computers come with a couple of card games installed; why bother installing any other games? Windows computers come with IE pre-installed; why bother installing firefox? Because you prefer it you say? Yeah, but, IE was already installed...
  2. You'll need to pass the user's name/id in the URL like so: http://yoursite.com/image.png?userid=1 You'd then grab that out the URL and select the relevant information to display (presumably from your database?).
  3. AddType application/x-httpd-php .gif As mentioned, you ought to keep that in a separate folder with these images and make sure you don't have any ordinary gifs in the folder.
  4. The information in HTTP_REFERER is unreliable at best. It can be spoofed, though I doubt that it is your issue. However, browsers (well, decent ones) can be set to not send this information and some firewalls will block it too. So, it's not really a limitation of PHP. The data must be passed by the user-agent and some elect not to.
  5. Well, it sounds like you've actually got two separate questions. To display the time since last login on their profile, it would be a simple case of selecting the last login from the database (that is, of course, assuming you have this data. Otherwise, you can't do it) and taking it away from the current date. As for sending notifications after a year of inactivity, your best bet is a cronjob. The idea is that you set a php script to run every so often, which would select engineers who have not logged in during the last year. You'll have to decide how frequently you'd like this to run. Given the timescale, I guess every week or so would be adequate. So, i suggest you readup on cronjobs.
  6. And the problem with that is...? You can force apache to parse other file extensions as PHP but without knowing what the actual problem is, it's a bit hard to offer you better help.
  7. LOL. Nowhere is this price-lowering mess seen better than in the food industry. A typical arugment with someone: Me: Why are you buying that supermarket chicken? Them: Because it's cheap Me: But it tastes like crap, is full of water and has nothing good left in it Them: But it's cheap Me: Well, no, its not. It's cheap because it's full of water and will shrink to a 1/4 of it's size when you cook it. Buy that butcher's one. Them: But it's expensive. And so on ad infinitum. I'm pretty sure you used to eat something that tasted good and was good for you. Now you just eat something.
  8. That's not really an explanation. One last time: why is that your requirement?
  9. If you're confused about magic methods, see here. They're going to need to be public, since they'll need to be called from outside the class. The default is public, so you don't need the public keyword, but it's probably a good habit to have.
  10. No doubt you're getting an error that says you can't mix GROUP and no GROUP columns without a GROUP BY clause? Try adding one. Also, you can make your query a bit shorter by using an alias for your table names: $query = "SELECT v.organization, v.city, v.region, v.country, DATE_FORMAT(v.dateTime, '%m/%d/%Y %l:%i %p'), v.visitorID, v.searchWords, COUNT(h.hitID) FROM visitors as v, hits as h WHERE v.customerID='$customerID_ck' AND cast(v.dateTime as date)='$sGMTMySqlDate' AND h.visitorID=v.visitorID GROUP BY h.visitorID ORDER BY $sort LIMIT $start, $displayToday";
  11. Variables inside single quotes are not evaluated. They are treated as literals. That is: $foo = 'bar'; echo $foo;//echos bar echo "$foo";//echos bar echo '$foo';//echos $foo So, wrap your $sql string in double quotes. It'll also then save you the headache of escaping all those single quotes inside your query.
  12. Indeed. You want to be rewriting .xxx to .php. However, you're still going to have .php appearing in the url for every link a user clicks, unless you intend to go through every page changing all the links. The obvious question: why bother?
  13. I think your ternary operator is a bit confused. There's no condition being evaluated. Unless you meant to compare $data['birthDate'] to $birthDate? In which case, that assignment operator (=) needs to be an equality comparison operator (==), and you need to be assigning the value to a variable (or echoing it, etc). But yes, if your field is a date field, the format is YYYY-MM-DD, so will be generated by date('Y-m-d').
  14. As suggested, if you want to improve your results, look into full-text searching. As for things like 'Jasom' finding 'Jason' it would be possible to look into sound matching (both 'words' have the same soundex value). I seriously doubt it's worth it though. Just return the user to a 'no results found' page, and ask them to check the thing they searched for. Edit: Should also add, im not entirely sure of how useful any sound matching would actually be.
  15. don't you have to add the app inorder for it to receive any other information than name, picture and status, which can be viewed by everyone anyway? Unfortunately not. It's been demonstrated that applications may be able to grab more personal information that you've elected to show. Edit: I spose i should back up my point. See this article
  16. For detecting links in a piece of text, you'll need to do some reading into regular expressions. If you google for php bbcode tutorials, im sure you'll find a relevant introduction to this sort of thing.
  17. Indeed. Make the link refer to the current page. You'll also want to allow for anything that might already be in the URL. Something like this: <?php $page = $_SERVER['PHP_SELF']; $act = "act=click&imageid=1"; if(empty($_SERVER['QUERY_STRING'])){ $page = $page.'?'.$act; }else{ $page = $page.'?'.$_SERVER['QUERY_STRING'].'&'.$act; } echo '<a href="'.$page.'">Clicky Clicky</a>"; ?> You'd then use something like this to check to see if the action is click: if(isset($_GET['act']) && $_GET['act']=='click'){ //add to inventory }
  18. Well, what do you have so far? This isn't really a place for us to do everything for you. If you're after that, i suggest you head on over to the freelance forum. This section is for helping you with something you're trying to do yourself.
  19. Well it rather depends on how you want it to work. If you want it all to be done without a page reload, you'll ned some AJAX. If you're happy to have the page reloaded, then you'll need to make the image a link.
  20. Yup. I suggest you output a link to a delete page and pass the ID of the vehicle (which you hopefully have) to the page in the URL. It'll then be a case of something like this: <?php $id = (int) $_GET['id']; mysql_query("DELETE FROM yourtable WHERE id=$id"); echo 'Vehicle successfully deleted ?> Of course, you may wish to use checkboxes instead so that more than one vehicle can be deleted at a time. Also, please remember to use tags around your code.
  21. Two options: You either must specify the actual indexes of the arrays like so: curl_setopt($ch, CURLOPT_POSTFIELDS, array('cat[1][0]'=>"washington", 'cat[1][1]'=>"jefferson", 'cat[1][2]'=>"adams")); This is necessary because you cannot have two elements of an array with the same key. By specifying them as you were, you were just overwriting the value each time. Your second option is to specify the postfields as a string like this: curl_setopt($ch, CURLOPT_POSTFIELDS,'cat[1][]=washington&cat[1][]=jefferson&cat[1][]=adams');
  22. I would just do the entire thing in your query: $result = mysql_query("SELECT * FROM customers WHERE `date` > CURDATE() - INTERVAL 3 DAY,$con); FYI, the mail() function wont be much use for large volume emails.
  23. Firstly, I find it incredible that google (or, indeed, facebook) didn't think that this kind of thing would be a target for malcious users. Did they seriously not stop to think that opening up their site to other people's content in this way might be a security risk? That said, im not going to be losing any sleep over it. I highly doubt any decent gadget would be malicious. And given that i'm not going to be adding any crappy ones and that the gadgets are rated, I don't see it being too much of a problem. On the otherhand, it's been shown that facebook is a touch more vulnerable. Applications that can grab my details just because a friend was naive enough to add it? Not good. Lastly, this kind of thing is still relatively new. It's natural for flaws and security problems to be found in new ideas. Given the model that the big sites are working with (i.e., anybody can submit gadgets/applications) it would not be possible for the site to check everything that's submitted. As long as there aren't gaping security holes all over the place, I think the chance of the odd bad egg is worth paying for the much richer and customisable experience.
×
×
  • 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.