Jump to content

Create banners like adsense..


therealwesfoster

Recommended Posts

Thanks lemmin. Would I be able to do something like this?

 

----

 

<script type="text/javascript" src="http://site.com/file.js"></script>

 

file.js would actually be a .php file disguised by the wonders of .htaccess. In there I could set the headers to a javascript file and have it output the required javascript...

 

----

 

Would that work? If not, even still, how would I use a javascript snippet to generate a clickable image?

Link to comment
Share on other sites

If you are going to use PHP anyway, why do you need javascript at all? Your idea would work if the php output a javascript file, but it would be the same as just echoing javascript from a normal php file instead of going through all that extra stuff. I don't think I fully understand your question. Are you looking to do something like this?

<?php
echo "<script type=\"text/javascript\">";
$qry = mysql_query(...);
while ($row = mysql_fetch_assoc($qry))
   echo "document.getElementById(".$row['field'].");//do javascript stuff</script>";
?>

Link to comment
Share on other sites

Not exactly, but thanks for replying again :)

 

I'm wanting to give someone a code like this:

 

<script type="text/javascript" src="http://site.com/file.js"></script>

 

And have the linked image show up on their page right where they put that snippet of code. I would use a php snippet, but javascript is alot more widespread (and adsense does it so I know it's possible)

 

Wes

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.