How can I create a javascript iframe like AdSense

Hi,

I am willing to create a script (PHP) like AdSense but I have not a good knowledge about javascript. So I want to know that how can I create a javascript iframe like AdSense.

Example is given below

Thank you,
pnm123
<script type="text/javascript">
adplace = "123456";
</script>
<script type="text/javascript" src="http://www.mysite.com/show.js"></script>

Open in new window

pnm123Asked:
Who is Participating?
 
Michel PlungjanIT ExpertCommented:
Yes


if (window.adplace==undefined) adplace='000000';
document.write('<iframe src="http://www.yoursite.com/ads.php?id='+adplace+'"/></iframe>')

Open in new window

0
 
Michel PlungjanIT ExpertCommented:
That is not an example.

Show a picture or rendered html, please.
0
 
pnm123Author Commented:
<script type="text/javascript">
adplace = "123456";
</script>
<script type="text/javascript" src="http://www.mysite.com/show.js"></script>

I want to let publishers to add a code like above so the js file have to create an iframe like below using the variable given via js (adplace=123456).

<iframe src="http://www.yoursite.com/ads.php?id=123456"/></iframe>

How can I do something like this. Using document write or something with the variables given by the users?
0
 
pnm123Author Commented:
Thank you very much for your help...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.