A2xA Posted January 28, 2008 Share Posted January 28, 2008 I'm making it where the user types in their 'hub' and it brings them to it. the form for the page before (to send the variable) is: <form action="/hubs/main.php" name="join" method="post"> <input type="text" name="hubid"> <input type="submit"> </form> the next page where the data is sent to is: <html> <head> <SCRIPT LANGUAGE="JavaScript"> <!-- Idea by: Nic Wolfe --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- 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=275,height=300');"); } // End --> </head> </script> <body> <form> <input type=button value="Open the Hub" onClick="javascript:popUp('<?php $hubid = $_POST[hubid]; $file = 'http://wiicharged.com/hubchat/$dir/shout.swf'; echo $file;?>'); </form> </body> </html> The main problem is getting the variables to transfer over from the php to the java (and the submit button not working) Thanks! all help is appreciated! Where it is is at http://wiicharged.com/index.php?action=hubs;sa=join; Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/ Share on other sites More sharing options...
amites Posted January 28, 2008 Share Posted January 28, 2008 There are a couple of problems here, biggest one being that you're not attempting to solve your own problem before asking for help, have you looked at this script yet? specifically this part? <?php $hubid = $_POST[hubid]; $file = 'http://wiicharged.com/hubchat/$dir/shout.swf'; echo $file;?> Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451759 Share on other sites More sharing options...
A2xA Posted January 29, 2008 Author Share Posted January 29, 2008 Yeah, I'm editing the script. I just don't know how to do both php and javascript at the same time. I've been working on it for a few days now. That's why I came here. Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451777 Share on other sites More sharing options...
valtido Posted January 29, 2008 Share Posted January 29, 2008 you have the whole concept wrong there mate. instead of using this eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=275,height=300');"); try and use this window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=275,height=300');"); and i have noticed that on your URL querries there is a ";" (semicolon) after every querry try n eliminate that. Otherwise the answer is just simple mate:) add a target="_bank" on the form tag it will open in a new widnow no script is necessary. like this <form action="/hubs/main.php" name="join" method="post target="_blank" > <input type="text" name="hubid"> <input type="submit"> </form> Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451788 Share on other sites More sharing options...
A2xA Posted January 29, 2008 Author Share Posted January 29, 2008 hahha wow I always seem to overcomplicate things. Thanks! Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451790 Share on other sites More sharing options...
A2xA Posted January 29, 2008 Author Share Posted January 29, 2008 Well, I sort of need it to pop up. I did what you said, but the submit button still isn't working :-X New code: <html> <head> <SCRIPT LANGUAGE="JavaScript"> <!-- Idea by: Nic Wolfe --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function popUp(URL) { day = new Date(); id = day.getTime(); window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=275,height=300');"); } // End --> </head> </script> <body> <form> <input type=button value="Open the Hub" onClick="javascript:popUp('<?php $hubid = $_POST[hubid]; $file = 'http://wiicharged.com/hubchat/$dir/shout.swf'; echo $file;?>'); </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451803 Share on other sites More sharing options...
valtido Posted January 29, 2008 Share Posted January 29, 2008 ok just tell me wot you like to search a database coz i can't see any MYSQL codes there. which means you have not done much with that code. This line is wrong by the way at the end. <input type=button value="Open the Hub" onClick="javascript:popUp('<?php $hubid = $_POST[hubid]; $file = 'http://wiicharged.com/hubchat/$dir/shout.swf'; echo $file;?>'); should be <input type=button value="Open the Hub" onClick="javascript:popUp('<?php $hubid = $_POST[hubid]; $file = 'http://wiicharged.com/hubchat/$dir/shout.swf'; echo $file;?>');" /> basically you have not ended the input loool:) and your <form> tag is plain Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451819 Share on other sites More sharing options...
A2xA Posted January 29, 2008 Author Share Posted January 29, 2008 Um...I corrected it and it..stil won't work... ??? <html> <head> <SCRIPT LANGUAGE="JavaScript"> <!-- Idea by: Nic Wolfe --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function popUp(URL) { day = new Date(); id = day.getTime(); window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=275,height=300');"); } // End --> </head> </script> <form> <input type=button value="Open the Hub" onClick="javascript:popUp('<?php $hubid = $_POST[hubid]; $file = 'http://wiicharged.com/hubchat/$dir/shout.swf'; echo $file;?>');" /> </form> </html> Sorry :-X Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451822 Share on other sites More sharing options...
valtido Posted January 29, 2008 Share Posted January 29, 2008 Here loool it took me a while but there is alot of errors on ur original loool and one thing $dir will appear as empty mate. it may give the wrong directory unlesss you put this code on top: $dir ='WHEREEVER'; <html> <head> <SCRIPT LANGUAGE="JavaScript"> <!-- Idea by: Nic Wolfe --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> function popUp(URL) { day = new Date(); id = day.getTime(); window.open(URL, id , 'toolbar=0','scrollbars=0','location=0','statusbar=0','menubar=0','resizable=0','width=275','height=300'); } </script> <title>s</title> </head> <body> <input type="button" value="Open the Hub" onclick="popUp('http://wiicharged.com/hubchat/<?php echo $dir; ?> /shout.swf');" /> </body> </html> Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451834 Share on other sites More sharing options...
A2xA Posted January 29, 2008 Author Share Posted January 29, 2008 thank you so much. It's actually working now. There's two problems. The variable is inserted with a space? And the document isn't re-sized to my measurements Thanks! Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451860 Share on other sites More sharing options...
A2xA Posted January 29, 2008 Author Share Posted January 29, 2008 Wait, Nevermind, I fixed it. Now it is working without the re-sizing. Do you know why it isn't re-sizing? <html> <head> <SCRIPT LANGUAGE="JavaScript"> <!-- Idea by: Nic Wolfe --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> function popUp(URL) { day = new Date(); id = day.getTime(); window.open(URL, id , 'toolbar=0','scrollbars=0','location=0','statusbar=0','menubar=0','resizable=0','width=275','height=300'); } </script> <title>Join The WiiCharged Hub</title> </head> <body> <input type="button" value="Open the Hub" onclick="popUp('http://wiicharged.com/hubchat/<?php $dir = $_POST[hubid]; echo$dir; ?>/shout.swf');" /> </body> Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451867 Share on other sites More sharing options...
valtido Posted January 29, 2008 Share Posted January 29, 2008 replace this line loool window.open(URL, id , 'toolbar=0','scrollbars=0','location=0','statusbar=0','menubar=0','resizable=0','width=275','height=300'); with window.open(URL, id , 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=yes,width=275,height=300'); Link to comment https://forums.phpfreaks.com/topic/88284-solved-help-with-phpjava-popup-form-button-wont-submit/#findComment-451877 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.