Click here to Skip to main content
15,887,175 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: randomly generate a number every X minutes (php) Pin
Richard MacCutchan16-Dec-09 11:47
mveRichard MacCutchan16-Dec-09 11:47 
GeneralRe: randomly generate a number every X minutes (php) Pin
Yustme17-Dec-09 6:15
Yustme17-Dec-09 6:15 
GeneralRe: randomly generate a number every X minutes (php) Pin
Richard MacCutchan18-Dec-09 8:47
mveRichard MacCutchan18-Dec-09 8:47 
GeneralRe: randomly generate a number every X minutes (php) [modified] Pin
plecco22-Dec-09 9:09
plecco22-Dec-09 9:09 
GeneralRe: randomly generate a number every X minutes (php) Pin
Richard MacCutchan22-Dec-09 10:19
mveRichard MacCutchan22-Dec-09 10:19 
GeneralRe: randomly generate a number every X minutes (php) [modified] Pin
plecco22-Dec-09 10:22
plecco22-Dec-09 10:22 
GeneralOff topic Pin
Richard MacCutchan22-Dec-09 11:13
mveRichard MacCutchan22-Dec-09 11:13 
AnswerRe: randomly generate a number every X minutes (php) Pin
Terry Valladon9-Feb-10 8:33
Terry Valladon9-Feb-10 8:33 
I may be a tad late to the game here but if you are using Linux or Mac this should work fine for your needs.

--Terry Valladon

<code>
$random_number = rand(); // I will let you worry about seeds and stuff, perhaps call your own make_random() function?
print('Random number is '.$random_number."\n");
declare(ticks = 1); // Set ticks to one second
pcntl_signal(SIGALRM, "signal_handler"); // Installs a signal handler for SIGALARM (works in linux/mac only I think)
pcntl_alarm(1200); //trigger alarm in 20 min (60 seconds * 20 min = 1200 seconds)

// This is just to keep the script running forever, I would HOPE you would have real code in here rather then just looping endlessly.
for(;;)
{
sleep(1);
}

function signal_handler($signal)
{
global $random_number;
switch($signal)
{
case SIGALRM:
$random_number = rand(); // New random number, I will let you worry about seeds and stuff, perhaps call your own make_random() function?
print('New random number is '.$random_number."\n");
pcntl_alarm(1200); //trigger alarm again in 20 min
break; // Exit function and continue normal code execution.
}
}
</code>
QuestionTimeout Alert Issue....Javascript Function with ASP.net application Pin
PDTUM15-Dec-09 9:08
PDTUM15-Dec-09 9:08 
AnswerRe: Timeout Alert Issue....Javascript Function with ASP.net application Pin
John Bracey15-Dec-09 9:37
John Bracey15-Dec-09 9:37 
QuestionHow to pass username of window authentication to web application. Pin
sabby200615-Dec-09 2:52
sabby200615-Dec-09 2:52 
QuestionHow to pass username of window authentication to web application. Pin
sabby200615-Dec-09 2:50
sabby200615-Dec-09 2:50 
AnswerRe: How to pass username of window authentication to web application. Pin
Saša Dragičević15-Dec-09 3:27
Saša Dragičević15-Dec-09 3:27 
AnswerRe: How to pass username of window authentication to web application. Pin
The Man from U.N.C.L.E.15-Dec-09 10:19
The Man from U.N.C.L.E.15-Dec-09 10:19 
Questioncan we create our own home Page in YahooHome Page. Pin
shiva.kore14-Dec-09 18:54
shiva.kore14-Dec-09 18:54 
AnswerRe: can we create our own home Page in YahooHome Page. Pin
Ashfield14-Dec-09 21:42
Ashfield14-Dec-09 21:42 
QuestionMS SharePoint & Dynamics Pin
Karina.R14-Dec-09 0:46
Karina.R14-Dec-09 0:46 
AnswerRe: MS SharePoint & Dynamics Pin
Richard MacCutchan14-Dec-09 23:06
mveRichard MacCutchan14-Dec-09 23:06 
QuestionHTML (aspx, ascx, html pages) Blacked Out Pin
jchandramouli13-Dec-09 21:29
jchandramouli13-Dec-09 21:29 
AnswerRe: HTML (aspx, ascx, html pages) Blacked Out [modified] Pin
plecco22-Dec-09 9:12
plecco22-Dec-09 9:12 
QuestionHow to private User On download pdf files Pin
en.Mahdi13-Dec-09 18:49
en.Mahdi13-Dec-09 18:49 
AnswerRe: How to private User On download pdf files [modified] Pin
plecco22-Dec-09 9:14
plecco22-Dec-09 9:14 
AnswerRe: How to private User On download pdf files Pin
marita724-Jan-10 5:38
marita724-Jan-10 5:38 
QuestionSending Request and Reading Response from Webservice using XML API Pin
shaina223112-Dec-09 1:18
shaina223112-Dec-09 1:18 
AnswerRe: Sending Request and Reading Response from Webservice using XML API Pin
shaina223112-Dec-09 1:19
shaina223112-Dec-09 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.