[PHP] Returning FORM vars from popup

2003-09-18 Thread Rich Fox
(Sorry, I inadvertently sent an incomplete post)

I have a popup window, itemSelect.php, from which I would like to reload the
calling page. itemSelect.php has a form, and I want to reload the calling
page with these form variables. How can I do this? I can reload the page
easily enough, with this test code in itemSelect.php:


 
 


Not surprisingly, this doesn't work. My calling page reloads and the popup
closes, but the onClick code bypasses the form and newparam doesn't get
passed. What, please, is a good way to  accomplish passing newparam (and
other form vars) back to the calling page?

Many thanks,

Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Returning form vars from popup

2003-09-18 Thread Rich Fox
I have a popup window, itemSelect.php, from which I would like to reload the
calling page. itemSelect.php has a form, and I want to reload the calling
page with these form variables. How can I do this? I can reload the page
easily enough, with

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Opening new browser window

2003-09-19 Thread Rich Fox
I would like to open a new browser window from within my php script
(edit.php), a window in which another php page is run (search.php).
search.php should be able to receive $_POST vars etc. from edit.php. I am
not sure that the javascript solution to popup a window is correct, because
then the popup does not behave normally.

By normally, I mean that when I use javascript to popup a new window
(search.php), and in search.php I have a form


 
  >
  >
 
 


clicking OK or Cancel does absolutely nothing. So, I would like to avoid
javascript and simply open a new browser window to run search.php. What is
the accepted way to do this in php?

tia,

Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Opening new browser window

2003-09-19 Thread Rich Fox
And if you are not in a form? My current code is:


   
 

where popup is my javascript function. But as I said below, the popup
doesn't work as expected and I do not want to use javascript. I can also not
be in a form. Suggestions?

Rich

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message

> 
>
>
> Rich Fox wrote:
>
> > I would like to open a new browser window from within my php script
> > (edit.php), a window in which another php page is run (search.php).
> > search.php should be able to receive $_POST vars etc. from edit.php. I
am
> > not sure that the javascript solution to popup a window is correct,
because
> > then the popup does not behave normally.
> >
> > By normally, I mean that when I use javascript to popup a new window
> > (search.php), and in search.php I have a form
> >
> > 
> >  
> >   >
> >   >
> >  
> >  
> > 
> >
> > clicking OK or Cancel does absolutely nothing. So, I would like to avoid
> > javascript and simply open a new browser window to run search.php. What
is
> > the accepted way to do this in php?
> >
> > tia,
> >
> > Rich
> >

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] popups, parents, parameters, and php

2003-09-19 Thread Rich Fox
I have been asking specific questions, and getting helpful answers, but I
realized I am getting ahead of myself and thinking about the trees when I
don't see the forest yet. I would like to describe what it is I want to do
in general, and then hopefully you can point me in the right direction so I
use html, php, and javascript together in some kind of reasonable way. I
feel like I am re-inventing the wheel, and badly. What I want to do must
have been done a zillion times by other web programmers already.

I have a php page (edit.php) with a form with some text fields and a select
menu (select1). I want users to be able to add entries to the select1 menu,
and would like to use a popup window to do this. In the popup window, the
user is presented with a form with a select menu of all possible entries.
The user can make multiple selections from this list in the popup, and when
the popup's form is submitted, I want the select1 menu in edit.php to
reflect these additional entries selected from the popup.

Those are the requirements. Should be easy, but I am finding it very
difficult to tie the pieces together.

Any advice or url of a relevant tutorial would be greatly appreciated.
Thanks,

Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: popups, parents, parameters, and php

2003-09-19 Thread Rich Fox
my colleague just suggested that my popup, on the form submit, can call
another page which just registers the items selected as session variables.
This seems like a good idea. Of course, I will have to reload the original
calling page, edit.php, so it can check those session varibles and amend the
select1 list. I am going to try this, but I would still greatly appreciate
any advice. Thanks, Rich

"Rich Fox" <[EMAIL PROTECTED]>

> I have been asking specific questions, and getting helpful answers, but I
> realized I am getting ahead of myself and thinking about the trees when I
> don't see the forest yet. I would like to describe what it is I want to do
> in general, and then hopefully you can point me in the right direction so
I
> use html, php, and javascript together in some kind of reasonable way. I
> feel like I am re-inventing the wheel, and badly. What I want to do must
> have been done a zillion times by other web programmers already.
>
> I have a php page (edit.php) with a form with some text fields and a
select
> menu (select1). I want users to be able to add entries to the select1
menu,
> and would like to use a popup window to do this. In the popup window, the
> user is presented with a form with a select menu of all possible entries.
> The user can make multiple selections from this list in the popup, and
when
> the popup's form is submitted, I want the select1 menu in edit.php to
> reflect these additional entries selected from the popup.
>
> Those are the requirements. Should be easy, but I am finding it very
> difficult to tie the pieces together.
>
> Any advice or url of a relevant tutorial would be greatly appreciated.
> Thanks,
>
> Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: forcing variable expansion

2003-09-21 Thread Rich Fox
That's not Eugene from the dojo is it?

Rich


"Eugene Lee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If I have a block of text saved in an external text file, e.g.:
>
> All {$badstuff} and no {$goodstuff} makes {$name} a dull {$type}.
>
> after reading the text into a string, is there a way to force variable
> expansion?  In a sense, it's like having a heredoc for multiline strings
> with variable expansion while not having the heredoc embedded in PHP code.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: forcing variable expansion

2003-09-22 Thread Rich Fox
Sorry, we have a Eugene Lee at my aikido school and it's such an unusual
name I thought you might be him.

"Eugene Lee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sun, Sep 21, 2003 at 03:01:41PM -0400, Rich Fox wrote:
> : "Eugene Lee" <[EMAIL PROTECTED]> wrote:
> : >
> : > If I have a block of text saved in an external text file, e.g.:
> : >
> : > All {$badstuff} and no {$goodstuff} makes {$name} a dull {$type}.
> : >
> : > after reading the text into a string, is there a way to force variable
> : > expansion?  In a sense, it's like having a heredoc for multiline
strings
> : > with variable expansion while not having the heredoc embedded in PHP
code.
>
> Question already answered by another helpful soul: use eval().
>
> : That's not Eugene from the dojo is it?
>
> Hmmm?  What dojo?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] using a php variable in javascript

2003-09-22 Thread Rich Fox
I have a page with the following code:










I have 'CompanyEdit' hardcoded, but what I want instead is something like:

so = window.open('','$callerWin');

This does not work, of course, but you get the idea: I want to use the value
of the $callerWin php variable in my javascript. Can someone tell me the
syntax for this? My reading of the documentation and trial-and-error have
not met with success.

thanks,

Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] for loop break and continue

2003-09-25 Thread Rich Fox
Hi,
Is there an equivalent to the C++ 'break' command to stop execution of a for
loop? I know I can use 'goto' but I don't want to unless I have to.

for ($i=0; $i<$n; $i++)
if (some condition)
break;

And, what about 'continue' which skips the rest of the code in the for loop
and immediately goes on to the next iteration?

Thanks,

Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] for loop break and continue

2003-09-25 Thread Rich Fox
DOH!

This is a new addition to PHP because it wasn't there before!

Thanks for the slap.


"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Take the sample code below, paste it to a PHP file, add a real
> conditional, execute script. Voila, you've taken the first step towards
> helping yourself.
>
> Cheers,
> Rob.
>
>
> On Thu, 2003-09-25 at 11:42, Rich Fox wrote:
> > Hi,
> > Is there an equivalent to the C++ 'break' command to stop execution of a
for
> > loop? I know I can use 'goto' but I don't want to unless I have to.
> >
> > for ($i=0; $i<$n; $i++)
> > if (some condition)
> > break;
> >
> > And, what about 'continue' which skips the rest of the code in the for
loop
> > and immediately goes on to the next iteration?
> >
> > Thanks,
> >
> > Rich
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] for loop break and continue

2003-09-25 Thread Rich Fox
Can't you let me have a shred of programming self-respect?

Rich (I should have cracked the book) Fox

> On Thu, 2003-09-25 at 12:04, Rich Fox wrote:
> > DOH!
> >
> > This is a new addition to PHP because it wasn't there before!
> >
> > Thanks for the slap.
>
> PHP has supported break for as long as I can remember which goes back to
> about 1999 and PHP 3.something.
>
> Cheers,
> Rob.
>
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] documentation on "<<<"

2003-10-01 Thread Rich Fox
Can someone point me to documentation on the <<< operator? I am wondering if
there are some quirks I don't know about. Yet I can't find it documented on
the php website.

THanks,

Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Reloading a specific window

2003-10-02 Thread Rich Fox
Warning for server side purists: My php scripts use javascript to popup and
close windows. So this question, although posted to a php newsgroup, has
elements of javascript too. Gasp! No flames please.

I have a main window which I will refer to as mainwindow
(window.name='mainwindow' in the onload event). The script loaded into it is
mainListing.php. From mainListing.php I popup another window, with a form
and a save button. The form's action is "action.php"

In action.php I update the database and then would like to: (1) refresh
mainwindow so it reflects the database changes, and (2) close the popup
window.

I have been reading, tweaking, trying different things but nothing is
working. Currently, the action script does:
...
elseif (isset($_POST['btnSave']))
{
   .. update the database, then ...
header("Location: ".$_POST['CallingScript']."?ID=".$_POST['ID']);
exit;
}
...

This reloads the popup window, and then I have a "close" button to close the
popup. Then I have to refresh the browser window manually to see the updated
table from the database. Can I get some advice on how to accomplish (1) and
(2) above?

Many thanks,

Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Reloading a specific window

2003-10-02 Thread Rich Fox
This does not work, when I replace my header function with:
elseif (isset($_POST['btnSave']))
{
.. database update, then...
$ostr = <<< OUTPUT;
 
  document.window.opener.reload()
  self.parent.close();
 
OUTPUT;
 echo $ostr;
 //header("Location: ".$_POST['CallingScript']."?ID=".$_POST['ID']);
 exit;
}

several things happen: the database update does not happen, the mainwindow
does not reload, and my form disappears from the popup frame and this frame
is blank.
I am probably doing something very stupid.

Marek Kilimajer wrote
> Output from action.php:
> 
> opener.location.reload();
> close();
> 
>
> Rich Fox wrote:
> > Warning for server side purists: My php scripts use javascript to popup
and
> > close windows. So this question, although posted to a php newsgroup, has
> > elements of javascript too. Gasp! No flames please.
> >
> > I have a main window which I will refer to as mainwindow
> > (window.name='mainwindow' in the onload event). The script loaded into
it is
> > mainListing.php. From mainListing.php I popup another window, with a
form
> > and a save button. The form's action is "action.php"
> >
> > In action.php I update the database and then would like to: (1) refresh
> > mainwindow so it reflects the database changes, and (2) close the popup
> > window.
> >
> > I have been reading, tweaking, trying different things but nothing is
> > working. Currently, the action script does:
> > ...
> > elseif (isset($_POST['btnSave']))
> > {
> >.. update the database, then ...
> > header("Location: ".$_POST['CallingScript']."?ID=".$_POST['ID']);
> > exit;
> > }
> > ...
> >
> > This reloads the popup window, and then I have a "close" button to close
the
> > popup. Then I have to refresh the browser window manually to see the
updated
> > table from the database. Can I get some advice on how to accomplish (1)
and
> > (2) above?
> >
> > Many thanks,
> >
> > Rich
> >

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Nested queries don't work

2003-10-15 Thread Rich Fox
I have the following code querying MS SQL Server

$query = "SELECT * FROM mytable";
$res = mssql_query($query);
$nr = mssql_num_rows($res);
for ($i=0; $i<$nr; $i++)
{
$a = mssql_fetch_array($res);
$query = "SELECT * FROM anothertable WHERE id=".$a['anotherID'];
$res1 = mssql_query($query);
$anr = mssql_num_rows($res1);
...
}

This does NOT work! It seems that the 2nd query steps on the results of the
first one! Can someone verify this effect? I am 99.999% sure this is what's
happening. Who is the bonehead responsible for not implementing this for MS
SQL Server?

Thanks

Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Shouldn't script errors show in my browser?

2003-10-17 Thread Rich Fox
I hope this question is not too stupid! When I have an error in my script,
it seems to me that the web server, or in my case the php CGI module I am
using for testing, should send something back to my browser displaying an
error message. Instead, I can write any garbage I would like in my php
script and the browser just shows me a blank page. Is this because I am
running php as a CGI module?

Thanks,

Rich

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Shouldn't script errors show in my browser?

2003-10-17 Thread Rich Fox
Yeah, that did it, thanks

"David Otton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Fri, 17 Oct 2003 11:29:41 -0400, you wrote:
>
> >I hope this question is not too stupid! When I have an error in my
script,
> >it seems to me that the web server, or in my case the php CGI module I am
> >using for testing, should send something back to my browser displaying an
> >error message. Instead, I can write any garbage I would like in my php
> >script and the browser just shows me a blank page. Is this because I am
> >running php as a CGI module?
>
> Try cranking your error reporting level up in php.ini
>
> http://uk2.php.net/manual/en/ref.errorfunc.php#ini.error-reporting
>
> Check the display_errors directive while you're at it. Don't forget to
> restart the webserver.
>
> Also, sometimes errors don't show because they're embedded in HTML.
>
> Eg
>
> 
>
> would return
>
> 
>
> And you'll have to examine the un-parsed HTML to find the error.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Use include function (newbie)

2003-10-17 Thread Rich Fox
But *why* does logic.php need html.php?

There is no recursion issue, or endless nesting of includes, because
html.php refers to logic.php as an action for a form... this does not
"include" the logic.php code into the html.php page.

Rich


"Karina S" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I make a site where I list data from a mysql database. I want to divide
the
> task into 2 parts. The 1. php is the logic.php an the 2. is the html table
> (html.php) with field values.
> I plan that the form action in the html.php file call the logic.php but
the
> logic.php includes the html.php.
>
> I mean:
> html.php
> 
> ...
>
> logic.php
> ...
> include('html.php');
>
> On the html.php user can view data and use last, first, next,... buttons
to
> see the whole table.
>
> Question:
> Is it a right way to do this task or this reqursive calls overloads the
> server?
>
> Thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php