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 Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/ 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 Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582035 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 Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582038 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 Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582050 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 Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582051 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>'; ?> Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582059 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. Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582063 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 Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582066 Share on other sites More sharing options...
DarkerAngel Posted July 5, 2008 Share Posted July 5, 2008 sorry its javascropt:void(0); Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582070 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 Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582074 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>"); ?> Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582075 Share on other sites More sharing options...
Lodius2000 Posted July 5, 2008 Author Share Posted July 5, 2008 darker angel ... YOU ROCK solved Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582079 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 Link to comment https://forums.phpfreaks.com/topic/113286-solved-how-to-make-a-popup/#findComment-582090 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.