Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. I generally don't spell it out but maybe I should: Did you include the RewriteEngine directive? It's necessary for absolutely anything having to do with mod_rewrite so I hardly ever bring it up (it's implied and I assume people have already done enough research to know that). The complete example, with a small modification, is RewriteEngine on RewriteRule ^/?index.php - [L] RewriteRule ^ index.php [L] RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [L]
  2. Make direct_download.php add the location itself. As in $location = "http://www.myserver.com/" . $_GET["file"]; By the way I hope you're validating that filename before blindly using it.
  3. Perhaps you missed it?
  4. Think of it in a slightly different way: don't rewrite /index.php, do rewrite everything else to /index.php. Note how the domain name doesn't matter (unless you want it to). RewriteRule ^index.php - [L] RewriteRule ^ index.php [L] Or I think you might actually want to be rewriting anything that doesn't exist, that way images and CSS and those things will be served correctly. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [L]
  5. What have you tried so far?
  6. If anyone's wondering, $titles = $this->titles_model->get_titles(array('title_status' => array(1,2,3))); for($x = 0; $x < count($titles); $x++) { $titles[$x]->title_status_name = $this->titles_model->get_title_statuses(array('titles' => $titles[$x]->title_status_id)); } If you just need one of the members of the object then just get that one member and discard the rest.
  7. $input is the random string. You generated it a few lines before. All you do with it is repeat it $multiplier times. If you want a different random string each time then you have to repeat the part that generates it.
  8. No, you won't have to start from scratch. 1. Make an array of table fields and CSV header names, like $mapping = array( "closeddate" => "Closed Date", 2. Read the first line from the file. This is the header row 3. Build an array that will map the table field to the value in the row. If the CSV had "Closed Date,Street Number,Sold Price" as headers then the array would end up looking like $fields = array( "closeddate", "streetnumber", "soldprice" ) 3b. Optionally validate the $fields. I assume there are some things that are required? How do you want to deal with unknown headers? Consider that someone might incorrectly use "Close Date". 4. Read data rows from the file. Your INSERT then uses $fields for the list of fields to insert into and the $data as the actual data values. "INSERT INTO carbon_PA (" . implode(", ", $fields) . ") VALUES (" . /* data */ . ")"
  9. Content Submissions and Website Policies:
  10. So include the result if there's a $name and it matches, or include the result if there was no $name given? if ((name is given AND it matches) OR (name is not given))
  11. Because it's hard to tell the difference between and on that light blue background. Easy to just scroll past one. Maybe larger/pointier or a different color? And yes I could use the "items I participated in" filter if I wanted to find those specifically, but refreshing the New Content page (where I pay more attention to reply counts) to see new content is much simpler. And I'm loving the Automatic Title Casing Of Thread Titles :-\ But that "new" bothers me.
  12. Lemme be a little more clear: the value you want is in $_POST["mylog"]. $mylog, as the error message indicates, does not exist.
  13. $move is a string, not a number. You need a number. I don't know where you have to get it from but you have to get a number. Also, . is for string concatenation and ++ is for incrementing numbers. They are operators.
  14. Without knowing the exact values of $siteurl and $urllink, I'd say that you probably should be using stripos instead. If you actually need regular expressions then (1) use preg_match and (2) you have to fix $siteurl so it's a PCRE expression.
  15. You're doing it right on the line immediately above: $_POST["logname"] But the field's not called "logname", of course...
  16. When you use only $stmt->execute() and $stmt->fetch() you have you fetch all the results before you can run any other queries. That's what is out of sync: running a second query while the first query isn't done sending data. Fortunately all you have to do is buffer the results. Even more fortunately you don't have to do it yourself: call $stmt's store_result after you execute the query.
  17. move_uploaded_file() lets you specify any destination filename you want. If it's supposed to be numbered like "1.png" then do that.
  18. You don't have to do anything to the string. If you "need" to escape the $s then there's something wrong. The code should be as simple as $user_input = 'test123'; $hash = '$6$rounds=50000$86f50a6ac3d0839a$6oapcEjXqL5FsAS6Uj6LUeUxHhW3dH1/krfFwQYCOzg8qAHlPSu/Cvtq4p5XSzmi8yQ1g9F3/syAEhlVXKbQS1'; if (crypt($user_input, $hash) == $hash) { // match } else { // no match }
  19. Is there a URL you can share? Or how about posting the entire HTML? Are you sure there's only one element with name=menuitem_home?
  20. I think you may have confused PHP with the ${$salt}$ part but otherwise yes, that's supposed to be there and yes, you do need to store it too. Knowing the number of rounds is not about stronger cryptography but about making it harder for someone to brute-force hashes.
  21. 1. Because you commented out the declaration of the variable. 2. Because when you assigned con=10 you didn't use $this. Which you must do. $this->con = 10;
  22. It's great that you asked for help but asking your question in three different places is not a good way to start. Pick the one most appropriate place - in this case here in PHP Coding Help. What's your full code?
  23. Well I did have to look up how uppercase letters compared to lowercase letters. Learned along the way that no, digits 0-9 aren't actually the digits 0-9 like you would expect. And it's not even the reverse of ASCII too (where digits
  24. It'd be too easy though, once you get used to it. Digits are larger than lowercase letters are larger than uppercase letters. j672W > KjSJ6.
  25. Casting "16,457" to int gives 16.
×
×
  • 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.