answersLogoWhite

0

I made a few weeks ago:

session_start(); //you can also use a cookie, I prefer session.

error_reporting(0); //to avoid notice in checking if counted.

if(!isset($_SESSION['cont'])) { //check if not counted yet.

error_reporting(E_ALL); //activate error reporting again.

$dir = 'PATH FOR THE VAR TO BE SOTRED IN'; //THIS MUST BE A PHP file !!

if(include($dir)) {

if(isset($cnt)) {

$cnt ++;

$cntr = '<?php'.sprintf(PHP_EOL).' $cnt = '.$cnt.';'.sprintf(PHP_EOL).' ?>';

file_put_contents($dir, $cntr);

$_SESSION['cont'] = true;

} else {

$cnt = 1;

$cntr = '<?php'.sprintf(PHP_EOL).' $cnt = '.$cnt.';'.sprintf(PHP_EOL).' ?>';

file_put_contents($dir, $cntr);

$_SESSION['cont'] = true;

}

} else {

echo 'Wrong file path '.$dir;

}

}

Good luck :)

User Avatar

Wiki User

11y ago

What else can I help you with?

Continue Learning about Math & Arithmetic

What is meant by LOCK-OUT in counter?

in digital counters , due to unwanted spikes there might be a condition of stuck in the middle or at the beginning of a counting process.this provides unstable states and results in abnormal or ambiguous results . so we have to answer yet another question that how to prevent lock out condition ? in order to prevent lock out condition, use PRESET option and clear option in a flip flop and hence the registers will be cleared and we can go for the smooth functioning of counter circuits


What are suicide precautions?

It is a list of things people do to help prevent others in their care from suicide. Such things would include searching for weapons, watching them intensely (even while using the toilet), counting silverware to make sure there are no missing forks/knives, not letting those on suicide watch have belts, sheets, or shoelaces, etc.


What is the advantage of using an unsigned integer?

Using an unsigned integer allows for a larger range of positive values compared to a signed integer of the same bit width, as it does not allocate any bits for representing negative values. This is particularly useful in applications where negative numbers are not applicable, such as counting items or addressing memory locations. Additionally, unsigned integers can help prevent errors related to negative values in calculations, enhancing the reliability of the program.


What if you are 18 and have tonsilitis?

If you're 18 and have tonsillitis, it's important to rest and stay hydrated. Over-the-counter pain relievers can help alleviate discomfort. If symptoms persist for more than a few days or worsen, consider seeing a healthcare professional for evaluation and potential treatment, which may include antibiotics if a bacterial infection is suspected. Additionally, practicing good hygiene can help prevent spreading the infection to others.


Why was math mmade?

...to prevent typographical errors.

Related Questions

What factors could affect the counting rate of a geiger counter?

The Geiger counter is a tool that was invented to measure radioactive materials for safety purposes. Factors that can prevent the Geiger counter from providing accurate results include failure to calibrate the tool before use, indirect readings that fail to locate hidden radioactive rays, and a low battery.


Which individual who lived among the people preached the word of the church to counter prevent heresy?

a Friar lived among the people preached the word of the church to counter prevent heresy.


What is meant by LOCK-OUT in counter?

in digital counters , due to unwanted spikes there might be a condition of stuck in the middle or at the beginning of a counting process.this provides unstable states and results in abnormal or ambiguous results . so we have to answer yet another question that how to prevent lock out condition ? in order to prevent lock out condition, use PRESET option and clear option in a flip flop and hence the registers will be cleared and we can go for the smooth functioning of counter circuits


What is meant by LOCK in counter?

in digital counters , due to unwanted spikes there might be a condition of stuck in the middle or at the beginning of a counting process.this provides unstable states and results in abnormal or ambiguous results . so we have to answer yet another question that how to prevent lock out condition ? in order to prevent lock out condition, use PRESET option and clear option in a flip flop and hence the registers will be cleared and we can go for the smooth functioning of counter circuits


What is a splash board?

Splash boards are at the rear of the counter to help prevent splash from getting on the walls.


What is the first spell that can counter a spell in Magic: The Gathering?

The first spell that can counter a spell in Magic: The Gathering is called &quot;Counterspell.&quot; It allows a player to prevent an opponent's spell from taking effect.


How can I prevent mint from double counting transactions?

To prevent mint from double counting transactions, make sure to regularly reconcile your accounts, categorize transactions accurately, and avoid manually entering duplicate transactions. Additionally, check for any syncing issues with your financial institutions and contact Mint's customer support for assistance if needed.


What is the importance of promoting the anti-bullying law?

It teaches people how to recognise bullying behaviour and strategies to prevent or counter it.


What are the benefits of using a silicone stove counter gap cover in the kitchen?

Using a silicone stove counter gap cover in the kitchen can help prevent food crumbs, liquids, and debris from falling into the gap between the stove and the counter. This can make cleaning easier and help maintain a more hygienic kitchen environment. Additionally, the cover can also help prevent pests from finding their way into the gap.


What is a easy way to prevent acne scarring?

An easy way to prevent acne from scarring is to prevent future pimples. Other ways include applying sunscreen, homeopathic remedies, over-the-counter medicine, and seeking professional help.


What should A forklift operator should install to support a semi trailer that is not coupled to a tractor to prevent it from upending?

Counter weights


Can spouse relocate with children during divorce?

No in most states, and even than, the separated parent can file an injunction to prevent it or have the children returned.