Re: [PHP] Jump to internal link after $PHP_SELF post

2001-11-16 Thread Rob van Jaarsveld

Hi Chris, Just a small modification and it works!!!
Many thanks!

Syntax:
onclick=\document.pageform.action='$PHP_SELF#$value'; submit()\




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Jump to internal link after $PHP_SELF post

2001-11-15 Thread Rob van Jaarsveld

Hi there

The following problem occurs in my scripts:

A large page is generated with data from a MySQL database. The various
paragraphs inside this page have variable, internal links, also extracted
from the database.
Example: a name=\$value\/a
Let's assume that $value represents FOO.

Now i want to take the value of this variable to post to $PHP_SELF.
Example: form action=\$PHP_SELF#$value\ method=\post\\n;.
The HTML-source should show something like form
action=/domain/page.php#FOO method=post

This does not work... Output on the source is like form
action=/domain/page.php# method=post, so $value appears to be empty.

Please help, sombody??

Thanks!

Rob.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Jump to internal link after $PHP_SELF post

2001-11-15 Thread Boget, Chris

 A large page is generated with data from a MySQL database. The various
 paragraphs inside this page have variable, internal links, 
 also extracted from the database.
 Example: a name=\$value\/a
 Let's assume that $value represents FOO.

Ok

 Now i want to take the value of this variable to post to $PHP_SELF.
 Example: form action=\$PHP_SELF#$value\ method=\post\\n;.
 The HTML-source should show something like form
 action=/domain/page.php#FOO method=post

Seems straightforward enough...

 This does not work... Output on the source is like form
 action=/domain/page.php# method=post, so $value appears 
 to be empty.

When is $value assigned a value?  Before or after the script prints out
the form action= line?

Chris



Re: [PHP] Jump to internal link after $PHP_SELF post

2001-11-15 Thread Rob van Jaarsveld

Thanks for the quick reaction.

 When is $value assigned a value?  Before or after the script prints out
 the form action= line?

This $value is somewhere within the form page ($PHP_SELF). If i put
$PHP_SELF?#FOO in the script, it all works well. But $value is variable, so
the content depends on the action taken somewhere in the script. The general
idea is that an internal link gives $value it's own value (like a
name=para1, so $value would be para1). After posting to SELF a jump to
para1 must be made.

Is this enough?

Thanx, Rob.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Jump to internal link after $PHP_SELF post

2001-11-15 Thread Boget, Chris

  When is $value assigned a value?  Before or after the 
  script prints out the form action= line?
 This $value is somewhere within the form page ($PHP_SELF). 

So it is a value that the user sets?  After the script runs and the 
HTML output generated?

 $PHP_SELF?#FOO in the script, it all works well. But $value 
 is variable, so the content depends on the action taken somewhere 
 in the script. 

Somewhere in the script server side?  Or somewhere in the form 
client side?

 The generalidea is that an internal link gives $value it's own value 
 (like a name=para1, so $value would be para1). After posting 
 to SELF a jump to para1 must be made.

It depends on where value is coming from.  If it's coming from the 
script server side, then you just need to make sure that $value is
set before the line form action= gets printed.  If it's coming from
the client side, there may be other problems...

Chris



Re: [PHP] Jump to internal link after $PHP_SELF post

2001-11-15 Thread Rob van Jaarsveld

It depends on where value is coming from.  If it's coming from the
script server side, then you just need to make sure that $value is
set before the line form action= gets printed.  If it's coming from
the client side, there may be other problems...

$value is defined in the server-side script, but gets activated in the
client's form (after clicking a checkbox) :-(.

Rob.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Jump to internal link after $PHP_SELF post

2001-11-15 Thread Boget, Chris

 It depends on where value is coming from.  If it's coming from the
 script server side, then you just need to make sure that $value is
 set before the line form action= gets printed.  If it's coming from
 the client side, there may be other problems...
 $value is defined in the server-side script, but gets activated in the
 client's form (after clicking a checkbox) :-(.

Ok, then you are going to need to use Javascript to make this work.
Here is some *very rough* pseudo-code:

?

  echo form action=\\ method=\post\ name=\pageForm\\n;

  $anchorTag = FOO;
  echo input type=\checkbox\ 
 
OnClick=\document.pageForm.action.value=\$PHP_SELF#$anchorTag\\n;

  $anchorTag = BAR;
  echo input type=\checkbox\ 
 
OnClick=\document.pageForm.action.value=\$PHP_SELF#$anchorTag\\n;

?

or something along those lines.  You are going to have to set the value
of the form's action on the client side, not the server side.

For the checkbox, I don't know of OnClick is the right event.  You
will need to look up that form element in a javascript guide for the
event that you want.

HTH

Chris