Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Why do you have to replicate that? Putting the end tag on a newline changes the content: it's not an empty node anymore but a node with a bunch of whitespace as its value. Whatever. Try regular expressions to replace "the beginning of the line, whitespace, and " with "the whitespace, , newline, the whitespace again, and ". preg_replace('#^(\s+)$#m', '$1\n$1', $xml)
  2. "xmlfile.xml" is not XML. It is a filename. curl_setopt($curl, CURLOPT_POSTFIELDS, file_get_contents("xmlfile.xml"));
  3. cURL is the easiest. Find a quick primer on it (it's not difficult to use) and pay attention to the CURLOPT_POSTFIELDS setting. Your code should look something like $curl = curl_init("https://w3s.webmoney.ru/asp/XMLTrans.asp"); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, "your xml here"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); curl_close($curl);
  4. As long as you don't expose to the user the ID you're using to find profile information, which you shouldn't do anyways because you're displaying the currently-logged in user regardless, then it's fine.
  5. Well duh, "AdminLevel = 6" is very different from the "AdminLevel set to 1 or higher" you said you wanted.
  6. Put that restriction into your query.
  7. DOMDocument. Forget regular expressions, forget breaking it apart with string functions, and just use DOMDocument. getElementsByTagName() to get all the links, then loop through those and grab their href attributes.
  8. "SELECT 1 FROM tblmainfile WHERE title = '" . mysql_real_escape_string($_POST['title']) . "'"If that returns anything then the title is already taken. "INSERT IGNORE INTO tblmainfile (the rest of your insert query)"If the affected_rows count is == 1 then it inserted as a new title, otherwise there was a problem that probably meant the title already exists (as in someone made a new one in between the time it took you to do the first SELECT and to do the INSERT). Don't forget the unique index on the title. Side comment: Are you using mysqli? You included mysql_real_escape_string() in your code but mysqli_query() as well. If you're using the mysql_* functions then stop and use mysqli or PDO instead; if you're using mysqli then don't use mysql_real_escape_string() and use prepared statements instead.
  9. Are you able to start the service manually? Have you verified that it installed with the correct information?
  10. Is that even a possibility? What request are you sending? I'm trying to find documentation about the response but it's practically impossible without knowing what the request is.
  11. Would certainly help to know more than just // Here we get groupname and item_info for each row.
  12. $('#eip_on').on('click', function(event){That will find all the existing elements with id=eip_on and attach onclick handlers to them. Your code creates and destroys those elements in the handlers so the new ones don't exist when the handlers are being attached. .on() Rather than bind the handlers to the eip_on and eip_off elements, bind them to a parent element that doesn't change, like #eic_block, and use a selector to pick which descendant elements actually trigger the event. $('#eic_block').on('click', '#eip_on', function(event){
  13. if the person is searching for a user { grab all the users that match that search, with or without pagination } else { grab all the users, with or without pagination } display those users
  14. Use a query, not PHP and definitely not some hybrid of SQL and PHP (like you have there). - Use a SELECT to check in general whether the "title" has been used. - When you're ready to save the new thing, do an INSERT IGNORE and check the affected_rows to see if it was inserted. Make sure the title has a UNIQUE index on it. If it inserted then great, otherwise do whatever your "title already exists" action is.
  15. Internationalization, huh? Is there somewhere already a place in your system that "defines" COM_COMMUNITY_LANG_NAME_IRELAND to be Ireland? Maybe in the database? Configuration files? It might also define that for a specific locale/language, like it's Ireland for most English speakers but Éire for the Irish and Ирландия for Russians.
  16. If you had checked the PHP Coding Help forum, where this thread is now located, you might have seen the README: PHP Resources & FAQs sticky which has
  17. If you're not sure how to make a payment gateway then you probably shouldn't. There are plenty of services out there that have done the work for you already.
  18. 1. No. 2. ob_end_clean If you have output buffering enabled then this will end one of them (not all, in case you have more than one active) without outputting anything.
  19. Solution to what? Not quite: you missed the big red "This is NOT a help forum! Do not post topics asking for help that are not related to the website." notice at the top of the forum. But the thread is here in PHP Coding Help now so no harm done.
  20. How about a question? Maybe "Why doesn't the sum change when I type?" Or how about "Why do I get 43 instead of 7, and 103 instead of 13?" And post code while you're at it.
  21. And your code would be...?
  22. I haven't been able to get it to appear at all. Are you sure that with Exec() and running ffmpeg directly (not cmd) it appears for you?
  23. 1. a || b will "return" the first value that is equal to true. Since you are doing true || true then it will actually return true. 2. No, you can use it with anything. Some Javascript libraries use statements like var a = b || {}; which will assign "a" to "b" (if set) or an empty object (if not set). 3. In most languages partially: in every other language I can think of a || b will return true or false if any of the arguments are true, rather than returning the first true-ish value. 4. Short-circuit evaluation is where the language only evaluates as little as possible to determine the result of the expression. That is, given a || b where if either argument is true then the expression is true, if "a" is true then it doesn't matter what the value of "b" is so the language won't even bother evaluating it. It allows you to write expressions like denom != 0 && num / denom > 0 without accidentally dividing by zero.
  24. Turn [a-z0-9-]+which says "at least one letter or number or hyphen", into [a-z0-9]+-[a-z0-9-]+which says "at least one letter or number, then a hyphen, then more letters or numbers or hyphens".
×
×
  • 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.