Jump to content

PHP SESSION LESS THEN 5 SECONDS then run.


Gayner

Recommended Posts

if $_SESSION['rofl'] is in seconds than it will work... what does $_SESSION['rofl'] have in it

 

has nothing in it just a variable i can use so my query doesn't run each time a refresh happens only when a  user logs out or after 5 seconds..?

 

So if i use that, will the user have to refresh page for it to work or does php automatically run query after 5seconds ?

Link to comment
Share on other sites

PHP code will only run when invoked by some mechanism.

 

The three most common ways for PHP code to be invoked are:

1) The user makes a web request through your web server, i.e: apache

2) A user logs into a machine and runs a php script manually by calling: php.exe script_name.php

3) A scheduled task or cron job runs a php script by invoking a command: php.exe script_name.php

 

So if i use that, will the user have to refresh page for it to work or does php automatically run query after 5seconds ?

Based on what I've just told you, what do you think?

a) user have to refresh page

b) does php automatically run query after 5seconds

Link to comment
Share on other sites

PHP code will only run when invoked by some mechanism.

 

The three most common ways for PHP code to be invoked are:

1) The user makes a web request through your web server, i.e: apache

2) A user logs into a machine and runs a php script manually by calling: php.exe script_name.php

3) A scheduled task or cron job runs a php script by invoking a command: php.exe script_name.php

 

So if i use that, will the user have to refresh page for it to work or does php automatically run query after 5seconds ?

Based on what I've just told you, what do you think?

a) user have to refresh page

b) does php automatically run query after 5seconds

 

I guess ur right, sorry about this...

 

Just php so confusing for me..i try my hard tho and i learn alot from you guys.. just sometimes it get's really complicated.. i try my best i will learn it eventually, lol

 

thanks... i found a online script online and just reverse engineering it now...

 

thx

Link to comment
Share on other sites

There's no need to apologize; the primary purpose of this site is for you to ask questions and learn from the responses (assuming the responses are worth learning from).

 

Programming itself can be very confusing because your own internal thought process is very different from that of a computer.  When your brain thinks "move my arm" your arm just moves.  When you want to "move the computer's arm" it's not enough to just think it, you have to tell it how.  And then you realize there's about 50 different ways you can try to tell it the "how."

 

And just in case you understood it this way, my post was in no way meant to be condescending or make you feel stupid.  You'll find that many responses in technical forums will be very terse or concise.  It doesn't mean the person is being rude; more often it means they are being efficient in terms of word usage or are time limited because they are at work.

 

Also, how much work a person will do on your behalf is sometimes an indication of what they think of you.  My approach is to give you some information and then let you mull it over and come to a decision of your own.  That's good practice for you because programming will present you with many opportunities to think about which solution is best or to come up with your own answer based on facts.

 

If on the other hand someone just throws you the entire solution and explains nothing, it may mean one of two things:

1) They are time constrained and just need to be quick about it

2) They don't think you're worth explaining it to.

 

Hope that helps some.  :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.