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;

Link to comment
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.