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 is double counting how can it be avoided?

Double counting occurs when the same item or event is counted more than once in a calculation, leading to inaccurate results. It can be avoided by clearly defining the criteria for what constitutes a single unit and ensuring that each unit is counted only once. Implementing checks, such as using unique identifiers or categorizing items properly, can also help prevent double counting. Additionally, reviewing data and calculations for consistency can ensure accuracy.


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 kind of pill is 144?

A pill marked with &quot;144&quot; is typically identified as Diphenhydramine HCl 25 mg, an over-the-counter antihistamine commonly used to relieve symptoms of allergy, hay fever, and the common cold. It can also be used as a sleep aid and to prevent nausea and vomiting. The pill is usually pink and round. Always consult a healthcare provider for proper use and to verify any medication.


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.

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.


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


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 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


What strategies can be used to effectively counter the fiend hunter combo in a competitive game?

To effectively counter the fiend hunter combo in a competitive game, players can use strategies such as disrupting the combo with removal spells, playing cards that prevent the combo from happening, or using cards that can counter the fiend hunter's abilities. Additionally, players can also focus on building a strong board presence to pressure the opponent and prevent them from executing the combo successfully.