oni-kun
Members-
Posts
1,984 -
Joined
-
Last visited
-
Days Won
1
Everything posted by oni-kun
-
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..)
-
Need help picking links from strings of text (Tweets)
oni-kun replied to wee493's topic in PHP Coding Help
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. -
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.
-
Need help picking links from strings of text (Tweets)
oni-kun replied to wee493's topic in PHP Coding Help
Are you aware PHP (>=5.0) has a json_decode function which can put the data into arrays for you? -
Help me understand why PHP is messing with my RAM!
oni-kun replied to B0b's topic in PHP Coding Help
Well from what PHP is reporting, you know it is not PHP. So it's a tech support issue I suppose from now. -
Help me understand why PHP is messing with my RAM!
oni-kun replied to B0b's topic in PHP Coding Help
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. -
Help me understand why PHP is messing with my RAM!
oni-kun replied to B0b's topic in PHP Coding Help
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. -
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.
-
Help me understand why PHP is messing with my RAM!
oni-kun replied to B0b's topic in PHP Coding Help
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) -
need help making query results more appealing and readable
oni-kun replied to BrentonHale's topic in PHP Coding Help
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! -
Help me understand why PHP is messing with my RAM!
oni-kun replied to B0b's topic in PHP Coding Help
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. -
need help making query results more appealing and readable
oni-kun replied to BrentonHale's topic in PHP Coding Help
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. -
Help me understand why PHP is messing with my RAM!
oni-kun replied to B0b's topic in PHP Coding Help
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. -
Help me understand why PHP is messing with my RAM!
oni-kun replied to B0b's topic in PHP Coding Help
http://www.webreference.com/programming/php_mem/ A bribe? Wow. And i'm sure there's much more on Google. -
Yes. And google DOES have the power to recognize 'u=202&t=3' and add SEO towards that.
-
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.
-
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.
-
Encrypt password with md5, and salt from DB table
oni-kun replied to Quale's topic in PHP Coding Help
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. -
Encrypt password with md5, and salt from DB table
oni-kun replied to Quale's topic in PHP Coding Help
Why does it need to in PHP? As mentioned before you can pull the SALT from the database and hash the password with C++. -
"Normal" screen resolution - wide monitor - what is best??
oni-kun replied to scanreg's topic in Miscellaneous
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. -
POLL: Pick which php bbcode button looks better
oni-kun replied to .josh's topic in PHPFreaks.com Website Feedback
Left is prevailing! Good job nrg. -
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.
-
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
-
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.
-
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