Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




How Do You Parse Post Variables To A Popup Window?


I know this isnt really a php question but can anyone tell me how
you parse post variables to a popup window, here's my code so far, im
trying to pass the value entered into a radio button:

<head>
<script language="JavaScript" type="text/JavaScript">
var win= null;
function NewWindow(mypage,myname,w,h,scroll)
{
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+','
settings +='width='+w+','
settings +='top='+wint+','
settings +='left='+winl+','
settings +='scrollbars='+scroll+','
settings +='resizable=yes'
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>
<form name="answer" action="result.php" method="post">
<input type="radio" name="group1" value="Milk"> Milk<br>
<input type="radio" name="group1" value="Butter"> Butter<br>
<input type="radio" name="group1" value="Cheese"> Cheese<br>
<input type="submit" name="submit" value="submit" src="result.php"
onClick="NewWindow(this.src,'name',âÆ',âÆ','yes');retur n false" >
</form>
</body>




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Session Variables Disappear When Popup Window Closes
I am in window one (of one) and I popup a second window. Everything is fine.  When the popup window closes the entire session in window one is destroyed!! I have tried everything from named sessions to caches, etc.. This does not happen when i start out with two windows open??

Can't Open A New Fullscreen Popup From Another Popup Window
I can't seem to make a fullscreen popup from a page that is already a fullscreen popup. What I want to do is open another fullscreen popup window from a current fullscreen popup that has the link in it. The link that comes up is http://www.somesite.com/"javascript:void(0);/"

Here is a sample of the code I am working with. Does anyone see anything wrong?

echo '<html>'
echo '<head>'
echo '<script type="text/javascript" src="/uploads/File/Javascripts/new_window_max.js"></script>'
echo '</head>'
echo '<body>'
echo '<a href="javascript:void(0);" onclick="fullScreen('/uploads/File',$row['map'],'');">Map</a><br>'
echo '</body>'
echo '</html>'

Populating Form In Parent Window With Value From Popup Window
I have a text box in the parent window.. now i want to populate this text box with a user_id that i will get from query within a popup window.. How do i get the value from the popup window to be passed to the main window form field in php. I know how it can be done in javascript but when i tried combining javascript and php i dont get the desired result.

Can A Popup Window Return Data To Parent Window?
Is it possible to do the following in php:
I want to have a main form open. In the form I want a button that will
open a popup window so the user can search for something. The user can
then select what they want, and the popup window closes and the main
form (which is still open) shows the search results.

Popup Window That Darkens The Window That Opened It
I just visited a website and saw how they darkened the background page
when a popup was opened. How can I do this using JS and HTML? Is it a
normal popup window?

Popup Window
I have a file called opportunityList.php .It has a search button in it.When I press the button a popup window opens.The file that opens in the popup window is searchOpportunity.php,in which there are some text boxes ,drop down boxes and one submit button.When I press submit button the values in the textboxes should be transfered to the main file i.e. from searchOpportunity.php to opportunityList.php and the window should close.

Popup Window
I am trying to make a popup window that when I click on a picture it pops up a new window with the bigger picture in it. Code:

Popup Window And Sessions
I encounter some troubles using $_SESSION, since I use a popup window
in my php code. I mean, $_SESSION['id'] contains a certain value, when
I click to get popup window opened, $_SESSION['id'] value has changed,
without being reaffected explicitly...

Sending Data To Popup Window
I have a table and when i do click in one of its parameters i open a popup window and obtain some data. It works ok when the parameter i do the link are just numbers(ex: 12345) but if i have other simbols on it doesn't work, for example: if i have 12345-1 instead of sending to the popup 12345-1 it sends 12344.

Passing Vars - Popup Window Problem
I currently have a problem passing a variable value from one page to
another. Once a form submit button is pressed java pops up a window and
displays some information. The problem being is variables value needs to
be passed from the main page to this popup window ... but it isn't. why?

the submit button one the PHP page is

$s_download_action = "index.$phpEx?page=downloads";

$download_url = "download.$phpEx";

$hidden_download_vars = '<input type="hidden" name="download_id"
value="' . $d_id . '" />'
$u_download = "<input type="submit" name="get_download" value="" .
$lang['Download'] . "" class="mainoption" onClick="window.open('" .
$download_url . "', '_spdownload', 'HEIGHT=250,resizable=yes,WIDTH=
400');return false;" />";

echo '<form action="' . $s_download_action . '" method="post">'
echo $hidden_download_vars . '' . $u_download;
echo '</form>'

[php] Using Session To Pass Values From A Popup Window...
i got a problem here. its like this... i have a popup php page... in it details of what is stored in my database is retrieve and displayed out.... but i want to pass the values that is displayed out in the popup window to the main window by using session .....
how can i do that?

Create Popup Window With Product Details
I am attempting to create a popup window using the code that's shown here http://forums.devshed.com/t15928/s.html

I want it to display the product information when a user clicks a link from a table. But, I havent got a clue about where to start. I am displaying an alternate color table from what i assume is a recordset. please excuse my ignorance if this is straight forward as i only just started to attempt anything like this in the last week. PHP Code:

Popup Window List Of Values To Select
What i need to do is bring up a popup window with a list of values(values looked up from the database). The user should be able to select one of the values from the list and the value then populate a text box on the calling form.

Popup Window Show When Php Form Is Validated.
I am using a HTML/PHP form on a website I am doing. The form works and it even redirects to the correct page. However, instead of redirecting to a new page I would like it to call a popup window (600px x 400px)but leave the page that the form is on open so when they close the popup window the page is still there.

Open Popup Window When Page Is Loaded If A Field Is Populated
Would it be possible to open a popup window on loading the instruction page but only when the critical information section of the page contains text?

The popup window could either contain the contents of the critical information section or just a visual warning that such information exists on the main page.

I have a pretty good knowledge of VBA but sadly my knowledge of php and javascript is very limited.

Submitting Php-variables To Popup.
Is it possible to submit php-variables to a popup generated by javascript? I want to do this but is unsure if it will work.

Submit Form Via Post To A New Window?
i want to submit $_POST vars to a new window. is that possible? I tried this and it didnt work...

echo "
<form name='form1' method='post' action="javascriptpen('blarblarblar.php')">
<input name='Submit' type='submit' value='submit'>
<input type='text' name='postvar' value=??'>
</form>";

in the new window, i cant get my postvar.

Re:send Variables To Another Window?
Maybe you can put those variables in a cookie/session?
if you register them like $_SESSION['myvarx'] = $myvar I think that
you can use them in the other window then: $myvar =
$_SESSION['myvarx']
I'm not sure about this.
http://eye.cc php newsgroups

Passing Variables After Window Close
I've got a wee problem I'm having difficulty with. What I have is a form whereby when you click on this button a pop-up calendar appears.

What I'm trying to achieve is that when you do click on a date it closes the window and then refreshes the parent window and displays the date selected. The code below is what I have, but this doesn't work.

Only Allowing Popup To Popup Once
I use an OnLoad event in the body tag to open a popup window. I would like to know how to go about only allowing the window to popup once i.e on subsequent visits to the parent page, the popup np longer pops up. I think it is irritating to users to have to close the popup everytime they visit the page. I think I need to set a cookie so that the server knows the visitor is a return visitor and not a new visitor, but I have no idea how to write the code. I do know a little php so I could combine php and javascript if that is the best way to achieve my goal.

Parse An Email File For Four Variables (easy-intermediate)
Just Beginning to get my feet wet with php, and i have been presented with a challenge (on a deadline even)

We are sent a series of email bullitins daily, and they need to be parsed, and sent to a mySQL database (the database is already prepared to take the incoming messages)

Heres what i've got:
The Message will always begin with:
Return-Path: <push_services@prnewswire.com>
(or some other address)
i would liek to send this to tblMail.MailAddy

next come the junk:
Received: from mail01-ewr.pilot.net (mail-ewr-1.pilot.net [206.98.230.18])
by mail.cintek.com (8.9.3/8.9.3) with ESMTP id HAA29427
for <webguy@cintek.com>; Thu, 13 Jul 2000 07:32:05 -0600
From: push_services@prnewswire.com
Received: from prnmail4 (prnmail4.prnewswire.com [199.230.26.98] (may be forged)) by mail01-ewr.pilot.net with ESMTP id JAA24918 for <webguy@cintek.com>; Thu, 13 Jul 2000 09:22:38 -0400 (EDT)
Received: from hssmtp3 ([198.199.176.20] helo=hssmtp3.prnewswire.com)
by prnmail4 with esmtp (Exim 3.02 #1)
id 13Cj2D-0001Iz-00
for webguy@cintek.com; Thu, 13 Jul 2000 09:28:13 -0400
Received: from [199.230.20.132] (helo=hspdl001.prnewswire.com)
by hssmtp3.prnewswire.com with smtp (Exim 2.05 #1)
id 13Civu-0003sM-00
for webguy@cintek.com; Thu, 13 Jul 2000 09:21:42 -0400
Received: by hspdl001.prnewswire.com (SMI-8.6/SMI-SVR4)
id JAA15992; Thu, 13 Jul 2000 09:21:25 -0400
Date: Thu, 13 Jul 2000 09:21:25 -0400
Message-Id: <200007131321.JAA15992@hspdl001.prnewswire.com>
To: webguy@cintek.com

(it will Always end with To: webguy@cintek.com)

then the message Subject, and Body:
Subject: Researchers Unveil Data on VIRAMUNE(R) (nevirapine) for Prevention of Mother-to-Child Transmission of HIV in Developing Countries
Status:

Researchers Unveil Data on VIRAMUNE(R) (nevirapine) for Prevention of
Mother-to-Child Transmission of HIV in Developing Countries

- More than 1,300 South African Women Participate in Landmark SAINT Trial -

DURBAN, South Africa,
Story Story Story etc.

(What i would like to do is parse the Topic in to its own column, and the message body in to an other.)

(The End of the message Always ends with the word SOURCE, and then a lot more of unneeded information. i would like to drop all of that.)

Can this be done with PHP? Does Anyone have any suggestions on how i would execute it? Feedback would be bliss.

Parse Area - Printing Variables In Single Quotes?
I get the parse error: unexpected T_VARIABLE, expecting ',' or '' when I try to run this code. PHP Code:

Can't See My Post Variables
I work on an application which runs on our Intranet network, so security it's not a big issue, and my phpinfo() get me register_globals on (php 4.1.2 on a Debian system).
The problems is that I can't see my post variables (only with $_POST) and I don't get it . Is there another setting wich overrides php.ini and stop my register_globals ->on to behave properly ?

With Variables And POST
On my online order form, I need to send a few variables to my
credit-card processor. These variables are for non-secure customer
comments, and will be sent through the usual metod, i.e.,
<form action="https://orderpage.ic3.com/hop/orderform.jsp"
method="post">

However, one variable is a text-area box for a detailed customer
comment, and this variable can get pretty long. But my credit-card
processor has a 256 byte maximum length limit for all POSTed
variables. However, I can add as many of these 256-byte variables as I
like.

So how can I accomplish this in the most simple, efficient, and
elegant manner? How can I break up the text-area vaiable into 256-byte
pieces and then send these variables via POST along with all of the
other form variables which will be POSTed through the usual HTML
means?

POST/GET Into Variables
how does this look? should this by me calling ... myforms = new
forms(); work by turning all key/value pairs for both get and post
into variable names of the same name as the get/post key, and the
variable values as the values from the post/get?

class forms {
// Some stuff
var $MyPosts;
var $MyGets;...

Post Cookie Variables
I have a page that include on the top the result of a cookie (i come form a previous page with some inputs) in the second part of the page a form with name surname email etc etc
On submit all the information (cookie + form) are sent by email...
my problem is this: in the email doesn't appear the cookie values
i try to create in the form tab a hidden fiel d with this value

<input name="NewEoc" type="hidden" value="<?php echo $COOKIE['NewEoc'] ?>">

Variables Past By Get And Post
I'd like a generic include that goes at the top of all pages that mysql escapes the variables past to the script. Is there a way to refer to the each of the variables past, for example (in pseudo code):

for(each $XX in (list of get/post variables)) {
$$XX = mysql_escape_string($$XX);
}

Empty Variables And 4.21 (POST/GET)
With global variables set to on, I always had the following in my script to make sure variables had a default value:

if (empty($var)) {
$var = 1;}

Now with 4.21, I changed it to:

if (empty($_GET['var'])) {
$var = 1;}

The problem is sometimes I use GET and sometimes I use POST. With global variables on it didn't matter. Now it does. Is there a way to do this? When I try if (empty($_GET['var']) || empty($_POST['var'])), it doesn't work because one or the other will always be empty at any one time.

Processing GET And POST Variables
Below is a function adapted from one found in phpMyEdit.class.php
http://platon.sk/projects/release_l...hp?project_id=5
phpMyEdit is a form generator for PHP/MySQL.

I think this function works great, especially for forms where data is
redisplayed due to failed validation of user input. I wonder what the
opinion of other PHP users would be.

function get_cgi_var($name, $default_value = null)
{
// From the phpMyEdit project
// Usage: $name = get_cgi_var('name');
static $magic_quotes_gpc = null;
if ($magic_quotes_gpc === null) {
$magic_quotes_gpc = get_magic_quotes_gpc();
}
global $HTTP_GET_VARS;
$var = @$HTTP_GET_VARS[$name];
if (! isset($var)) {
global $HTTP_POST_VARS;
$var = @$HTTP_POST_VARS[$name];
}
if (isset($var)) {
if ($magic_quotes_gpc) {
if (is_array($var)) {
foreach (array_keys($var) as $key) {
$var[$key] = stripslashes(trim(strip_tags($var[$key])));
}
return $var;
} else {
$var = stripslashes(trim(strip_tags($var)));
}
}
} else {
$var = @$default_value;
}
return $var;
// If data is displayed/posted using htmlspecialchars($var)
// return @$HTTP_POST_VARS ? html_entity_decode($var, ENT_QUOTES) :
$var;
};

$name = get_cgi_var('name');

POST Variables And Sockets...
I have a server that uses Cpanel, and my mail server is Cpanel's cppop. I am trying to create an email address. With an older version of Cpanel, you could use this command line through sockets.

GET /frontend/x2/mail/doaddpop.html?email=emailaddress&domain=mysite.ca&password=emailpassword&quota=10 HTTP/1.0
Authorization: Basic $pass

That worked just fine because email addresses were created through GET variables. Now, they have changed it to POST variables. Now, I need to create an email address, while faking the following post variables:

email
domain
password
quota

I know I need to use sockets, and pass the POST variables, but I have no idea how to.

Passing Variables With POST
I have a file named login.php that basically just checks if a username and password are in a MySQL database. If they aren't then it shows access denied. If they are then I want to pass the $name and $pass to project.php in a different directory. Code:

Looping Thru POST Variables
I need to know how to loop thru the variables my script receives from a form with action=post. I need to build a list of only those variables that comes from my checkboxes.

POST Variables Not Coming Through
For some reason, at random posts, the post variables don't get thru to
the server. For example, if there is are two text fields: name and
email... (I have register_globals on)... When I try to update the
database with a query and use $name, $email, the $name is missing or
the $email is missing. I am building an intranet application and all
the 20 or so clients run IE. This happens very rarely. Something like
once in 100 updates.

But I can see this in the log files as update contact set name="",
email="asda@pol.com" where contact_id=918. Notice the name field is
blank. I have JS checks in the client side which does not allow blank
name field..

Is this an IE random error? How do I get over this?

POST Variables From Programs
we are trying to make a program in C++ that will comminicate with a PHP script. But we dont know how to get the variables from the program. We got it figured out with perl/CGI, but PHP seems to be a better way to connect to SQL server. On PHP the GET works, its easy, but it's not secure enough. I need informtion on what headers does the PHP require to get the POSTed data from a program.

Sending Variables As POST?
I am currently trying to send information to another page using the POST method. Unfortuantley I can not find any information on how to do this. Currently I am trying

Header ("Location: newpage.html?var=test&var2=test2");

Obviously this re-directs with the variables, but they are send using GET. Not what it need. Any ideas on how to post these variables to the new page?

Apache/PHP Post Variables
I'm working with someone on a PHP project. The other person is doing
testing of scripts on their personal machine using Apache as a web server.
The production server and the one I'm using are both using IIS.

This other person reports that in their PHP scripts when tested with Apache,
form variable sent via the POST method are not "coming through." (This is
even using the "long method" of specifying them as $HTTP_POST_VARS['x'].)
These same scripts work fine on the the IIS machine (the POST variable come
through).

I've looked online to see if I can find out if anything special must be
specified in the Apache configuration to enable the POST method, and
although I found other people posting similar problems, I saw no reference
to a solution.

Not Catching The Post Variables
For some reason my PHP script is not catching the post variables that should be being sent by this form. Code:

Forward POST-variables
I have a form which should be submitted with either of two actions. Tried with javascript but this seems unreliable. Now looking at php and a processor page as the action of the form (process.php) which then sends the user to the different actionpages...can't figure out how to forward the post-variables to the different pages. Code:

Post Variables From Header Redirect
I'm using header to redirect the browser to another page and in the url I've added ?var1=value1&var2=value2 to pass some argument as get to that script, can I pass in some way, arguments as post in this case ? may I do it in both methos at the same time ?

Passing Post Variables Using Fopen()
I'm trying to pull data from a website and read it into a file the I
can parse. I've done the before to site without post variables but I
can seem to get my statments to work with the post. Can someone help
me out?below is the code I have so far.

$url="www.somesitethatneedspostvariables.com";

$postdata = http_build_query(
array( 'postvarname1' ='value1',
'postvarname2' ='value2'
)
);
$opts = array('http' =>
array(
'method' ='POST',
'header' ='Content-type: application/x-www-form-
urlencoded',
'content' =$postdata
)
);

$context = stream_context_create($opts);
$file = @fopen($url, "r", $content) or die("Connection Error, Please
contact Webmaster ERROR CODE=0xDEADBEEF");

Get Unknown Number Of Variables From POST Or GET.
I am trying to create a page that redirects users to an advertiser's page. The reason for the redirect is statistics about who clicks where.

The situation is simple when I only need to redirect them to a page, but some of the ads on my site include forms which put data in either POST or GET and I need to know how to allow my redirect page to take that data from POST or GET, whatever that data is, and pass it on to the page that the data were intended for.

I think that once I get the data I can simply create a hidden form, on the redirect page, with the data from POST or GET already in it. However, I don't know how to get an arbitrary number of variables from POST or GET.

Search - Pass Variables Or Self Post
I've created a database of documents that is searchable by a variety of fields. Currently I have a PHP page called search.php with a form to get the keywords from the user and it then passes this back to itself, runs a query and displays the results. Doing it this way the address for the search page and the results of the search is the same.

This all works fine and I'm happy with it but I was wondering if it should be implemented differently where the keywords are used as a part of the address like with search engines with Google. I don't know what the advantages or disadvantages is for either method so I'm keen to hear what others think is the best method.

How Can I Pass Variables Via POST In A Script?
Let's assume we have a script that only accepts POST variable input.. How is it possible to pass variables to it (using a php-script)?

How To Loop Through POST Variables And Contents
I am looking for a standard way/function to loop through all POST variables
and their respective contents to update a database record.

Here's my ideal to pass a function and it update:
session variable - "ID" - that holds the record ID to update
$_POST or $HTTP_POST_VARS

The function would update the $_POST vaiables of the ID record with the
$_POST variable's contents.

Get/Post Variables Not Showing Under Windows
I'm quite rusty with PHP and have a little issue. A script transmit parameters to itself through a simple form. It works fine when I run it on aproduction server (Linux+Apache+PHP4). When I run the same script on my development machine (Win2K+Apache2+PHP5) the submited variables
don't show.

Here's some simplified code:

<HTML>
<BODY>

<?php
print_r ($_SERVER);
print_r ($submit);
switch ($submit) {
// ...
}
?>

<FORM METHOD=Get>Display content of:<BR>
<INPUT TYPE=submit NAME=submit VALUE=APACD1>
<INPUT TYPE=submit NAME=submit VALUE=APACD2>
// ...
</FORM>

</BODY>
</HTML>

PHP Not Populating Form Variables Passed Through POST Or GET
I"m running:

Windows Xp SP2
Apache2
PHP5
MySQL4

Everything seems fine and dandy, and I can do scripting on server side, but for some reason I cannot get data from a form to be put into a variable.

I have a simple form in an html page which submits, and in the php script that handles the input, none of the data in the form is going into the variables.

My php.ini file does have all the GPC's in place(ie variable_order, the way they get processed).

How To Process Some Variables, Then Place Them Into POST And Redirect?
I'd like to do the following in PHP. Is there a way?

Someone submits a form with data. I want to process the data, then once I'm done with it, take two of the variables, make them post variables and basically redirect the browser as if the user pressed the submit button with data filled in.

The variables can't appear in the url.

Post Variables After Java Sort Are Lost
I have an HTML table that is being constructed from a MySQL table and
displays a form that includes a check box on 1 of the fields on the form for
each record. I have included in this PHP program a javascript routine called
sorttable.js which is something I found on the internet for sorting tables
and works quite well. The HTML table includes a check box on each record so
the user can select certain records for passing to the next process. This
works fine unless I sort the table on some column and then the POST
variables are lost. When I run the following code there are no POST
variables that will echo except the submit button.

foreach ($_POST as $varName =$value){
echo ($varName . " = " . $value);
}

However, if I don't sort the table the POST variables will be echoed for
every record in the table. I'm not sure why this is happening or how to go
about solving it. When I check certain records on the form and then sort the
table the checks themself don't disappear only the POST variables do. This
prevents me from looping thru the ARRAY to determine the value of the POST
check box for each record to see if it was checked. If I run the above code
but don't sort it I will have several hundred POST variables (several for
each record).

Could someone give me an idea on how to solve this or offer some sort of
work-around?

Forward To Page Alongwith Variables In POST
How to forward a page to another page alongwith the parameters passed into it

I mean I have page a.php
which is called with some parameters in $_POST and I require to pass these to another page with same variables in $_POST


Copyright © 2005-08 www.BigResource.com, All rights reserved