PHP - Simple View Counter Adding 1,2 Or 3?
I may not be a PHP wizard, but a view counter seems pretty damn simple and easy to implement. Unless you leave it in my hands...
It's a pretty simple problem, so I'm hoping it'll be a simple solution. Every time you load a game on my website, at the top of the php "playgame.php" is a function call: $objGlobal->update_gameplay($gameid); In my functions.class.php is the function declaration: function update_gameplay() { $args = func_get_args(); $getsql = mysql_query("select * from games where gameid = $args[0]"); if($getsql) { $resultgame = mysql_fetch_array($getsql, MYSQL_ASSOC); $timesplayed = $resultgame['timesplayed'] + 1; $updatesql = "update games set timesplayed = '$timesplayed', last_played = now() where gameid = $args[0]"; if(mysql_query($updatesql)) return true; else return false; } } Yet, when I load the playgame page, it adds 1,2 or 3!!! So this means the function is being called 1, 2 or 3 times, but how can that be if it is at the VERY top of the page? Try it yourself on my website, www.gpstudios.com. Click on a game and reload. For some reason, the newer games always add 1, but other older/more popular games add 1, 2 or 3 I've searched for the string "update" and the string "timesplayed" in every file using a program called FileSeek and I can say for certain that the function must be being called multiple times for some reason. What's weirder is that my game reviews (http://www.gpstudios.com/reviews.php) are also having their view counter incremented by 1 or 2 on a page load. Please help me solve this quick. Thanks, -Tom Similar TutorialsHope this is clear and concise! I have a view article page and every time you land on the page then I have a query that runs an update using sql. Now the problem is everytime the script is run it counts one hit as 2. For example if an article has been viewed 4 times. Next time you land on the page it shows the page has been seen 6 times instead of 5. Here is my code below for the view_article page: Code: [Select] <body bgcolor="#000000"> <div id="site_div" align="center"> <div id="wrapper_div"> <!-- header --> <?php include 'header.php'; ?> <!-- header --> <div id="main_nav"> <div id="link1_div"><p class="link1_class"><a href="index.html" class="link1_class">All Articles</a></p></div> <div id="link2_div"><p class="link2_class"><a href="index.html" class="link2_class">Reviews</a></p></div> <div id="link3_div"><p class="link2_class"><a href="index.html" class="link2_class">Previews</a></p></div> <div id="link4_div"><p class="link2_class"><a href="buys.php?lightbox[width]=700&lightbox[height]=400&lightbox[modal]=true" class="link2_class lightbox">Videos</a></p></div> <div id="link5_div"><p class="link2_class"><a href="rents.php?lightbox[width]=700&lightbox[height]=400&lightbox[modal]=true" class="link2_class lightbox">News</a></p></div> <div id="link6_div"><p class="link2_class"><a href="index.html" class="link2_class">Podcasts</a></p></div> <div id="link7_div"><p class="link2_class"><a href="index.html" class="link2_class">Contact Us</a></p></div> <div id="link8_div"><p class="link2_class"><a href="index.html" class="link2_class"></a></p></div> </div> <div id="sub_nav"> <div id="sub_nav_div"> <p class="filter_by_class">FILTER BY: <a href="index.php" style="color:#21a8f7; text-decoration:underline">All</a> <a href="xbox360.php">Xbox 360</a> <a href="#">PS3</a> <a href="#">Wii</a> <a href="#">PC</a> <a href="#">PSP</a> <a href="#">DS</a><a href="#">Mobile</a><a href="#">Older Platforms</a></p></div> </div> </div> <div id="content_div"> <div id="content_spacer"> </div> <!-- TRACK PAGE <span class="posthilit">VIEWS</span> --> <?php //DATABASE CONNECTION include_once 'dbc.php'; $id = $_GET['id']; mysql_query("UPDATE articles SET `article_views` = `article_views`+1 WHERE idarticles='$id'"); ?> // TrACK PAGE <span class="posthilit">VIEWS</span> // MAIN CONTENT if(isset($_GET['id']) && is_numeric($_GET['id']) ) { $query = "SELECT * FROM articles WHERE idarticles= {$_GET['id']}"; if($r = mysql_query($query)) { $row = mysql_fetch_array($r); echo " <div id=\"main_article_div\"> <div id=\"top_blue_content_div\"> {$row['article_type']}</div> <div id=\"image_main_content_div\"><img src=\"{$row['article_big_image']}\" width=\"200\" height=\"112\" alt=\"main_article_image\" /></div> <div id=\"content_area\"><p class=\"main_content_title_class\">{$row['article_title']} <div id=\"addthisspacer\"> <!-- AddThis Button BEGIN --> <div class=\"addthis_toolbox addthis_default_style \"> <a class=\"addthis_button_facebook_like\" fb:like:layout=\"button_count\"></a> <a class=\"addthis_button_tweet\"></a> <a class=\"addthis_counter addthis_pill_style\"></a> </div> <script type=\"text/javascript\" src=\"http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4d1d4fb34dc87309\"></script> <!-- AddThis Button END --> </div> </p> </div> </div> "; } } ?> <!-- MAIN CONTENT ENDS --> </div> <div id="lower_content_div"> <!-- THIS IS WHERE THE MAIN ARTICLE/COMMENTS STARTS --> <?php //include 'dbc.php'; if(isset($_GET['id']) && is_numeric($_GET['id']) ) { $query = "SELECT * FROM articles WHERE idarticles= {$_GET['id']}"; if($r = mysql_query($query)) { $row = mysql_fetch_array($r); echo " <div id=\"left_lower_content\" class=\"break-word\"> {$row['actual_article']} </div> "; } } ?> <!-- THIS IS THE END OF THE MAIN ARTICLE/COMMENTS QUERY --> </div> <div id="footer_div"> <div id="footer_1"></div> <div id="actual_footer"> <div id="top_footer_div"> <div id="top_footer_div_left"><a href="login.php?lightbox[width]=396&lightbox[height]=200&lightbox[modal]=true"><img src="images/rent-or-buy-2-logo_small2.png" width="260" height="39" alt="small_logo" class="small_logo_class" /></a></div> <div id="top_footer_div_right"> <div id="login_register_div_2"> <p class="logintext"><a href=""><img src="images/rss_icon.png" width="16" height="16" alt="rss_icon" /></a></p><p class="logintext"><a href="http://www.twitter.com"><img src="images/twitter_icon.png" width="16" height="16" alt="twitter_icon" /></a></p><p class="logintext"><a href="http://www.youtube.com"><img src="images/youtube_icon.png" width="38" height="16" alt="youtube_icon" /></a></p><p class="logintext"><a href="http://www.facebook.com"><img src="images/facebook_icon.png" width="16" height="16" alt="facebook_icon" /></a></p> </div> </div> <div id="search_div2"> <form action="#" method="post" name="search"> <input type="text" value="Search!" class="formimage" /> <INPUT TYPE="IMAGE" src="images/search_bar_button.jpg" BORDER="0" style="padding:0" class="formbutton"> </form> </div> </div> <div id="actual_footer_bottom_section"> <div id="actual_footer_bottom_section_top"></div> <div id="actual_footer_bottom_section_top_links"><a href="index.php">All Articles</a> | <a href="#">Reviews</a> | <a href="#">Previews</a> | <a href="#">"Buys"</a> | <a href="#">"Rents"</a> | <a href="#">Videos</a> | <a href="#">News</a> | <a href="#">Games</a> </div> <div id="actual_footer_bottom_section_bottom"> <p class="actual_footer_bottom_section_paragraph">Design By: Felix Henriques | Created By: Felix Henriques | Copyright 2010 Buy Or Rent Games</p></div> <div id="actual_footer_bottom_section_top"></div> </div> </div> </div> </div> </div> </body> </html> Hey all,
This code was given to me by my client who swears it works, yet I can't seem to get it to function. <?php $now = time(); // or your date as well $your_date = strtotime("2016-06-01"); $datediff = $now - $your_date; $referrals = number_format(162250 + (floor($datediff/(60*60*24)) * 527) + (87920 + (floor($datediff/(60*60*24)) * 45))); ?> //javascript: <script> //vars from template var referrals = "<?php echo $referrals;?>"; var currentdate = new Date(); jQuery("document").ready(function() { jQuery ("#sp-menu > div > nav > ul > li:nth-child(1) > a").html("Home"); jQuery(".referrals").html(referrals); jQuery(".current_date").html((currentdate.getMonth()+1) + "/" + currentdate.getDate() + "/" + currentdate.getFullYear()); jQuery(window).on("scroll", function() { var scrollPos = jQuery(window).scrollTop(); if (scrollPos <= 0) { jQuery(".counter").fadeIn(); jQuery(".sec-nav").fadeIn(); } else { jQuery(".counter").fadeOut(); jQuery(".sec-nav").fadeOut(); } }); }); </script>
hope someone can help me out here, stuck on this page... This page shows the details of the listing they had just clicked on on the previous page. this part works If the person logged in is the person who is looking at the page, the email section does not show. this part works However, the part I cannot get to work, is when the logged in user types their email message and clicks send email. at this point the details of listing stop showing please SOMEONE HELP ME thanks in advance, i hope Code: [Select] <?php // Start the session require_once('startsession.php'); // Insert the page header $page_title = 'Listing Details'; require_once('header.php'); require_once('connectvars.php'); // Show the navigation menu require_once('navmenu.php'); if(isset($_POST['submit'])){ $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // Retrieve the user data from MySQL $query1 = 'SELECT email FROM ob_user WHERE username="' . $user_name . '"'; $data1 = mysqli_query($dbc, $query1); $row1 = mysqli_fetch_array($data1); $email = $row1['email']; $to = $email; $subject = 'OurBazzar response to' . $subject . ''; $body = $_POST['email']; $headers = 'From: caleb.jordan.flax@gmail.com'; if (mail($to, $subject, $body, $headers)) { echo("<p>Message sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } end(); } if (isset($_GET['listing_id']) && isset($_GET['subject']) && isset($_GET['description']) && isset($_GET['price']) && isset($_GET['date']) && isset($_GET['city']) && isset($_GET['state']) && isset($_GET['user_id']) && isset($_GET['category_id'])) { // Grab the score data from the GET $listing_id = $_GET['listing_id']; $title = $_GET['subject']; $description = $_GET['description']; $price = $_GET['price']; $date = $_GET['date']; $city = $_GET['city']; $state = $_GET['state']; $userid = $_GET['user_id']; $categoryid = $_GET['category_id']; } // Connect to the database $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // Retrieve the user data from MySQL $query = 'SELECT username FROM ob_user WHERE user_id="' . $userid . '"'; $data = mysqli_query($dbc, $query); $row = mysqli_fetch_array($data); $query1 = 'SELECT name FROM ob_category WHERE category_id="' . $categoryid . '"'; $data1 = mysqli_query($dbc, $query1); $row1 = mysqli_fetch_array($data1); $user_name = $row['username']; $category_name = $row1['name']; echo '<table>'; echo '<tr><td colspan="2"><strong>' . $title . '</strong></td></tr>'; echo '<tr><td>Created by: </td><td>' . $user_name . '</td></tr>'; echo '<tr><td>Date created: </td><td>' . $date . '</td></tr>'; echo '<tr><td>Location: </td><td>' . $city . ', ' . $state . '</td></tr>'; echo '<tr><td>Category: </td><td>' . $category_name . '</td></tr>'; echo '<tr><td>Description: </td><td>' . $description . '</td></tr>'; echo '</table>'; if ((isset($_SESSION['username'])) && ($_SESSION['username'] != $user_name)) { ?> <br /> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <fieldset> <legend>Send Email to <?php echo $user_name; ?></legend> <label for="email">Message: </label> <input type="text" name="email" /><br /> <input type="submit" value="Send Email" name="submit"> </fieldset> <?php } require_once('footer.php'); ?> I made this for my site and decided to share with the community. Depending on how you do the code and where, this can keep count of the views in different ways. Please read the somewhat directions have in the code, make a folder called counters, and be sure to include this below function file. I named the function file index.php and belongs in the counters folder you make. <?php /* name this file index.php and place it into a folder called counters the function will create a unique text file for each unique item, good for posts or pages and store all the files in the counters folder For the total website views,add this to your header file or top of your page <?php include('counters/index.php'); $website_view_url = "http://".$_SERVER['HTTP_HOST']; } $website_views = getViews("$website_view_url"); echo "<br />".$website_views."<br />"; ?> For the total pages or scripts views,add this to your header file or top of your page <?php include('counters/index.php'); $total_page_view_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; } $total_page_views = getViews("$total_page_view_url"); echo "<br />".$total_page_views."<br />"; ?> For entire urls including queries,add this to your header file or top of your page <?php include('counters/index.php'); $page_queries_view_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; if (!empty($_SERVER["QUERY_STRING"])) { $page_queries_view_url .= "?".$_SERVER['QUERY_STRING']; } $page_queries_views = getViews("$page_queries_view_url"); echo "<br />".$page_views."<br />"; ?> for usage in posts like by id: if do not want the pages counted and did not do the above code,include the below somewhere near the beginning of your page <?php include('counters/index.php');?> Then in the posts loop, you can associate your $row['id']; or some other unique value <?php $post_views = $row['id']; $post_views = getViews("$post_views"); echo "<br />Post Views ".$post_views."<br />"; ?> if would like to combine any the above or use them all, just be sure to just include include('counters/index.php'); only one time */ function getViews($views_count_value) { $views_count_value = md5("$views_count_value"); $views_count_file_name = "counters/$views_count_value.txt"; if (!file_exists($views_count_file_name)) { $views_count =0; $file_handle = fopen($views_count_file_name, 'w') or die("can't open file"); fwrite($file_handle, "$views_count"); fclose($file_handle); } $file_handle = fopen($views_count_file_name, "r"); $views_count = fread($file_handle, filesize("$views_count_file_name")); fclose($file_handle); if ($views_count <= 0){ $views_count =1; } else { ++$views_count; } $file_handle = fopen($views_count_file_name, "w+"); fwrite($file_handle, "$views_count"); fclose($file_handle); return("$views_count"); } ?> I have a form that submits a record and saves it to the database, I've got that working already, I'm trying to figure out if there is a cleaner way to delete a record with a button that gets a value from the unique key, in this case 'id' here is how the delete button looks like: // get info from table $query = "SELECT id, Title, Message FROM table_name"; $result = mysql_query($query); //displaying all data while($row = mysql_fetch_assoc($result)) { echo" <div class='status'><h3>{$row['Title']} <br></h3>" . " <h5>{$row['Message']} <br><br></h5>"; $id = $row['id']; //trying to get unique key from database //delete button echo "</div> <form action='delete.php' method='post' /> <input type='hidden' name='delete' value='yes' /> <input type='hidden' name='id' value='$id' /> <input type='submit' value='remove' /></form>"; } As you can see, i'm trying to give $id a unique value but for some reason i'm not getting it. The delete.php code looks like this: if (isset($_POST['delete']))// check if delete was clicked { $query = "DELETE FROM table_name WHERE id='$id'"; echo "$id Deleted successfully"; } elseif(!mysql_query($query, $db_server)) { echo "DELETE failed: $query<br />" . myql_error() . "<br /><br />"; } mysql_close(); I'm new to php and still learning so, if you think there are other ways to do this, please let me know, the button won't do anything to the data. Thanks in advance I have a simple form to add details to the database. I want to use the same form layout to call back details for editting and updating. The main page is showroomedit.php which lists (in an array) the records in the database. I have added an edit.php but cant seem to work the code out. Can some one point me in the right direction. here is edit.php: <?PHP include('dbconnect.php') ?> <HTML> <HEAD> <TITLE>Barry Ottley Motor Co - Quality Used Motors - Stanford-Le-Hope, Essex</TITLE> </HEAD> <BODY LINK="#000000" ALINK="#000000" VLINK="#000000"> <CENTER><IMG SRC="logo.jpg"></CENTER> <CENTER> <TABLE WIDTH="840" CELLPADDING="0" CELLSPACING="0" BORDER="0"> <TR> <TD WIDTH="186" valign="top"> <BR> <CENTER><A HREF="index.html"><IMG SRC="homepage.jpg" alt="Homepage" border="0"></A></CENTER> <CENTER><A HREF="showroom.php"><IMG SRC="showroom.jpg" alt="Our Online Showroom" border="0"></A></CENTER> <CENTER><A HREF="location.html"><IMG SRC="ourlocation.jpg" alt="Our location" border="0"></A></CENTER> <CENTER><A HREF="aboutus.html"><IMG SRC="aboutus.jpg" alt="About Us" border="0"></A></CENTER> <CENTER><A HREF="contactus.php"><IMG SRC="contactus.jpg" alt="Contact Us" border="0"></A></CENTER> </TD> <TD WIDTH="30" valign="top"> </TD> <TD valign="top"> <FONT SIZE="2" FACE="ARIAL"> <CENTER><A HREF="addcar.html"><IMG SRC="vehicleadd.jpg" border="0"></A><A HREF="showroomconfig.php"><IMG SRC="vehicleedit.jpg" border="0"></A><A HREF="showroomconfig.php"><IMG SRC="vehicledelete.jpg" border="0"></A></CENTER> <CENTER><B>Update a Vehicle</B></CENTER> <BR> <?php $query1="SELECT cars FROM CarName='$carname', CarTitle='$CarTitle', CarPrice='$carprice', CarMiles='$carmiles', CarDescription='$cardesc'"; mysql_query($query1); mysql_close(); ?> <form action="editvehicle.php" method="post"> <CENTER>Vehicle Name:</CENTER> <CENTER><input type="text" name="CarName" value="<?php echo $carname; ?>"></CENTER> <br> <CENTER>Vehicle Type:</CENTER> <CENTER><input type="text" name="CarTitle" value="<?php echo $cartitle; ?>"></CENTER> <br> <CENTER>Vehicle Price:</CENTER> <CENTER><input type="text" name="CarPrice" value="<?php echo $carprice; ?>"></CENTER> <br> <CENTER>Vehicle Mileage:</CENTER> <CENTER><input type="text" name="CarMiles" value="<?php echo $carprice; ?>"></CENTER> <br> <CENTER>Vehicle Description:</CENTER> <CENTER><textarea name="CarDescription" rows="10" cols="30" value="<?php echo $cardesc; ?>"></textarea></CENTER> <br> <CENTER><input type="Submit"></CENTER> </form> </TD> </TR> </TABLE> <BR><BR><BR><BR> <CENTER><FONT FACE="VERDANA" SIZE="1"> This website was designed and is hosted by <A HREF="http://www.IRCDirect.co.uk">IRC Direct Website Design™</A> 2010 </CENTER> <BR> <CENTER><A HREF="admin.php">Employee Area</A> </BODY> </HTML> That is not even showing me the table details at all. Im lost . There is an "Update" link in each array in showroom.php in which when the user clicks it opens edit.php . They update the form as they wish... then click update and it updates the database and sends them back to showroomedit.php Much help would be appreciated ! Cheers paul if your out there still How can I say, if more than one of these if's happens do this.... Code: [Select] if ((!isset($_POST['state'])) && (($_POST['country'] != $r['country']) || ($_POST['city'] != $r['city']))) { $details = $_POST['city'].', '.$_POST['country']; update_user_actions(1, $details); } else if ((isset($_POST['state'], $_POST['city'])) && (($_POST['state'] != $r['state']) || ($_POST['city'] != $r['city']))) { $details = $_POST['city'].', '.$_POST['state']; update_user_actions(1, $details); } if ((isset($_POST['credentials'])) && ($_POST['credentials'] != $r['credentials'])) { $details = ''; update_user_actions(2, $details); } if ((isset($_POST['specialties'])) && ($_POST['specialties'] != $r['specialties'])) { $details = ''; update_user_actions(3, $details); } if ((isset($_POST['personalweb'])) && ($_POST['personalweb'] != $r['personalweb'])) { $details = $_POST['personalweb']; update_user_actions(4, $details); } I have a counter that updates the database automatically with out refreshing the page. However i was wondering if someone can give me some pointers on how i can keep it updating the database even after someone exits the page. Currently it updates the database every 2 seconds by increasing the number by 1..however i want to be able to do this even if the page i not loaded is there any way i can do this? how do I make $counter add one evertime it runs through the loop: Code: [Select] <?php // Query member data from the database and ready it for display $sql4 = mysql_query("SELECT * FROM labels where item_id='".$pid."'"); $num_rows = mysql_num_rows($sql4); echo $num_rows; while($row = mysql_fetch_array($sql4)){ $label =$row["label"]; $lid=$row['id']; $counter = 0; $counter = $counter + 1; print $counter . "<BR>"; ?> <select name="name<?php echo $counter; ?>"> <?php echo $label; ?>currently, it says counter is 1 everytime Hi, After looking at some Javascript, I think it can only be done in PHP. I'm trying to get my script to add a "1" to an external file. It's made in Javascript, but I hope I can put some PHP in it, even if it's at the end. I'm working on a Safari Extension, and would like to know how many people use it. It's all made in a .HTML file, so I should be able to add a PHP script at the end. I hope this is clear, and I hope it can be done in PHP, or something at least. Thanks, Joseph Duffy Hey all. Have a question, im still learning but what i am trying to do is make the number 1 add 1 to itself and repeat in the loop so, 1 2, 3, 4, 5, 6 ect...What am i doing wrong. $result = mysql_query("SELECT * FROM comments WHERE quoteid = ".$_REQUEST['quoteid'].""); while($row=mysql_fetch_array($result)){ $date = $row[date]; $name = $row[name]; $email = $row[email]; $quoteid = $row[quoteid]; $comment = stripslashes($row[comment]); $commentid = $row[commentid]; $counter = 1; $counted = $counter++; $resultb = mysql_query("SELECT * FROM quotes WHERE quoteid= '$quoteid'") or die(mysql_error()); while($link=mysql_fetch_array($resultb)){ $artist = $link[artist]; $song = $link[song]; } echo'<table border="0" cellpadding="0" cellspacing="0"><tr> <td rowspan="3" align="center"><span class="commentNumber">'.$counted.'</span></td> I am trying to keep track of how many times a page is loaded for debugging. Here is my code but it doesn't seem to work?! Code: [Select] <?php isset($counter) ? $counter++ : $counter=1; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Page A</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <h3>Add a Comment</h3> <form action="Processing.php" method="post"> <fieldset> <!-- Comment --> <label>Comment:</label><br /> <textarea cols="50" rows="15"><?php echo $counter; ?></textarea> <br /> <!-- Submit Form --> <input type="submit" name="addComment" id="addComment" value="Add a Comment"/> </fieldset> </form> </body> </html> What am I doing wrong? Debbie hi there i am looking to build a button counter. and i am wondering of you could help. i want the button to +1 every time someone clicks it and also store the value so it can be used as a voucher code. can anyone help thanks Hi, I can't think how to make a counter which goes up during the day, and when a new day starts it gets reset to 0. How can I do this without relying on visitors to the site to run the script? Cheers, Tom. <?php $counter_name = 'Counter.txt'; if (!file_exists($counter_name)) { $f = fopen($counter_name, "w"); fwrite($f,"0"); fclose($f); } $f = fopen($counter_name,"r"); $counterVal = fread($f, filesize($counter_name)); fclose($f); $counterVal++; $f = fopen($counter_name, "w"); fwrite($f, $counterVal); fclose($f); echo $counterVal; ?> This is click counter... Counter.txt only number... How to add a date? Counter / Date 1. 2021-02-28 19:50:47 2. 2021-02-23 17:57:11 etc
I know this should be easy but I cannot find right query to do this online. I simple want a counter of each result of my query. What is the proper way to query this.
For example
1 | Result 1
2 | Result 2
3 | Result 3
The one I found online did a weird grouping counter.
Thanks
I'm not sure if this is the right form I may need to put this in the mySQL forum so apologies if it's in the wrong place. I would however like to do this in php. What I need to do is set up a counter that resets every day at midnight. So it would start with 01 and count up till 12:00AM server time and then reset to 01 for the next day. This is for an ordering system to add a number to the end of any order. Any help is much appreciated. I know it's not much info but I'm not even sure where to begin such a thing. hi all, i have made a counter as a module for my website. when i directly go to de module and start de counter i see the picure en he does his work, butt wen i call it in de index.php by include('modules/counter/counter.php') then i see een not loaded picturebox and i dont know why it doesnt works ? you can see the counter and the problem on: http://nieuw.pc-hulp-online.nl/index.php can someone help me to make it als work with include()?? thnx I have music (my own) that I want to put on my website for download, and I was wondering if there is a way to keep track of how many people download each song, by tracking the clicks and displaying that number in a css-styled box. Anyone know how this is done? I don't need help with the css, just the php. Need some help on my result counter. I am using a search box to return data from my database i can get the result returned fine but i am having problems getting the total number of result returned. It only returns the number of results per page as i am using a paginate. Can some one point me in the right direction. The number count im using is below. Code: [Select] $num_rows = mysql_num_rows($sql); echo "$num_rows Results Found\n"; |