Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. Your echo statement can be used with the ajax. For example if they hit 'yes', you can send to your php script script.php?n=yes and then it can simply echo that line as normal, but echo in ajax, means that ajax will take that echo and place it into the result body (as you'll learn from an ajax tutorial..)
  2. It would help if I knew the array structure. I'm sure it's in a simple format, if you could post an example of the array json_decode puts out (using print_r around it) and show me.
  3. It's somewhat more simpler than that. If the Radial buttons are placed in a FORM element, with the method POST it will transfer the result to php. if (isset($_POST['member_0']) || isset($_POST['member_1'])) { if (isset($_POST['member_0'])) { echo "member_0 was selected"; //If this radio was selected } elseif (isset($_POST['member_1'])) { echo "member_1 was selected"; //If the other one was } } You can put the POST into an array with your radios (id = "member[]") or whatnot as well. If you're wanting it to update without refreshing the page, you must use AJAX (JS & PHP), JS sending the data to php to validate and retrieve the result.
  4. Are you aware PHP (>=5.0) has a json_decode function which can put the data into arrays for you?
  5. Well from what PHP is reporting, you know it is not PHP. So it's a tech support issue I suppose from now.
  6. Maybe you want to set a CRON to log the memory usage when the server is idle for half a day and see what goes on there. But PHP should not be your problem, This may be your server's fault or another software taking up so much memory, PHP would not allocate that much for a 60MB file that is GC'd supposedly after. I'd take it up with the techs.. EDIT: And yeah, if you can view processes (via shell, or panel) You SHOULD. This will be a very very very easy answer to your memory problem if you could.
  7. Yep. How useful is the (~20?)MBs to you? I don't find it as a problem, again as long as it's not a process that is running every millisecond. Since you're over version 5.0 GC will do whatever, whenever it deems fit on to remove the extra memory caused by unset() or otherwise.
  8. Please add your code within .. tags! But add this to after your <?php opening tag: ini_set ("display_errors", "1"); error_reporting(E_ALL); This should reveal the error rather than just halt execution, show us the error.
  9. Is your PHP version of >= 5.3.0? If you're down at 4.3 there may be many more areas of the problem. Your plesk panel would be reporting the memory usage for the whole server's end, not what is available to PHP (memory_get_usage)
  10. Hm? All it needs is simple spacing in php, for example look at my linebreak version of it: while ($row = mysql_fetch_array($result)) { echo "first_name: ".$row['first_name']."\n<br/>"; echo "last_name: " .$row['last_name']."\n<br/>"; echo "registration_date: ". $row['registration_date']."<br>"; } Or spaces is fine, You just need to add them to the echo!
  11. Yes, an object can be destroyed or destructed much easier, but the problem is that you are expecting to remove the memory faster than it does. You can try this here: http://php.net/manual/en/function.gc-collect-cycles.php , But other than unset()ing the variable, there is nothing else you can do for garbage collection.
  12. Add these two lines after your opening tag: ini_set ("display_errors", "1"); error_reporting(E_ALL); That should list any and all errors in your code preventing it from being displayed. As for formatting, What do you mean? What are you wanting to do? You're being fairly vague on the problem.
  13. So low level is no level to you? 70MBs is the processes itself, such as mysqld and apache etc. etc. From the manual: http://php.net/manual/en/function.unset.php Garbage collection is something you should have read in the manual, you'll find your answers there.
  14. http://www.webreference.com/programming/php_mem/ A bribe? Wow. And i'm sure there's much more on Google.
  15. Yes. And google DOES have the power to recognize 'u=202&t=3' and add SEO towards that.
  16. Yes, most bots parse the url and strip out useless characters, it may confuse search engines for example. It's really a pointless thing to add, I've already been there and it just didn't matter what it was. site.com?foo=bar&%=baz&!=john Messy, IMO.
  17. Generally, anything other than '?' and '&' are valid, but there's a chance somewhere you'll run into problems using them.. Such as when entering that into a query directly, it'd break the string.
  18. You mean I can directly talk to the database using C++? because the salt thingy is different for every user, so I need to get it from the DB. Yeah, you can talk to your database. I'm not sure if externally but it should be simple if you have shell/SSH access.
  19. Why does it need to in PHP? As mentioned before you can pull the SALT from the database and hash the password with C++.
  20. Yeah, it should look fine on native resolution. Note on non-native, It will not retain its clarity, it should look much sharper/more colour correct native.
  21. Do you know how to use sessions? You can make it simple like so: if ($_SESSION['logged_in'] == "yes") { echo "<b>Log Out</b>"; } else { echo "<b>Log In</b>"; } So when they're logged in, the text of the tab will be changed.
  22. You must assign a dynamic variable as so: <?php $variable = ''; for ($i=0;$i<10;$i++) { ${"variable{$i}"} = 'test'; } echo $variable0; ?> You can read more about it here: http://php.net/manual/en/language.variables.variable.php
  23. You're not supposed to output ANY data before sending another header. Make sure there is no echo statement or whitespace before the opening <?php tag. If you must use the header after outputting data to the browser, than put this at the top of your code, ob_start <?php ob_start(); //Start output buffer This will fix the headers already sent error, but should be seen as a bandaid rather than a solution.
  24. You probably didn't define a path. Try something such as $exe = exec('/bin/cal 1995', $result); echo $result; Also you may want to look at escapeshellcmd
×
×
  • 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.