icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old January 9th, 2007, 1:00 PM   #1 (permalink)
Registered User
Comfy Contributor
 
Joined in Jun 2006
106 posts
Gave thanks: 5
Thanked 1 Time in 1 Post
sending form variables to popup

Okay, no matter what i do, i can't get this to work.

search page:
Code:
<form name="myform" id='myform' action="submit-form.php" method="post">
Search:
<input type='text' name='query'>
<a href="#" onclick="win=window.open('submit-form.php',null,'height=700,width=500,status=yes,toolbar=no,menubar=no,location=no'); this.form.target='myWin';this.form.action='http://google.com/search'">Submit Me</a>
</form>

submit-form.php:
PHP Code:
<?php

print "search= $query";

?>

it writes nothing. any suggestions?

Thanks!
-sheep
Savesheep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 9th, 2007, 2:49 PM   #2 (permalink)
Registered User
Comfy Contributor
 
Joined in Jun 2006
106 posts
Gave thanks: 5
Thanked 1 Time in 1 Post
also, this is a form that cannot send the variables in the domain as it uses a password. :/
Savesheep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 9th, 2007, 3:01 PM   #3 (permalink)
Holy hell and a hippie
On a golden path...
 
Gaia's Avatar
 
Joined in Nov 2006
Lives in Canada
Hosted on SH106
392 posts
Gave thanks: 23
Thanked 25 times
Where are you initializing $query??

Try doing some debugging..:

Code:
$query = $_POST['query'];

if ( isset($_POST['myform']) ) {
     echo "Search: ".$query;
} else {
    echo "Form didn't go through correctly!";
}
__________________
||http://eternal-realm.net
||http://usebbzone.com
---------
Go There: Surpass Wiki
----------
|| SH106
Gaia is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 10th, 2007, 11:07 AM   #4 (permalink)
Registered User
Comfy Contributor
 
Joined in Jun 2006
106 posts
Gave thanks: 5
Thanked 1 Time in 1 Post
so i tried your code, and it just came up and said 'form didn't go through correctly!' haha. Any other ideas?

thanks again gaia
Savesheep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 14th, 2007, 3:08 AM   #5 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,079 posts
Gave thanks: 48
Thanked 131 times
You're not submitting the form so the value isn't being sent. If you're wanting to use JavaScript to open a new window at a specific size, you'll have to grab the values and pass them as a query string.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 22nd, 2007, 12:58 PM   #6 (permalink)
Registered User
Fresh Surpasser
 
Joined in Jan 2007
5 posts
Gave thanks: 0
Thanked 2 times
Just to give an example of how you *could* do this...

Code:
<form name="myform" id='myform' action="submit-form.php" method="post">
Search:
<input type='text' name='query' id='query'>
<a href="#" onclick="win=window.open('/somefile.php?query='+document.getElementById('query').value,null,'height=700,width=500,status=yes,toolbar=no,menubar=no,location=yes'); ">Submit Me</a>
</form>
to test it, access it in php like so:

Code:
print $_REQUEST['query'];
davesm is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On