ok here's my script, but first goto my site www.sharabash.com/zudo to see the error i get
This is a pop ad that's suppose to keep on opening till you click on the link

<?php
$call = "<body onunLoad='function popup(ad.php)';>";
?>
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Thanks to Nic Wolfe http://fineline.xs.mw -->

<!-- Begin
function popup(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left = 262,top = 134');");
}

// End -->
</script>

</head>

<body bgcolor=black>

<font color=66ff00>
<h2>Goto the how to make a webpage site
Click <a href="http://www.sharabash.com/zudo/index2.html" target="new" onclick="<?php $func = "true" ?>; reload()">here</a>
</h2>
</font>
<?php

if($func = 'false') echo"$call";
?>

</body>
</html>

    First off, with the PHP you're echoing two body statements which causes the error.

    Take out the php and do it completely in javascript

    inside head

    var clicked="false";

    function click_here(){
    if (clicked =="false"){//show popup again
    popup(url for the popup);
    }
    }

    function set_click(){
    clicked = "true";

    }

    <body onunload='click_here()'>

    link for here
    <a href="#" onclick='set_click;window.close'>here</a>

    This should do what you want, but make it very obvious to the user that clicking here is the only way out!!!!!

      did your school not teach you that popup windows are the root of all evil?

      imho

        it still no work 🙁 it expect object and i too much of a newbie to know what they are

          help? yes? plz? due tomorrow

            While agreeing with andymoo on popups being the root of all evil, especially in any self-replicating form, I am tempted to give it a go:

            first: when javascript doesn't find expected 'objects', this means you are calling some object (probably a function) that doesn't exist (yet). Looking through the reply of mtimdog I noticed he left out the 'popup' function, while it is called in the click_here function. That probably gives you your expected object error.

            second: in the 'here'-link I would put 'set_click();window.close(); return false;' as these are functions being called. The 'return false;' is for prohibiting actually following the link: '#'.

            Hope this helps.. and one more time: make sure the user knows how this works. Oh and just for the record.. I would probably get annoyed with an ad like that (and have it killed).

              Well, I wasn't going to do everything for him.

                You're probably right.. doing your school project (learning how to put up ads??) like this won't learn ye anything..

                But hey, I was in a good mood, it was my first post here at phpbuilder.. :-)

                  i think the only thing to learn with pop ups is that they p*** people off and don't work.

                  we used a popup, highly targetted and left it running till it'd had 250,000 impressions. not a penny from it

                  they are the root of all evil and anyone using them should have their testicles waxed - in my hunble and slightly twisted opinion.......

                    Having a pop-up on every page is annoying....having a pop-up that (with a cookie and some js) only pops up once per day for a particular site is more tasteful.

                    if I have to ctl-alt-del my browser so I can leave your site i'm never coming back (but send people i dislike there for fun😃 😃 )

                      They used to be a useful thing, but now that everyone hates pop up ads and has installed pop up blockers, you cannot even use pop ups in a useful way.

                      It's a real shame that spammers have taken a cool thing and corrupted it to the point that you cannot even use it effectively any more. leave it to commercialism to ruin everything it touches.

                      The other issue is that you have to create several renditions of the javascript so it works for all browser versions.

                        Well, I use popups, but only within web applications, in a predictable manner, when needed (I think popups are useful when you want interaction between a main screen and some tool, within the popup) and on user demand.

                        Popup ads are especially useless, because the first thing anyone will do is kill it. Making it reappear only makes it worse. A nice, attractive but non-irritating ad on the main page is much more useful, in my opinion.

                        Happy coding, Tricky

                          yep they are great for sending out a little e-mail or uploading something to a website, but if people use opera or safari, they don't always work the way you want them to.

                          I am slowly converting all my pop-ups to inline forms though because I have had so many problems making everything work in several browser environments. :-(

                            What specifically do you have trouble with then? I haven't had a lot of trouble using popups until now. I must admit most of the users of our applications use IE.. :-(. But we make a point of it making them work in other browsers too.

                              I used to try closing the pop boxes with javascript after the user completed the form and submitted it. but when some people used pop blocker, it redirected the main window to the pop up url and then when the user submitted the form it would close them out of their browser (after prompting them"the browser window you are using is trying to close...")

                              I also would refresh the parent window after some input like adding an invitee to a party invite list. That would fail if they were not in a pop up window.

                              Another issue with safari is that the window.close script i was using would not close the window - they would have to do it manually.

                              There are also formatting issues because ie/netscape/safari all interpret classes applied to form boxes differently. so if I opened a pop window with no scrollbars or nav buttons, people could not see the submit button, or the input items that flowed beyond the window dimensions. because the size of the form elements are all different depending on the browser.

                              These are just a few of the issues, so I decided to start building everything without using pop ups.

                              The more I develop websites, the more I lean toward simplistic interfaces.

                                Write a Reply...