FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


HomeWatched TopicsRegisterSearchDirectory
FAQMemberlistUsergroupsLog inStoresItemsBank
Google

Reply to topic Page 1 of 1
include ()
Message  

Reply with quote
Post include () 
Hey

I have a main php page and i have another php file(counter.php) that i need to include to the main php page, I'm having trouble including the file Please help.

the file i need to include counts clicks, if the user clicks on a specific link it will count it, the problem is i want the counter.php to count a link that is being clicked on the main page, is there a way ?

Thanks

View user's profile Send private message

Reply with quote
Post  
yes you can do that. You can do it through redirecting. For instance on your main.php links you will have:

<a href="counter.php?link=http://google.com">Google.com</a>

then on the counter.php you upgdate your database by getting your link:

$link = $_GET['link'];//now you add your data to the place you need

//your adding code here

header('Location:'.$link);

Regards,
Pratamishus.


_________________
www.eb-downloads.com
FREE E-BOOKS DOWNLOADS.
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Reply with quote
Post  
I tried what you told me and it doesn't seem to work  Sad ...

The Code:

Code:


$strProduct = "<a href=\"order.php?productcategoryid=".$dblProductCategoryID."&producttypeid=".$dblProductTypeID."&productsubtypeid=".$dblProductSubTypeID."&productsubtype2id=".$dblProductSubType2ID."&brandid=".$dblBrandID."";



How will I add the code here ?

Thanks

View user's profile Send private message

Reply with quote
Post  
$strProduct = "<a href=\"order.php?productcategoryid=".$dblProductCategoryID."&producttypeid=".$dblProductTypeID."&productsubtypeid=".$dblProductSubTypeID."&productsubtype2id=".$dblProductSubType2ID."&brandid=".$dblBrandID."";

this is your link on main.php as far as I understand. First of all you do not need to include your counter.php page. If you have ? and/or & signs, this won't work. What you can do is this:

Code:

<script language="javascript">
function sendToCount(myLink)
{
 document.myForm.hLink.value=myLink;
 document.myForm.submit();
}
</script>
<form name="myForm" action="counter.php" method="post" style="display:none">
<input type="hidden" name="hLink" value=""><input type="submit">
</form>
<?php
$strProduct = "<a href=\"#\" onclick=\"sendToCount('order.php?productcategoryid=".$dblProductCategoryID."&producttypeid=".$dblProductTypeID."&productsubtypeid=".$dblProductSubTypeID."&productsubtype2id=".$dblProductSubType2ID."&brandid=".$dblBrandID."')\">click me</a>";

?>


The code above will be on your main.php page. On your counter.php:

$link = $_POST['hLink'];//now you add your data to the place you need

//your adding code here

header('Location:'.$link);


_________________
www.eb-downloads.com
FREE E-BOOKS DOWNLOADS.
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  



Google

FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


Web Design by PlatinumShore.com & Web Hosting by TradeWebHosting.com