Help running script in dynamic link

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Help running script in dynamic link
TTG_SPEED
CZ Newbie
TTG_SPEED has been a member for over 14 year's 14 Year Member
Status: Offline
Joined: Nov 08, 2010
0.00 posts per day
Posts: 1
Points: 0
   
Ok so I have a script which functions like gyazo if you know what that is.
Every time it uploads the picture, it opens a new tab with the picture you captured. That script is php.

I need to add my adsense script so every time one of those pictured is opened there is an ad at the bottom of it.

Here's an example of a link. [ Register or login to view links on this board. ]

The PHP script for this is:


<?php
if(isset($_FILES['imagedata']['tmp_name']))
{
   $newName = 'i/' . substr(md5(rand() . time()), 0, 8) . '.png';
    $tf = fopen($newName, 'w');
    fclose($tf);
    move_uploaded_file($_FILES['imagedata']['tmp_name'], $newName);
    echo 'http://ttgspeed.com/' . $newName;
}
?>


The adsense script is:
<scr1pt type="text/javascript"><!--
google_ad_client = "ca-pub-1965742936909722";
/* ttgspeed1 */
google_ad_slot = "4936755071";
google_ad_width = 728;
google_ad_height = 90;
//-->
</scr1pt>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</scr1pt>


Any help with this would be greatly appreciated.

Everything I've looked at suggests this has to be done with javascript (hence it being in this section)


Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
It's not as easy as 1-2-3.

Your going to have to use a session or cookie to recognize that it is the users first visit to the image otherwise the ad will always show up.

I would look at php sessions to track that. Then make a page that opens on the first visit with your ad in it.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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
You cannot attach files in this forum
You cannot download files in this forum