Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. You bet. Compare that withclass="Fitting" class="Info" title="View"See a pattern in there?
  2. You can't find anything? It says line 7 and I'm looking at your code right now and there's definitely something there.
  3. Reflection is a lot easier to use. Grab the list of functions and use reflection to get information about them. That can get you pretty much anything you might want.
  4. You want a list of functions? Load up the page in DOMDocument, getElementById() for "quickref_functions" (it's a UL), and from that a getElementsByTagName() with "a" to get all the links. Then loop over that list.
  5. Have you created a page that can show that kind of information yet? Once that's ready you can make this link to it.
  6. Efficiency? You have security problems - only a couple but they're big. Deal with those before you start thinking about efficiency. 1. Table name isn't validated. 2a. Arrays aren't sanitized. 2b. I could bypass your string sanitizing by renaming textboxes into arrays with one element. As for a critique, 1. Not a fan of storing root paths in the session. Where are they set anyways? 2. The code that supposedly "unsets the table name" doesn't (but it doesn't matter unless there's a "table_name" column in the table). 3. Don't include the semicolons in queries. 4. Not a fan of looking for keywords like "created" or "modified" or "password". 5. array_unique() the POST values? What if the values are numbers like "1,1,2" and I want all three? 6. You may not like frameworks but you should use one. Even if it's your own. And use [code] tags when you post code.
  7. Barand, I think that is the request XML being sent, not the response XML. For that "irregular text", are you sure it's text and not XML? Do a View Source of the page.
  8. What formula or specification are you working from?
  9. Do a View Source of the page. See your PHP code? That means PHP isn't running your script. Are you using a .php file extension?
  10. Having never seen the syntax before I'm surprised that var pos = months.indexOf( birthMonth.substring( (0, 3 /3) /3 ).toLowerCase() );is valid, but apparently it is. Anyway, looks like you repeated yourself a bit too much in that call to .substring().
  11. Seems like you don't have PHP installed. Are you making sure to run the file through a web server? Your browser should not have anything like "file://" in the address bar but look like a normal URL.
  12. So you mean that code doesn't work? Looks like it does.
  13. Alter the code that does the upload so that it also updates the session data.
  14. You can't use $_SESSION until you've called session_start().
  15. And the error is... what? Undefined offset?
  16. Everything you do in code will slow down your application (typically only by microseconds). The question is whether it's still worth it. But yes, it is a little more expensive than most functions. PHP has to open up a file and do a lot of regular expression matching.
  17. Now you're joining on the art_id. Isn't that the primary key?
  18. AND t1.artist_id = t2.artist_idYou told it to match on the artist_id too. There's only one row in table 2 and it has artist_id=2 so all you'll get is results from table 1 with artist_id=2 too.
  19. Because whatever you clicked doesn't exist. It's that simple. That could mean any number of possible things at fault: the link is wrong, there's URL rewriting that's changing it to something else, there's code that has a 404, Apache can't see the file...
  20. "keys" is a reserved word. Change the column name or quote it with ` backticks.
  21. Code becomes obsolete over time. Fact of life. Either stuff is actively maintained to keep up with the times or it falls behind and eventually dies. PHP 4 was supported long after PHP 5 came out, and remained in use even longer, and should PHP 6 prove to be as large a change then I'm sure the same will hold true for PHP 5. There is no roadmap for PHP besides what you can overhear in the mailing list and the feature requests in the wiki (especially the RFC section). Don't use bad coding practices and you'll be set for a few years at least.
  22. SimpleXML only allows you to work in a single namespace in a time. It starts in the empty namespace (xmlns="") so if you do $xml->motorways it will try to find a in that namespace. Which doesn't exist in your XML. Use children to switch namespaces. $motorways = $xml->children("tns", true)->trafficConditions->motorways;(You don't need to children() every time after, only the first time really just to change the namespace.) [edit] is a child of . You have to go through that first. Also note that there may be more than one .
  23. Make the download go through a PHP script instead of going directly to the file. That script checks if the user has paid and only outputs the file if they have. The "outputs the file" bit might look like header("Content-Disposition: attachment; filename=\"the name of the file.ext\""); header("Content-Type: application/octet-stream"); readfile($filename);
×
×
  • 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.