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