Is it somehow possible to execute a PHP Website code without the need to have the Website open.  Something like a intern webbrowser the refreshes itselfs. Or is the any other way like a repeating sheduler the executes the Code every 10 seconds.
122372
I have some functions that use curl to pull information off a couple of sites and insert them into my database. I was just wondering what is the best way to go about executing this task every 24 hours?  I am running off windows now, but will probably switch to linux once I am live (if that makes a difference). I am working inside symfomy framework now.  I hear cronjobs can do this this...but looking at the site it seems to work remotely and I would rather just keep things in house...Can i just "run a service" on my computer? whatever that means ;) (have heard it used)  thanks for any help, Andrew
44009
Is there a realistic way of implementing a multi-threaded model in PHP whether truly, or just simulating it. Some time back it was suggested that you could force the operating system to load another instance of the PHP executable and handle other simultaneous processes.  The problem with this is that when the PHP code finished executing the PHP instance remains in memory because there is no way to kill it from within PHP.  So if you are simulating several threads you can imagine whats going to happen.  So I am still looking for a way multi-threading can be done or simulated effectively from within PHP. Any ideas?
96773
I was just browsing a forum and someone asked about a PHP file they had found on the web.  It has several spots like this in the code:  if ($REMOTE_ADDR == "") $ip = "no ip"; else $ip = getHostByAddr($REMOTE_ADDR);  I have always thought brackets are needed to enclose what you want to do if the condition is true.  Is there some other alternative, such as if it is on the same line you don't?  There is also another line like this: if ($action != ""): mail("$adminaddress","Visitor Comment from YOUR SITE",  My instinct is to say this wouldn't work, but I also don't know if it is an outdated PHP file and it used to work?
55825
How to execute a script periodically like crontab does but without using crontab?  Please note this that the executed script should not fire with another script and schedule it with 'sleep' command, what I expect to have same functionality as crontab but it should not be present in crontab list and should not be stop when terminal or session ended,   crontab exactly but without croning it.
111364
Some guy called one of my Snipplr submissions "crap" because I used if ($_SERVER['REQUEST_METHOD'] == 'POST') instead of if ($_POST)  Checking the request method seems more correct to me because that's what I really want to do. Is there some operational difference between the two or is this just a code clarity issue?
121685
How to fetch HTML in C or C++? with Sockets. Can you give me a Example code pls?  NOTE - I originally closed this, but reopened.  To the poster - Please see:    and
28320
I'm looking for a simple solution to increase my website's uptime. My website consists of simple HTML and PHP pages with no database. Right right I use paid shared hosting and I sometimes find that my website is not loading.  Would it be possible to put my website on two hosts and in case the main host is down the other one would get used? What is the best way to set this up?
53220
I would like to set a maximum execution time for sql queries like set_time_limit() in php. How can I do ?
12107
How can I create a scheduled task to run a PHP file? Yes, I filled out everything in the scheduled task, but it still doesn't work.  Run: &quot;C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\WEB\4w_website\save.php&quot; Start in: &quot;C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\WEB\4w_website&quot;  It just opens the PHP file in Notepad. I gave the correct user name and pwd. Please help me..
7415
I'm familiar with some of the basics, but what I would like to know more about is when and why error handling (including throwing exceptions) should be used in PHP, especially on a live site or web app. Is it something that can be overused and if so, what does overuse look like? Are there cases where it shouldn't be used? Also, what are some of the common security concerns in regard to error handling?
33494
I have the following code making a GET request on a URL:  $('#searchButton').click(function() {     $('#inquiry').load('/portal/?f=searchBilling&amp;pid=' + $('#query').val());             });   But the returned result is not always reflected. For example, I made a change in the response that spit out a stack trace but the stack trace did not appear when I clicked on the search button. I looked at the underlying PHP code that controls the ajax response and it had the correct code and visiting the page directly showed the correct result but the output returned by .load was old.  If I close the browser and reopen it it works once and then starts to return the stale information. Can I control this by jQuery or do I need to have my PHP script output headers to control caching?
9042
I am very new to Linux and I've only been using it to SSH to my web server using Putty. The issue I am having is this:  Basically I've got 2 php scripts. One get_tweets.php constantly listens for tweets on twitters Streaming API whilst the other - parse_tweets.php logs these into a db. In order for these to work they've to be kept running continuously.   I've been using the following commands to run them in the background and from what I've seen they run for most of the day, however whenever I log on to my computer in the morning the scripts have stopped and I've to run commands again.  nohup php my_script.php &gt; /dev/null &amp;   I'm just wondering if that is normal based on the commands I am using, should they run indefinitely when using nohup and if not what is the alternative? A CRON job?  Thanks for the help
61270
if (strstr($_SERVER['REQUEST_URI'],'index.php')) {     header('HTTP/1.0 404 Not Found'); }   Why wont this work? I get a blank page.
20802
I have an instance of a general purpose class that will be executed both under ASP.NET and a stand alone program. This code is sensative to the process where it is being run - that is, there are certin methods that should not called if running under ASP.NET. How do you determine if the code is executing in an ASP.NET process?  The solution I am currently using is answered below.    I wish someone would add a comment as to why this question has gotten downvoted and/or propose a better way to ask it! I can only assume at least some folks have looked at the question and said "what an idiot, ASP.NET code is .NET code".
19602
Could I theoretically use multiple php code areas / widgets in a page, each doing their own posts query and fetching with wp_query and get_posts() and use a page template that has no post loop?
4757
I have some "corporative" systems I have to use at work. Some of them are terrible, with frames, pop-ups and such.  I was thinking about automating some stuff using curl or something like that. I need login, click on hyperlinks, set some data, and them do some post.  Is it possible to use curl? Or am I'm going to be better using something like Selenium?
3652
How can I dynamically invoke a class method in PHP? The class method is not static. It appears that   call_user_func(...)   only works with static functions?  Thanks.