Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Well, you're not trying to use it anywhere so I don't know what to tell you about why it's not working... round
  2. Unless I'm missing something, all you need to do is make an if/else block for those two conditions, put your existing code in the top half, then copy/paste it into the bottom half and make the couple changes you need. Literally if($_SESSION['uid'] == 'X') { // your existing code } else { // your existing code with a few changes }
  3. Your list of $headers needs a Content-Type with charset=UTF-8. "But I have that already!" You did, but then you overwrote it on the very next line. $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion()."\r\n" . 'Content-Type: text/html; charset=UTF-8'."\r\n";Word of advice: don't try to do mail()ing by yourself. Get something like PHPMailer to do that because it will do a better job than you and for less effort.
  4. $_SESSION['photo'] is empty, right? So where's the code where you set it?
  5. The photo isn't set in there. The problem is in the place where you try to set it, not where you try to use it.
  6. The best style (for PHP) is "consistently". I don't care if you put them on new lines or not, just make sure you do it like that everywhere.
  7. Don't implement sayHello() or sayBye() in your Programming class and see what happens. The result you get is one of the main advantages to interfaces.
  8. file_put_contents Depending on your system you may need to give PHP the permissions to create files in whatever folder: with *nix you can chmod 0777 (not optimal but gets you working quickly) and on Windows it... depends. on things.
  9. Put that thought on hold: if you're starting out then you need to use the PDO or mysqli extension. Not the mysql extension and its mysql_* functions: it's been deprecated for various reasons including it being slow and not as feature-rich as the others. The cause of your problem is how you're calling mysql_query(), but that's moot since you'll be changing the database code.
  10. Where is $cue_brand coming from? Is it from outside the function or did you pass it in as an argument? Or in other words, how about posting a bit more of your code? Namely the entire function definition and the place where you call it.
  11. It kinda sounds like a mobile app would be better suited for this. The device will have the camera and app to scan barcodes, and they're portable so the user can simply go over to the battery to look up its information.
  12. ->bids is an array, ->bids[0] is a CpcBid object, and ->bids[0]->bid is a Money object. $adGroupCriterion->biddingStrategyConfiguration->bids[0]->bid->microAmount
  13. Windows uses semicolons to separate paths. Linux is the one that uses colons.
  14. Any particular reason? Probably not. But a combination of reasons may play a part, such as - Rarely ever makes sense in an true OOP sense. When used it generally violates the idea that a class represents an entity by making a class encapsulate functionality, such as adding database connectivity or providing a "default" implementation for an interface. - Ambiguity of having multiple parents. Like, if two parents both inherit from one single ancestor and each override a particular method, which implementation does a child receive? - Lack of a need. PHP has traits which allows you to "import" functions into classes as if they were written natively. (The concept is also called "mixins".) - Awkwardness. How do you refer to a particular parent from a child? parent won't work as-is and you can't use the parent class's name as that looks like a static method call.
  15. Yup. Whitespace is recommended (a single space) but not required.
  16. Yep. You bet. There are tons of scripts out there that are specifically written to match your database tables, show the content exactly the way you want, and most of them will even apply these "filter" things you speak of with no additional work needed on your part! Amazing, huh? All you have to do is search for "php script that does everything I want" and take your pick
  17. You keep trying this idea of yours of executing multiple queries at once, realizing it's not working, and then insisting that you have to do it with multiple queries. You don't, if for the simple reason that it won't work. Run a query to get the "root" headline elements. Loop over that. Inside the loop you can get the individual bits of data you want. foreach headline as $headline { $category = get the category from the $headline $text = get the text from the $headline output whatever you want }
  18. And? What did you do to actually try to get data from the XML? Have you seen the SimpleXML examples in the documentation?
  19. Do separate queries. Because the alternative is looking at each node and figuring out which of the patterns it matches. And that's just silly since you had DOMXPath do all that work for you already only a second earlier.
  20. I meant the code having to do with searching your database. Because that's where the problem is.
  21. Post code.
  22. You're open to SQL injection and it has nothing to do with your URL rewriting (which I don't think you're using quite the way you wanted to use... but more on that later). What's your PHP code?
  23. mysqli or PDO+pdo_mysql. Both are regular extensions that your copy of PHP (or else your package manager) may already have available.
  24. Sounds like homework. What have you tried so far? If you haven't considered Google yet, you should: this problem has a specific name.
  25. If you're wondering, we're waiting for you to actually explain what's going on. What the expression does that isn't "correct". What actually is "correct". What you've tried to do to change it. The kind of things that are all in your head but we, not being psychic, are unable to get at.
×
×
  • 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.