Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. For starters, $email is likely undefined. Unless you're still using PHP with register_globals turned on, that is. Where is it coming from? Also, it really would be easier to just put the code up here in tags - i very nearly didn't bother going to the link.
  2. Yeah, but CV's post was literally dripping with sarcasm. Edit: Gah, they've got me too. I now seem to be using 'literally' to mean anything but literally.
  3. You are kidding right? Are you kidding in asking that CV was kidding?
  4. To get something from the first page to use in the second request, you'll need to extract the information from the first request. You have the source of the page stored in $result1, so you could use regular expressions to get the data you need (e.g. preg_match). Without actually knowing what sort of information you're trying to retrieve, it's hard to give you any more specific help than that.
  5. Sorry, jokes are hard to spot when you didn't get to sleep till 6 AM :s
  6. That almost certainly had nothing to do with the adverts. I've never ever noticed a problem. I expect you happened to log on at a time when a database backup was being performed - the site does slow down when that happens.
  7. if(!TRACK_VISITORS) means that the if statement will be executed if TRACK_VISITORS is set to false. Though it is currently true, other people using the script (or the same person some other time) might not wish to track the visitors. They can do this just be changing the one line where TRACK_VISITORS is defined. Make sense?
  8. The define statement is used to define a constant. The idea of this sort of thing is that you can change how the script runs very easily. In this case, you can change whether or not you want to track the visitor simply by changing that one definition to true/false. With a single change, all the if statements using that constant will evaluate to either true or false. Another common constant you might see is one that is used for debugging. You might define a constant which is used to check whether or not the script should output error information. The error information is useful when you're developing, but a security concern when the script is live. By setting a constant and testing its value, you can easily change the script to be suitable for whichever environment it is in.
  9. I assume you're logging into a website first and then trying to retrieve some information? You'll need to specify a COOKIEJAR so that any cookies created by the first request (i.e. the session id) can be stored and used in the second request. And no, you don't make two calls to curl_init().
  10. And that's only an option if you happen to have serious oil reserves.
  11. We have it installed on our lab machines. I prefer ubuntu.
  12. I agree, though someone might need to put that fire out at some point.
  13. I don't know, am I? If that's the definition of agentic behavior, then no, I don't necessarily support that. But then again, sometimes I do. Life is a bit more complex than that, and things should be judged on a case by case basis, imo. Agentic behaviour is basically where humans become 'agents'. They no longer take self-responsibility for their actions; rather they obey authority figures regardless of what they're being asked to do. When in this state of mind, humans may well do things their own morals and opinions wouldn't normally allow and don't generally feel any sense of guilt or remorse. I guess it's summed up best as being the "I was only doing what I was told to do" excuse. Some pretty interesting psychological studies; like Migram's or Hofling's obedient nurses.
  14. CV, aren't you supporting completely agentic behaviour here? Seems to me like you're suggesting we should always obey the rules regardless of our opinions and moral standards. Admittedly humans are pretty good at this sort of behaviour, but it hasn't exactly led us to nice places.
  15. You're while statement is closed by the brace on this line: }else{ Evidently you intended to close the while loop first. If you indented your code properly, it'd make things like that a whole stack easier to spot.
  16. As a rough skeleton, you want to do something like this: $sql = "SELECT COUNT(*) FROM yourtable WHERE username='$username'"; $result = mysql_query($sql); if(mysql_result($result,0)==0){ //username doesn't exist //insert username into database //display successful registration message }else{ //tell user that username already exists } //rest of html is shown here Notice that i don't exit at any point. I simply use an if-else statement to control the flow so that the username is only inserted if it doesn't exist.
  17. The problem is that you exit the script execution if there's a row found here: if(mysql_num_rows($sQuery) > 0 ) [b] { exit("$frmName exists please choose another username"); } When you exit, the script stops completely. Nothing else will be executed or output to the screen. Your best bet is probably to rethink your logic a touch.
  18. mjdamato, just fyi: all of this: $strA = strtoupper($a['type']); $strB = strtoupper($b['type']); if ($strA == $strB) { return 0; } return ($strA < $strB) ? -1 : 1; Could be replaced with: return strcasecmp($a['type'],$b['type']);
  19. You're going to have to explain what the problem is as well as posting some code. Is there an error? What happens? What's supposed to happen?
  20. The correct approach would be to check to see if those values actually exist in the $_POST array (using isset) and only execute the query if they do.
  21. I really don't follow what you mean. What's the difference between making a page with a link to your profile and adding in a comment to some other page? And on a side note, i thought all the topics in that forum were being checked by moderators prior to them being displayed?
  22. Which part don't you understand? The glob() function? Did you read the manual link that was provided in the post too?
  23. To be a little more specific, you're going to need to learn some basic PHP before you can really do anything. In the slightly longer term, you're going to need to find out about scraping web pages and extracting information, possibly with some regular expressions. You'll then need to take a look at the GD library for image generation. Though not strictly an absolute beginner's tutorial, it doesn't get too much more basic than this tutorial on loops: http://www.phpfreaks.com/tutorial/php-loops/page1 It covers plenty and is all commented well. If that doesn't do it for you, you'll find tutorials by the bucket load if you google. Of course, before you can use them you'll need some environment to work with. Either register yourself with some free hosting to get started, or you might like to install something like wamp (assuming you're working in windows) to test locally.
  24. Seeing as we're being picky, you don't use a capital after every piece of punctuation.
×
×
  • 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.