feha
|
| Posted: 03/29/2002, 5:50 AM |
|
I would like to include in Links project the counter for click's...(if someone click's on the link it should count and save in MySQL DB)
in PHP/MySQL is there any way to do it with in CodeCharge projcet by using event's or?
send an e-mail to:
feha@vision.to
|
|
|
 |
Nicole
|
| Posted: 03/29/2002, 5:59 AM |
|
Feha,
refer to this thread: http://www.gotocode.com/disc_viewt.asp?mid=4787
the approach for links is the same and you can use code provided as example.
|
|
|
 |
feha
|
| Posted: 03/29/2002, 6:08 AM |
|
which one of them works best?
I like this snipet:
if (get_param("event_id") != "")
$db->query("update events set hit_number = hit_number+1 where event_id=" . get_param("event_id"));
This should be modified... for Links example and in what EVENT should I include it with in the CC ?
|
|
|
 |
Nicole
|
| Posted: 03/29/2002, 6:26 AM |
|
Feha,
Use this part of code, but change field names to real ones. Note, that you should include hit_number field to links table anyway. Put the code in Open event of the page where user will be redirected to after selecting the link.
You may create temporary page with no html output. Redirect user to this page when any link is selected, execute update code and then redirect user again to selected link.
|
|
|
 |
feha
|
| Posted: 03/29/2002, 7:31 AM |
|
The code bellow i modified is right... but it might be the event...
if (get_param("link_id") != ""){
$db->query("update links set hits_out = hits_out+1 where link_id=".get_param("link_id"));
}
|
|
|
 |
feha
|
| Posted: 03/29/2002, 9:06 AM |
|
There must be a part of code that should do this:
parsing value of link ID for example:
redirect.php?link_id=11
that will parse the link value to the redirect and than redirect should find out the the URL link info...
register the HIT and after that print loaction of URL...
I got an idea.. so will fix it...
)
(I want to keep the project as much as possible with in CC ...)
|
|
|
 |
feha
|
| Posted: 03/30/2002, 3:45 AM |
|
I have finnished the part for link clicks tracking and now works fine...
it counts when someone visit external pages from links...
I wanted to e-nter e-mail notification when someone adds a link...
it does work... first time... if entered second link than it shows...
"Warning: Failed to Connect in c:\inetpub\wwwroot\project\links2\LinkNew.php on line 313
Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\project\links2\LinkNew.php:313) in c:\inetpub\wwwroot\project\links2\LinkNew.php on line 321"
This only appear as i call mail(xxx); function.. ?
Any idea?
|
|
|
 |
feha
|
| Posted: 03/30/2002, 2:14 PM |
|
I found out why occures this Error, I'm using ZoneAlarm Pro (3.0)...
Without ZA the mail(); function works ok...
)
|
|
|
 |
feha
|
| Posted: 03/30/2002, 4:40 PM |
|
http://vision.to/links/Default.php
|
|
|
 |
Christo
|
| Posted: 06/05/2002, 1:20 PM |
|
Has anyone found a solution to this? I'm using the TellAFriend example and am receiving part of the same error as feha ("Warning: Cannot add header information - headers already sent by ...") plus an additional error ("Warning: Failed to Receive in c:\program files\apache group\apache\htdocs ...").
I have made no modifications to the PHP code. I modified my php.ini file so that the "smtp = " line under the "mail function" heading points to my ISP's e-mail server.
Any help would be greatly appreciated.
Thanks.
Christo
|
|
|
 |