Jump to content

put this in my google search code.


yazah

Recommended Posts

I got this code made for me to put on my google search code.

 

<?php

 

$click_value = '0.001'; //Amount in dollars that each click is worth

 

function increment_clicks() {

    //Get current click count

    if(file_exists('click_count.txt'))

        $clicks = file_get_contents('click_count.txt');

    else

        $clicks = 0;

   

    //Add current click to count

    $clicks++;

   

    //Save new value to file

    $file = fopen('click_count.txt', 'w');

    fwrite($file, $clicks);

    fclose($file);

}

 

function get_click_amount() {

    global $click_value;

   

    //Get current click count

    if(file_exists('click_count.txt'))

        $clicks = file_get_contents('click_count.txt');

    else

        $clicks = 0;

   

    //Return value of all clicks based on $click_value, formatted to 2 decimal places

    return number_format($clicks * $click_value, 3);

}

 

if (isset($_POST['search'])) {

    //Search button was clicked, increment count

    increment_clicks();

}

 

$click_amount = get_click_amount();

 

?>

<html>

<head>

</head>

 

<body>

<center>

 

<p id="click_amount">$<?php echo $click_amount; ?></p>

<form action="" method="POST">

    <input type="text" name="search" value="" />

    <input type="submit" value="Search" />

</form>

 

</center>

</body>

</html>

 

Now i do not know how to put it in my google code if you put it on a page by itself it works.

 

I do not know if i can list my google code here so if anyone can help i will pm them m google code.

 

THANKS

Link to comment
https://forums.phpfreaks.com/topic/227596-put-this-in-my-google-search-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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