Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Data "ciphering"? Maybe you mean data siphoning? Honestly, I stopped reading at that point.
  2. It's not actually correct. $get_available_towns[] = $town; $get_available_towns = array();It adds a value to the $get_available_towns array, but then resets it immediately after. The second line should be positioned higher: before the loop even begins. That will set the variable to be an empty array, avoiding warnings about trying to add values to an array that doesn't exist, and then not reset it during the loop. $get_available_towns = array(); foreach ($joiners as $joiner) { $town = explode(',', $joiner['address']); if (isset($town[2])) { $town = $town[2]; $get_available_towns[] = $town; } }Does that maybe clear things up a bit?
  3. Not really. For people to play the MP3s they have to be able to access the files, so you can't block access and keep things working. Serve the files not directly but through a PHP script (one sophisticated enough to handle conditional requests and byte ranges, preferably) which validates access. Not access through the player - you can't tell that for sure - but whether the user has access. The URL can include the session ID if it doesn't get sent by the player automatically, and you can do regular stuff about checking if they're logged in and whatever. [edit] Okay, I focused more on the "cannot be accessed" part and less on the "signed into joomla". You can't deny access and allow access at the same time, but you can deny access unless the user does something (like sign in) and then allow access.
  4. Is it different? They get points on their profile, it puts your name on the post (if you're one of the first), they get a little notification that someone liked their post...
  5. You aren't forced to use an IDE. If you compile your program appropriately you can use gdb as your debugger and step through the entire execution. (There are undoubtedly GUI frontends to it too.) An IDE does basically that but makes the experience much easier - not to mention the other features they can provide that mere text editors cannot. The kind of help you're hinting at though, especially regarding segfaults, is harder to come by. Most of the time you'll only get warnings, if anything, from your compiler; you're expected to know what they mean so the work is to find and fix the problem. GDB can give you more information if you know how to ask it. Sorry you don't like VS. I love it. If there was a (free, stable, up-to-date) plugin for PHP then I would switch from NetBeans without a second thought.
  6. proc_open proc_close You can't just swap the function names around. Read the documentation on how to use them. [edit] Additionally, IIRC, you have to do a little more with PowerShell for everything to run smoothly. Such as send an "exit" command to get the process to quit by itself.
  7. This is something you need to deal with at the machine layer, and you're just not going to get that with PHP. Really, the only way I know that's reliable is in a Windows environment where you can (set up your server to) use things like NTLM and Kerberos authentication. As for the alternatives, - Can't get the MAC address, which can be spoofed anyways - IP address is only unique (potentially) in a LAN environment, but that can be "spoofed" too
  8. The validation isn't working... how? How is it not working? What is it doing and what is it supposed to be doing? Anyways, your validation logic is a bit screwy. If both numbers have values then the sum won't show. Oh, and keep in mind that "0" will be considered empty.
  9. exec() uses a shell so you also need rights on cmd.exe. Alternatively you can use the proc_* functions; they're harder to use but are much more powerful, and can* execute programs directly without using a shell. * with $other_options's bypass_shell=true
  10. You can't have more than one radio button checked in the same group (ie, with the same name). Use checkboxes instead. Note that you need to change the name to "display_type[]": those added []s mean that $_POST["display_type"] will be an array of what was checked. Without the []s you'll only get one value.
  11. Not sure how you managed to avoid the solution when searching for "call to undefined function mysql_connect". You don't have the mysql extension installed with PHP. (Not Apache.) Check your php.ini for a line that looks like ;extension = php_mysql.dllremove the semicolon, and restart Apache. Then try again.
  12. You're pretty close actually. But don't use variable variables. If you want arbitrary variables then you should be using an array with arbitrary keys instead. Then if(isset($array['h'.$x])==false && $array['h'.$x] != 3) {
  13. Your .htaccess has effectively created a rule saying that "/foo" is the correct path to foo.php and that "/foo.php" is incorrect (as it redirects to somewhere better*). Your own website, including its links and forms, should be using the correct paths. While you could actually tweak the .htaccess to allow POSTing to the incorrect location, you really shouldn't be doing that. * That redirect is what's breaking your forms.
  14. Check the documentation to see what the different functions do. sprintf() will format to a string, printf() will output it instead, and number_format() will format a number to be more human-readable. If the number is 5500.0 and you want 55% then you divide by 100, round, and format with a percent sign. You don't even need any of those three functions for it echo "" . round($row['RGP'] / 100) . "%";but for a demonstration, echo "" . sprintf("%.0f%%", $row['RGP'] / 100) . ""; // %f for floating-point, .0 for no decimal placesIf you wanted decimal places, those functions are easier to work with: echo "" . sprintf("%.02f%%", $row['RGP'] / 100) . ""; // .02 for two decimal places: 55.00%
  15. onchange only applies to form elements, but blur should work.
  16. Shared. MySQL isn't going to look at your data and say "oh, this is the exact same as off in this other table" and then reuse results. That's your job, and by that I mean not having the same data in multiple tables.
  17. DECIMAL(5,2) for a percentage? Wtf? printf, sprintf, or number_format, possibly with a little bit of math (like some division) will do what you need.
  18. Find your php.ini and set error_reporting = -1 display_errors = onrestart your web server, and try your script again. You'll likely get errors to the tune of being unable to send headers because output started. I'm guessing on line 1. Can't use header() if there has been output.
  19. We don't really like deleting stuff. What we would like is if you shared what you had to do to fix your problem. And while I'm here, next time please actually describe the problem ("it's not working" doesn't mean much) and use tags around your code.
  20. addslashes() no, stripslashes() no, mysqli_real_escape_string() only if you can't use prepared statements instead. Which you can (mysqli provides that functionality). So no to that one too.
  21. HTTPS typically uses a different VirtualHost configuration file. You need to make your include_path modifications in both places.
  22. For thread::canView to be compatible with forum::canView it must take two arguments - like its parent does. With a couple exceptions, but none of those include adding a third required parameter. $powerLevel is a property of the thread, right? Since this method is inside the thread code, you should not take $powerLevel as an argument but instead get that from the thread's data (whatever and wherever that may be) automatically.
  23. And you think something's wrong because... What's happening and what's supposed to be happening?
  24. Numeric arrays don't make sense at the top level. If one of the options was a numeric array then that's different but you'd probably need special merging logic for it specifically.
×
×
  • 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.