[PHP] Single HTML form post affecting multiple HTML frames/PHP scripts

2004-04-14 Thread Richard Lewis
I am writing a database front end in PHP for a record library.
 
My interface is divided into several HTML frames the first of which contains
an HTML select element listing all of the top-level records (CDs) and
several buttons to perform certain operations on the selected record (e.g.
delete, edit).
 
When the 'Edit' button is clicked the record's contents are displayed in
another frame so that it can be altered.
 
Each of these top-level records (CDs) has a number of 'sub-records' (tracks)
which I would like to be able to display in an HTML select element in a
third frame (as above).
 
Ideally, when the user clicks 'Edit' in the first frame with a CD selected,
not only should its details appear in the second frame, but also its tracks
(sub-records) should appear in the third frame.
 
So is there a way of making a single form post affect two scripts in
different HTML frames? Or a way of posting values from the second frame to
the third automatically (i.e. without the user clicking an HTML 'submit'
button)?
 
Cheers,
Richard

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



Re: [PHP] Single HTML form post affecting multiple HTML frames/PHP scripts

2004-04-14 Thread Richard Lewis
Tom Rogers wrote:

> Hi,
> 
> Wednesday, April 14, 2004, 6:57:53 PM, you wrote:
> RL> So is there a way of making a single form post affect two scripts in
> RL> different HTML frames? Or a way of posting values from the second
> frame to RL> the third automatically (i.e. without the user clicking an
> HTML 'submit' RL> button)?
>  
> RL> Cheers,
> RL> Richard
> 
> 
> Post your details to the main page that defines the frames and get
> that page to pass the new details on to the sub pages. that way all frames
> will be regenerated after the post operation.
> 
OK, but the only way I can think to do this is by appending the details to
the URLs:



which will make them available with $_GET. All my coding so far has assumed
that data will be available in $_POST. Is there any way of passing data in
$_POST automatically?

R.

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



[PHP] <button> tag

2004-04-20 Thread Richard Lewis
Hello PHPers,

I'm not sure whether this is the best place to post this message...

Some of the forms I'm using in a PHP project I'm working use the http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: <button> tag

2004-04-20 Thread Richard Lewis
Acutally, I've just worked out why its not working:

I have multiple  tags on the same page which all do different things
(edit/delete/new...). They are all called 'submit' (name='submit') and have
different 'value' values in order that the receiving script may distinguish
between them:

Edit Item
Delete Item

It seems that MSIE doesn't send the value of 'value' when the form is
posted.

Does  allow this sort of functionality?

Cheers,
Richard

Richard Lewis wrote:

> Hello PHPers,
> 
> I'm not sure whether this is the best place to post this message...
> 
> Some of the forms I'm using in a PHP project I'm working use the  type="submit ...> tag to submit.
> 
> They are working fine on Konqueror but don't seem to work properly on
> MSIE. I tried inserting the debug code:
> 
> echo var_dump($_POST);
> 
> into the receiving script and in both Konqueror and MSIE all the values
> were present.
> 
> Does anyone know what might be going on here?
> 
> Cheers,
> Richard

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



Re: [PHP] Re: <button> tag

2004-04-20 Thread Richard Lewis
>In all fairness to IE, it WILL send the value of each button - but PHP
>cannot distinguish between them all because you have given them all
>the same name! :)
>
>RL> Does  allow this sort of functionality?
>
>If it has a unique name, sure:
>
>

So what if I want to know which button was pressed to submit the form?

At the moment I have:

switch ($_POST['submit'])
{
case "edit": ...
case "new": ...
}

R.

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



[PHP] OOP Question

2004-04-07 Thread Richard Lewis
What do members think that this code should do:

class A
{
  var $a, $b;
  function A($a)
  {
$this->$a = $a;
  }
  function prnt()
  {
echo "a=" . $this->$a;
  }
}

class B extends A
{
  function B($a, $b)
  {
parent::A($a);
$this->$b = $b;
  }
  function prnt()
  {
parent::prnt();
echo "b=" . $this->$b;
  }
}

$obj = new B("a","b");
$obj->prnt();

I think it should print
a=a
b=b

but it seems to print (on PHP4)
a=
b=

Cheers,
Richard

PS.
In C++ I would be thinking of virtual functions
and in Java I would be thinking of public/protected
properties.

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