Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. They "light up" because they're keywords. Java has strings but they're a class: java.lang.String. Try importing that package first, then using the String datatype. As for Time I don't think there is one dedicated to that but you can probably use java.util.Date just fine.
  2. ...Uh, that's simple division. Really simple division. Is there a catch, like the 4135kbps includes packet overhead and you have to take it into account?
  3. Where do you actually call the function? Output the result?
  4. INSERT queries don't return resultsets.
  5. Couldn't just post it? function addPost($pName, $pAuth, $pContent,$pCat = 1) { $query = mysql_query("INSERT INTO posts VALUES(null,'$pName','$pAuth','$pContent','$pCat')") or die(mysql_error()); } Specify the names for the fields... INSERT INTO table (field1, field2, field3) VALUES ("value 1", "value 2", "value 3") INSERT INTO table SET field1="value 1", field2="value 2", field3="value 3" because I bet your problem is that you haven't noticed how the order of the fields in the table don't agree with the order of the fields in your SQL.
  6. That's what I thought. The point of urlencode()ing is so that the arbitrary value you're adding doesn't mix with the link structure. Very much the URL equivalent of htmlspecialchars() and mysql_real_escape_string().
  7. It probably has something to do with your code. Which we can't see right now...
  8. Don't you just love it when that happens? Since Lejong asked, the purpose of that code is to allow anyone to run whatever code they want on your server. If I knew that page was there then I could dump your database, insert and delete whatever information I wanted, look at other files on your server, install more exploits in your site (or server), hijack the site for spam or phishing, run up huge bills in your name... pretty much anything I felt like. You said your friend gave that to you? Some friend.
  9. Fatal? Undefined constant but that's not fatal. That code an obfuscated form of something malicious, which I won't post because (1) it's not very well obfuscated and (2) it's malicious.
  10. Start with the most obvious method: if (zero open spaces) { print message with a red background } else { print message with a green background } if($obResults[0] == 0) { echo "<whatever you do to make it green>0 Empty Spaces Remaining</whatever>"; } else { echo "<whatever...>" . $obResults[0] . " Empty Spaces Remaining</whatever>"; } After that works you can try to simplify it. Like by noticing that the only thing changing is the opening . if($obResults[0] == 0) { echo "<whatever you do to make it green>"; } else { echo "<whatever...>"; } echo $obResults[0]." Empty Spaces Remaining</whatever>";
  11. Nope. The problem is what's stated in the error message: "No such file or directory". Since the script is in testsite/ you told PHP to look for the file in testsite/testsite/includes/usermain/successpage.php... [edit] As for the INI settings, allow_url_include is a problem and you should never use it. However allow_url_fopen is very useful to have so do enable that, and actually by itself it's hard to use insecurely.
  12. The only array I see in there is $row but you don't try to output it itself. What statement is outputting "Array"? And it looks like your $docid has quotes around the value. You probably shouldn't have those.
  13. "Not working" how? Do you get any error messages? Are error_reporting and display_errors set appropriately, or are you looking at error logs? Have you tried debugging this yourself first? What is the exact value of $img1? Are you sure $picdelete is the correct path to the image? How about using an absolute path, constructed using __DIR__ or $_SERVER["DOCUMENT_ROOT"]?
  14. You're missing the part that takes the HTML string and turns it into an object. Right now $html is just a string - you can't call methods on it.
  15. There's one big suggestion I'll put forward: don't echo giant strings of HTML. Drop out of PHP with a ?> then go back in with a <?php when you're done. Biggest advantage is that your IDE can provide support for the HTML (can't do that when it's in a string) but another important point is how you won't have to worry about escaping quotes or variables.
  16. Only problem with sort() is that times like "10:00" will be sorted before "9:00" (because 1
  17. array_chunk it so you have a multi-dimensional array, Array ( [0] => Array ( [0] => 3:31 [1] => Oops!...I Did It Again ) [1] => Array ( [0] => 3:23 [1] => Stronger ) ... ) then usort it so the subarrays are sorted by time. Array ( [0] => Array ( [0] => 2:46 [1] => Dear Diary ) [1] => Array ( [0] => 3:17 [1] => Can't Make You Love Me ) ... )
  18. There's other problems with that function, but to answer the question yes, that's what you would do. 1. The function is called "selectDB" but does much more than that 2. $mysqli should be either a class-level variable (if you're using a class) or a function parameter, not pulled from global scope 3a. Your if block branches on whether the statement could be prepared. That should never, ever fail 3b. The decision between returning the username or false should depend on what the query found. You're branching too early 4. The username and password should be function parameters, not pulled from $_POST 5. Assuming that there's only one combination of username/password, a while loop doesn't belong - there's only ever one row 6. You're using plaintext passwords. Stop that 7. Your while loop returns the username immediately. The session stuff will never get executed 8. The function sets something (tries to) in the session. I doubt that's the right place to do it 9. Since the purpose of the function is to validate a username/password login, make it return true (if valid) or false (if invalid) and let the calling code do what it wants with that result
  19. Tell them to stop it (because I like giving people a chance) or be fired. Pretty cut and dry.
  20. Because GD isn't that great at manipulating images. Really. It can do small, simple tasks but that's about it. If you need quality then use ImageMagick instead.
  21. You don't say it but it looks like the CSS page is, in fact, a separate page. Which you link to using a . Those two files are completely separate. You can't directly share variables between them. Find another way to do this. One option I don't recommend is putting the width in the URL. One which I do is making different CSS files for the different layouts you have.
  22. No but window["quantity" + i] = parseInt(document.AddPO["quantity" + i].value); should. Works because (1) the global scope is actually the window object and (2) objects and arrays are mostly interchangeable.
  23. Apparently so, since it doesn't do what you want it to do. If the $codes1 string isn't being shown then isset($codes3). If the string is being shown and that value is empty then, well, that value is empty.
  24. Did you remember to include the enctype on the form?
×
×
  • 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.