Jump to content

ManiacDan

Staff Alumni
  • Posts

    2,604
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by ManiacDan

  1. The API you're posting to requires a specific content-type, and you are providing the wrong one. CURLOPT_HTTPHEADER is the option you must use to set the proper content type. Also, why is your XML all encoded like this?
  2. If you believe that question is self-explanatory then your answer is "err...no...?" If you're asking "is it possible to have conditional code inside a class but outside the functions in that class" then the PHP interpreter itself could have given you that answer: trying to do that produces a fatal error.
  3. You have absolutely no idea how to debug a script on your own? What do you do when there's a problem like this? Do you just stare at the screen and pray that you'll see it? I've given you the steps you need to take to start debugging. they were in the list of questions you failed to answer.
  4. You must wrap the entire list in a single form tag, only one form can be submitted at a time. If the problem is now "my site looks all weird," then xyph is right, your problem is a style one not a PHP one.
  5. Sports scores are important and valuable information, you cannot get them for free. You'll have to buy them from someone. I believe Yahoo might sell this information.
  6. Asking "would I use explode" is like asking "how would I climb a mountain, would I use a rope?" Yes, you would...and 5,000 other things. If you want to allow people to select multiples of something, name the checkboxes "selection[]" and put the values as the IDs you want to select. Then $_POST['selection'] will be an array of the items selected. You can loop through them using foreach.
  7. Have you done any debugging of this on your own? Anything at all? Have you dumped the contents of $_GET? Have you done a var_dump of any of the variables in the IF statement? Why do you believe you can dump 100 lines of code on a group of strangers and get your answer? Work for yourself and it will happen a lot faster. Also, bumping threads is against the rules. Show the work you've done to debug this on your own and then we'll help you continue to debug.
  8. Not really, no. Simply putting quotes around it inside the SQL would have been fine, but working is working.
  9. MySQL and PHP are separate languages. Your problem is not in PHP. your problem is that you're building a MySQL string that says: INSERT INTO mytable ( someField ) VALUES ( 19-23 ); That will put -4 into someField. QUOTE YOUR STRING INSIDE THE MySQL QUERY.
  10. What exactly is the issue? Your code works fine for me, it matches the whole TD ... /TD space. If you're actually trying to match INSIDE the tags, you need to add the > and < and use parens to make a capture group.
  11. What does the documentation say about this? Why do you believe data-site= is a valid <div> attribute?
  12. Yes, bare strings are not allowed unless they're constants. Strings must be quoted.
  13. Ok, you need to learn how to communicate a little better. You saw? You tried "some"? What are some? Some of the sorting functions? Why did you try them, and how did you do it? How did you determine they didn't work? What does "work" even mean to you? Did your computer catch fire? Did they come out in the wrong order? Did your monitor go blank? Maybe you can help me with my car while I'm here. It was making the noise, so I tried things, and they didn't work.
  14. Put your <form> and </form> tags INSIDE your loop, that will solve your problems.
  15. When you have multiple inputs of the same name in a form, only the LAST one will be submitted when you submit the form. You must name your input name='id_zamjena[]', then $_POST['id_zamjena'] will be an ARRAY of these inputs. -Dan
  16. Better yet, just use parse_url. Also, your original post was missing the beginning and ending delimiters, which might be why it wasn't working.
  17. fopen does not return true, ever. It returns either a file handler resource or false. According to my chart here, objects of type resource will never be equal to an integer (which is what you're using instead of true/false).
  18. Haha seriously. Also, captain necro has been warned twice, third time's a ban^H^H^Hcharm.
  19. $date = strtotime('-1 saturday'); do { echo date('l F jS, Y', $date) . "\n"; } while ( ($date += (60*60*24)) && $date <= strtotime('next friday') );
  20. I bet their client strips javascript, that's why I said that. They already have a print button, it's right there at the top of their screen. Forcing you to add another one is stupid. Tell them "emails can be printed using the method best appropriate for your email client. As some email clients block such functionality, and some have completely separate printing formats, adding this button would decrease functionality."
  21. Are they not capable of printing the email using their email client? ctrl+p will print in every email client and web browser I've ever used.
  22. Don't suppress warnings, fix them. You were probably trying to process a blank line, which you could skip by adding this to the first line of your loop: if ( trim($var) == '' ) continue;
  23. Also, you may be interested in file as well as file_get_contents
  24. $total = 0; foreach($out as $var) { $tmp = explode("|", $var); $total += $tmp[count($tmp)-1]; for($i=0;$i<count($tmp);$i++){ echo $tmp[$i] . "<BR>"; } } echo "Grand total: {$total}";
  25. I had a guy on devshed once get into a 4 page argument with me and another guy, screaming and calling us names, saying that we were in a gay relationship, telling us he was going to kill us, etc. Real mature stuff (especially for a 70 year old, which he was). When we finally got fed up with the conversation, he went back and edited all of his posts to be reasonable and then quoted-replied against our replies to say that we were crazy. The thread is here if you're interested. It's pretty hilarious to watch arty explode.
×
×
  • 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.