Re: [PHP] How to assign eval() to variable?
short hack, assuming your eval echo's out to the browser (which I can't see how else you'd expect something to 'return' from an eval'd statement ob_start(); eval($foo); $result = ob_get_clean(); On May 23, 2009 1:46am, Afan Pasalic wrote: hi, I have on one website boxes with information, pulled from mysql. the content can be string, php code, url of other website or url to specific file etc. currently, I have something like this: // connect to db // mysql_query() to get box content and content_type switch($content_type) { case 'string': echo $content; break; case 'php_code': eval($content); break; case 'website': echo ''.$content.'; break; case 'file' require_once($file); echo $file_content; // etc. } but, now I have to change the code to assign content to variable and the variable will be printed later. I tried something like this: switch($content_type) { case 'string': $record = $content; break; case 'php_code': $record = eval($content); break; case 'website': $record = ''.$content.'; break; case 'file' require_once($file); $record = $file_content; // etc. } and it works - except eval() part. cant do $record = eval($content); ?!?!?!? thanks afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] change server time
In windows? I have no idea. I use linux for my server stacks. You'll have to ask Dr. Google! I'd expect it's just like with normal windows, in the date properties in the control panel. On May 24, 2009 11:44pm, Sumit Sharma wrote: That's great but how to do this? On Mon, May 25, 2009 at 9:11 AM, Eddie Drapkin oorza...@gmail.com> wrote: If you want to change the server time ocmpletely and independent of PHP, you're going to have to do it from the shell. On Sun, May 24, 2009 at 11:36 PM, Sumit Sharma sumitp...@gmail.com> wrote: Yes, I works on windows as well well. Was looking for india time zone found it as putenv("TZ=Asia/Calcutta");. Thanks a lot, but this function does not change the server time permanently. Any Idea about any function which does so. Thanks, Sumit On Sun, May 24, 2009 at 12:33 PM, Michael A. Peters mpet...@mac.com> wrote: > Sumit Sharma wrote: > >> Hi, >> >> Whenever I am using date('r') function It shows time in GMT instead of >> local time set on my machine. Do I need to configure the time separately. >> I >> am using WAMP server locally. >> >> Thanks, >> Sumit >> >> > Not sure about windows - but > > putenv("TZ=America/Los_Angeles"); > > in your script should work (change the timezone to whatever you want > locally). > > You should be able to set the TZ variable globally in your php.ini file. >
Re: Re: [PHP] Re: PHP, OOP and AJAX
Two things: 1. Try using the fully qualified path (ie /var/www/foo/bar.php instead of foo/bar.php) 2. Look at setting up autoloading so you don't need to manually include anyway. If you're going OOP, autoloading is a must! On May 28, 2009 8:49am, kranthi wrote: i never faced such a problem and i can assure you that it will never happen. try... main.php require('second.php'); ?> second.php test call main.php via AJAX and see the responseText. many things can go wrong in your coding. dont come to the conclusion that this particular thing is not working. i recommend you firebug firefox adddon (just go to the net tab and you can see all the details of the communication between client and server) and i find it helpful to use a standard javascript(jQuery in my case) library instead of highly limited plain javascript language and for you case its difficult to comment without seeing your actual code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] Re: PHP vs ASP.NET
oh, yep, it's back! :] On Jun 1, 2009 7:50pm, Daniel Brown wrote: On Mon, Jun 1, 2009 at 17:44, Eddie Drapkin oorza...@gmail.com> wrote: > > Completely off topic, but www.pilotpig.net is down or buggered or > something! Looks like a squatter to me >.> Looks fine to me, but you may have caught it while I was swapping over some junk with GoDaddy. They're not as seamless as they used to be, it seems, so maybe it was down for a bit. Thanks for the heads-up though. -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1