Jump to content

[SOLVED] help with php/java popup form? (button won't submit)


A2xA

Recommended Posts

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;

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;?>

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>

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>

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

 

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

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>

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>

replace this line loool :D

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');

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.