Lodius2000 Posted July 5, 2008 Share Posted July 5, 2008 hi there all, I am trying to make a good ol popup, that is multibrowser, especially firefox compatible, ie target blank doesnt work becuase it forces it into a tab, plus i want this new window to be smaller than a full maximized browser window because it is basically a widget on my page that you dont need once it has done its duty, so i have a close window button that works i tried this page 1 linked to the widget page via target="_blank" and the wiget page contained the follow js in the <head> <script> window.resizeTo(500, 500); </script> that opened a new tab and then resized all the tabs to 500 by 500 so i found this code on the intartubes that i put into a print statement on page 1 from above, but i dont know anything about js <?php print '<a href="../imageupload/index.php" onclick="window.open(\'../imageupload/index.php','popup','width=500,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false\'>Upload photo</a>'; ?> php gives me a parse error saying im missing a comma (,) somewhere in this line, i dunno where to start, or even if this will work. I do like the non resizable, non scroll, non toolbar approach I just want it to be a new window with no tools or bars 500 by 500 that displays my php thanks Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted July 5, 2008 Share Posted July 5, 2008 well it look slike your somehow ending your string halfway through: '<a href="../imageupload/index.php" onclick="window.open(\' I dont use print, however that will be interpreted as onestring will it not. therefore your missing comma should bethe character after that. gdlk Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted July 5, 2008 Author Share Posted July 5, 2008 pc nerd the \ is an escape character so that ' means literally ' not "end string here" notice that the entire string is the same color in the code, meaning it is all 1 string, that is as long as this code interpreter is correct Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted July 5, 2008 Share Posted July 5, 2008 oh yeah - of course sry ( very tired here lol)... try : echo "YOUR STRING"; ie - an dlaternative to print gdlk Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted July 5, 2008 Share Posted July 5, 2008 pc nerd the \ is an escape character so that ' means literally ' not "end string here" notice that the entire string is the same color in the code, meaning it is all 1 string, that is as long as this code interpreter is correct Actually you have only one un-escape delimiter on the string and you have the series of ' (single quotes) if you look at the color coding the comma's in the string are green <?php print '<a href="../imageupload/index.php" onclick="window.open(\'../imageupload/index.php\',\'popup\',\'width=500,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false;\">Upload photo</a>'; ?> Try that Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted July 5, 2008 Author Share Posted July 5, 2008 Darkwater cant believe i didnt see that thanks, //note, I added a target="_blank" in there because the link was opening in the same window but the redone code still just opens a new tab in firefox, no resize in safari it opens a new window but there is no resize either code now looks like <?php print '<a href="../imageupload/index.php" target="_blank" onclick="window.open(\'../imageupload/index.php\',\'popup\',\'width=500,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false;\">Upload photo</a>'; ?> Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted July 5, 2008 Share Posted July 5, 2008 <?php print '<a href="javascript:void();" onclick="window.open(\'../imageupload/index.php\',\'popup\',\'width=500,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\');\">Upload photo</a>'; ?> Okay try that, the first post I was just trying to help you fix your code. I think the way you have it will try to open up the URL cause you have it in a HREF you might want to try echoing a function for it to use (JScript) But try that first. Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted July 5, 2008 Author Share Posted July 5, 2008 darkerangel, that does nothing at all, the link points to javascript:void(); and nothing happens when clicked Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted July 5, 2008 Share Posted July 5, 2008 sorry its javascropt:void(0); Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted July 5, 2008 Author Share Posted July 5, 2008 used javascript:void(0); you had 'scropt', still nothing though Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted July 5, 2008 Share Posted July 5, 2008 this is the exact code I have running on my site (converted to PHP output and to accommodate your usage) <?php echo("<script type=\"text/javascript\">\nfunction uploadwindow() { new_window = window.open('../imageupload/index.php','popup','width=500,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); } </script> <a href=\"javascript:uploadwindow();\">Upload Photo</a>"); ?> Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted July 5, 2008 Author Share Posted July 5, 2008 darker angel ... YOU ROCK solved Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 5, 2008 Share Posted July 5, 2008 Heh, you called him DarkWater before. I guess I'm becoming pretty well known. =P Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.