Jump to content

piccadely

New Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

piccadely's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. As i had said earlier, if I knew php, it wouldn't take me much time. Here is a part of code thtat I required, I hope I will get others too. <?php $counter = file_get_contents("counter.txt"); $counter++; file_put_contents("counter.txt", $counter); echo $counter; ?> But I guess, this needs a little bit of more securing, if anybody can help on that......
  2. That is taking me somewhere.... Is it possible, if I ask specific questions, somebody can tell me the code. Like register a click in the database(flat file). Does this give any idea: <?php /******************************************************************************* * Title: PHP click counter (CCount) * Version: 2.0.3 from 25th January 2015 * Author: Klemen Stirn * Website: http://www.phpjunkyard.com ******************************************************************************** * COPYRIGHT NOTICE * Copyright 2004-2015 Klemen Stirn. All Rights Reserved. * This script may be used and modified free of charge by anyone * AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT. * By using this code you agree to indemnify Klemen Stirn from any * liability that might arise from it's use. * Selling the code for this program, in part or full, without prior * written consent is expressly forbidden. * Using this code, in part or full, to create derivate work, * new scripts or products is expressly forbidden. Obtain permission * before redistributing this software over the Internet or in * any other medium. In all cases copyright and header must remain intact. * This Copyright is in full effect in any country that has International * Trade Agreements with the United States of America or * with the European Union. * Removing any of the copyright notices without purchasing a license * is expressly forbidden. To remove copyright notice you must purchase * a license for this script. For more information on how to obtain * a license please visit the page below: * http://www.phpjunkyard.com/buy.php *******************************************************************************/ define('IN_SCRIPT',1); // Tell browsers not to cache the file output header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // Require the settings file require 'ccount_settings.php'; // Get the link ID; valid chars for the link ID are: 0-9 a-z A-Z - . and _ $id = isset($_REQUEST['id']) ? preg_replace('/[^0-9a-zA-Z_\-\.]/', '', $_REQUEST['id']) : die('Missing link ID'); // Open database file for reading and writing if ($fp = @fopen($ccount_settings['db_file'], 'r+')) { // Lock database file from other scripts $locked = flock($fp, LOCK_EX); // Lock successful? if ($locked) { // Read file $data = explode('//', fread($fp, filesize($ccount_settings['db_file'])), 2); // Convert contents into an array $ccount_database = isset($data[1]) ? unserialize($data[1]) : die('Invalid log file'); // Is this a valid link? if ( ! isset($ccount_database[$id]) ) { die('Link with this ID not found'); } // Increse count by 1 $ccount_database[$id]['C']++; // Is this a unique click or not? if ( ! isset($_COOKIE['ccount_unique_'.$id]) ) { $ccount_database[$id]['U']++; } // Update the database file rewind($fp); fwrite($fp, "<?php die();//" . serialize($ccount_database)); } else { // Lock not successful. Better to ignore than to damage the log file die('Error locking file, please try again later.'); } // Release file lock and close file handle flock($fp, LOCK_UN); fclose($fp); } // Print the cookie for counting unique clicks and P3P compact privacy policy header('P3P: CP="NOI NID"'); setcookie('ccount_unique_'.$id, 1, time() + 3600 * $ccount_settings['unique_hours']); // Redirect to the link URL header('Location: ' . str_replace('&', '&', $ccount_database[$id]['L']) ); die(); Can it be used to achieve what I am looking for. I will pay (in some way, if not in cash). I had this kind of script once which changed the URL of page being displayed after it was displayed a number of times. It was, I guess, a redirect script. If even that is possible, I could somehow make it work in my project.
  3. May be, I guess so. My knowledge of PHP is very limited, to modifying an existing code, not create one. I program in ASP, so I understand code, but not the whole PHP and I don't have enough time for the learning curve. If I were to do it in ASP, It would't have taken me more than half an hour for the whole project but PHP is kind of alien to me. Why it is simple? User visits my page (no coding required) User sees my link ("<a href="<? php the first URL in the flat file ?>"> Click here </a> <?php iteration to count the number of clicks on that link and change link to next one on the file, if the number of clicks reached 10, reset counter ?> next, Simple PHP form to capture the user details (this i guess, i can get from google as well) including link submitted by him and push that link to last of the que in the flat file accessed above. Next, <? php echo link and click stats ?> I understood what you said, that this is a help forum. I am just explaining what I need. May be someone can direct me to right resources. If there is already code, I can modify it to my needs.
  4. I need a very simple script, if anyone can help me. User visits my site, he is shown a link. if that link is clicked more than 10 times, a new link is shown which comes from a flat file, file that contained the first link. User visits my site, fills in his link url and email address and his link is added last in the que of the above file. a way to see/edit/remove the links from the system which get a predefined number of clicks. User should not be able to submit more than one link. Let me know if anyone can help me on this.
  5. Hi, I recently bought a script. It looked until I found some errors. It looks hell now and I feel my money is wasted as I cannot get the support. Can you please help to fix it. Following are the errors that I get. If somebody is intrested in helping then PM me to get user names and passwords to login and check the errors by themselves. ==================================================== ==================================================== Error: ==== ==== Fatal error: Smarty error: [in siteadmin/mailstatus.tpl line 155]: [plugin] could not load plugin file 'insert.pemail.php' (core.load_plugins.php, line 118) in /home/premiume/public_html/demo/photocontest/smarty/libs/Smarty.class.php on line 1095 ==================================================== ==================================================== Error: ==== ==== Warning: move_uploaded_file(/home/premiume/public_html/demo/photocontest/images/contest/17_397021_contest_picture.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/premiume/public_html/demo/photocontest/classes/jclasses/class.contest.php on line 405 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpxiWGqt' to '/home/premiume/public_html/demo/photocontest/images/contest/17_397021_contest_picture.jpg' in /home/premiume/public_html/demo/photocontest/classes/jclasses/class.contest.php on line 405 Warning: imagecreatefromjpeg(/home/premiume/public_html/demo/photocontest/images/contest/17_397021_contest_picture.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/premiume/public_html/demo/photocontest/include/function.php on line 5 Warning: getimagesize(/home/premiume/public_html/demo/photocontest/images/contest/17_397021_contest_picture.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home/premiume/public_html/demo/photocontest/include/function.php on line 6 Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/premiume/public_html/demo/photocontest/include/function.php on line 9 Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/premiume/public_html/demo/photocontest/include/function.php on line 10 Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/premiume/public_html/demo/photocontest/include/function.php on line 11 Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/premiume/public_html/demo/photocontest/include/function.php on line 12 Warning: imagestring(): supplied argument is not a valid Image resource in /home/premiume/public_html/demo/photocontest/include/function.php on line 13 Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/premiume/public_html/demo/photocontest/include/function.php on line 14 Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/premiume/public_html/demo/photocontest/include/function.php on line 15 Warning: getimagesize(/home/premiume/public_html/demo/photocontest/images/contest/17_397021_contest_picture.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home/premiume/public_html/demo/photocontest/include/function.php on line 300 Warning: imagecreatefromgif(/home/premiume/public_html/demo/photocontest/images/contest/17_397021_contest_picture.jpg) [function.imagecreatefromgif]: failed to open stream: No such file or directory in /home/premiume/public_html/demo/photocontest/include/function.php on line 346 Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/premiume/public_html/demo/photocontest/include/function.php on line 347 Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/premiume/public_html/demo/photocontest/include/function.php on line 348 Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/premiume/public_html/demo/photocontest/include/function.php on line 349 Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/premiume/public_html/demo/photocontest/include/function.php on line 350 Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/premiume/public_html/demo/photocontest/include/function.php on line 351 ================================================== ================================================== Thank You Very Much For Looking
×
×
  • 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.