?
Solved

need some html/java code.

Posted on 1998-06-16
13
Medium Priority
?
143 Views
Last Modified: 2010-04-09
I need sponsor to support my expense but no one willing to click the sponsor at all.  One time I saw a guy's homepage what he can do is make the people click all his sponsors before letting the people get in his page(his enter button will not enable unless all sponsor got clicked).  So I think it's a good idea to do that on my page to generate some click for my sponsor.
please email the code/example to funnyweb@hotmail.com if possible thanks.
0
Comment
Question by:pcchiu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
13 Comments
 
LVL 3

Accepted Solution

by:
bigelos earned 480 total points
ID: 1844211
OK,

I'll show you how using JavaScript.  You can also use cookies, but MSIE doesn't do cookies too well.
0
 
LVL 9

Author Comment

by:pcchiu
ID: 1844212
ok, you'll show me how to use it? but where and when and how I should get it?
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844213
OK,

Here is the code.  You can easily add more banners.  Just pass a higher number.  Of course, then you would have to change the (total > 2) to whatever it needs to be.  (You have to do a little math here.)

Hope it works for you.

<html>

<head>
<title>Homepage</title>

<script language="JavaScript">
var total=0;
function clicked(){
    total++;
}

function AllClicked() {
    // Change the total coresponding to 1 less than the total passed.  So, if only two banners, use 1
    // For 4, use 3, etc
    if (total > 2) {
         window.location="your_real_homepage";
    }
    else {
       alert('Please visit my sponsors first');
    }
}

</script>

</head>

<body>

<Center>
<a href="your_sponsors_address" target="_blank" onClick="clicked()"><img src="your_banner.jpg"></a>
<P>
<a href="your_other_sponsors_address" target="_blank" onClick="clicked()"><img src="your_other_banner.jpg"></a>
<P>
<a href="your_third_sponsors_address" target="_blank" onClick="clicked()"><img src="your_third_banner.jpg"></a>
<p>
<a href="JavaScript:AllClicked()" target="_top" >Enter</a>
</center>
</body>
</html>

0
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
LVL 9

Author Comment

by:pcchiu
ID: 1844214
I tried the code and I only have 1 sponsor for now so I changed the number to (total > 0).  and only subtitute (one href up) before the javascript:allclciked().  But after I setup the page on the web and test it.  It keep asking to click the sponsor even I clicked the sponsor 10 times and 10 new window was opened...  What's going on?  am I miss something?  You code is easy to follow and seems work great if I can solve that problem.
0
 
LVL 9

Author Comment

by:pcchiu
ID: 1844215
It works great now thanks alot.
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844216
pcchiu,

No problem.  Glad you got it figured out.  Now you just need to come back and grade the answer...
0
 
LVL 9

Author Comment

by:pcchiu
ID: 1844217
One more thing, If the java code show on my page there's no point to use it since all browers can view the source by one click... Is there anyway to hide the java code?  For that I give out 20 more points...
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844218
Nope, sorry, can't hide your java code.  I can write you a Perl cgi script if you are able to run scripts on your site.
0
 
LVL 9

Author Comment

by:pcchiu
ID: 1844219
ok, my site can't run the scripts...
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844220
One thing you can do (since you only have 1 sponsor) is force all your users to open the link to your sponsor.  You can get rid of all the other javascript and just use this:

<a href="your_web_page" target="_blank" onClick="window.location='your_sponsors_web_page'">Enter Here!</a>

What this does is open your web page in a new window, and opens your sponsors web page in the window underneath it.  That way (especially if your sponsor counts the number of hits originating from your site) they will always visit your sponsor, but they won't see the page until they exit from your site.  If you want it the other way around, just swap your_page and your_sponsors_page around.


0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844221
Having not tested the code above, the following might work better:
<a href="your_web_page" target="_blank" OnClick="window.location='your_sponsors_web_page'; return true;">Enter Here!</a>

Or even better yet,
<a href="your_web_page" target="_blank" OnClick="JavaScript:window.location='your_sponsors_web_page'; return true;">Enter Here!</a>

0
 
LVL 9

Author Comment

by:pcchiu
ID: 1844222
Thanks alot i'll try the new code soon.
0
 

Expert Comment

by:Eliza4321
ID: 1844223
Ok you say you need money like a paying banner  I am asking the same question I already have one paying banner and it is from cyber thrill here is the address and it pays 20 cents per click http://www.CyberThrill.com then once you have gotten there go to WebMasters Click for $$$ and then go to banners and you will know what to do from there on!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: blockā€¦
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question