$_SERVER["PHP_SELF"] Question

$_SERVER["PHP_SELF"] Question

am 18.10.2007 13:55:03 von Kye

I am attempting to use the below Select Form Element to allow users to
change the category of data being viewed in a subsequent SQL statement. My
problem is, from where I am at, what is my next step to be able to do an "if
then else" loop based upon what is selected from this form element???

TIA
Kye.

$category = "SELECT * FROM `links_categories` ORDER BY category ASC LIMIT
0 , 30" or die('Error, query failed');
$catlist = mysql_query($category) or die('Error, query failed');
echo "

";
echo '';
echo "";
echo "
";
?>

Re: $_SERVER["PHP_SELF"] Question

am 18.10.2007 18:55:08 von Jerry Stuckle

Kye wrote:
> I am attempting to use the below Select Form Element to allow users to
> change the category of data being viewed in a subsequent SQL statement. My
> problem is, from where I am at, what is my next step to be able to do an "if
> then else" loop based upon what is selected from this form element???
>
> TIA
> Kye.
>
> > $category = "SELECT * FROM `links_categories` ORDER BY category ASC LIMIT
> 0 , 30" or die('Error, query failed');
> $catlist = mysql_query($category) or die('Error, query failed');
> echo "

";
> echo '';
> echo "";
> echo "
";
> ?>
>
>
>
>

Have a page which takes the value in $_POST['dropdown'] and performs
another SQL query of the desired results.

It may be this page (i.e. if $_POST['dropdown'] is set, or a different
page, depending on your needs.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: $_SERVER["PHP_SELF"] Question

am 20.10.2007 09:09:03 von Kye

> Have a page which takes the value in $_POST['dropdown'] and performs
> another SQL query of the desired results.
>
> It may be this page (i.e. if $_POST['dropdown'] is set, or a different
> page, depending on your needs.

Is it possible to make the select element of the form automatically execute
the ""; statement rather than having a
button to click on???

--
Yours Sincerely
Kye

Re: $_SERVER["PHP_SELF"] Question

am 20.10.2007 10:29:09 von Lars Eighner

In our last episode, , the
lovely and talented Kye broadcast on comp.lang.php:

>> Have a page which takes the value in $_POST['dropdown'] and performs
>> another SQL query of the desired results.
>>
>> It may be this page (i.e. if $_POST['dropdown'] is set, or a different
>> page, depending on your needs.

> Is it possible to make the select element of the form automatically execute
> the ""; statement rather than having a
> button to click on???

Again, this is an html question, having nothing to do with php. The answer
is "no, not in html." That is because html will not "do" anything. It is
markup. You can use javascript to make ENTER in some form field submit the
form, but this won't work in some browsers so if it "rather than having a
button" your site will alway be broken to people who don't have the "right"
browser, "properly" set. Google is an example of ENTER for submit AND
making a button available. Many commercial sites do use script to submit
when an option is selected --- for that they lose customers who are not
using the "right" browser and those who become frustrated by the
slipperiness of dropdwon boxes. In any case, it is all client side and php
has nothing to do with it.

--
Lars Eighner
Countdown: 458 days to go.
What do you do when you're debranded?

Re: $_SERVER["PHP_SELF"] Question

am 20.10.2007 12:38:55 von Courtney

Kye wrote:
>> Have a page which takes the value in $_POST['dropdown'] and performs
>> another SQL query of the desired results.
>>
>> It may be this page (i.e. if $_POST['dropdown'] is set, or a different
>> page, depending on your needs.
>
> Is it possible to make the select element of the form automatically execute
> the ""; statement rather than having a
> button to click on???
>
Yes, with javascript.

However there are caveats.


If you actually do CHANGE the value displayed, then this code

"; statement rather than having a
> button to click on???
>
Yes, with javascript.

However there are caveats.


If you actually do CHANGE the value displayed, then this code

"; statement rather than having a
> button to click on???
>

Not in PHP. PHP is server-side. You need something client-side. Try
comp.lang.javascript.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: $_SERVER["PHP_SELF"] Question

am 20.10.2007 15:23:48 von Jerry Stuckle

Kye wrote:
>> Have a page which takes the value in $_POST['dropdown'] and performs
>> another SQL query of the desired results.
>>
>> It may be this page (i.e. if $_POST['dropdown'] is set, or a different
>> page, depending on your needs.
>
> Is it possible to make the select element of the form automatically execute
> the ""; statement rather than having a
> button to click on???
>

Or maybe I misunderstood your question. Why would you want a select
statement to press a button?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: $_SERVER["PHP_SELF"] Question

am 20.10.2007 16:54:07 von Kye

No, You correctly interpreted my question. I just posted to the incorrect
group. Will have a look at the JS group.

--
Yours Sincerely
Kye

"Jerry Stuckle" wrote in message
news:f_udnSKMJNYwnIfanZ2dnUVZ_u7inZ2d@comcast.com...
> Kye wrote:
>>> Have a page which takes the value in $_POST['dropdown'] and performs
>>> another SQL query of the desired results.
>>>
>>> It may be this page (i.e. if $_POST['dropdown'] is set, or a different
>>> page, depending on your needs.
>>
>> Is it possible to make the select element of the form automatically
>> execute the ""; statement rather than
>> having a button to click on???
>>
>
> Or maybe I misunderstood your question. Why would you want a select
> statement to press a button?
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================
>

Re: $_SERVER["PHP_SELF"] Question

am 21.10.2007 15:31:04 von AnrDaemon

Greetings, Lars Eighner.
In reply to Your message dated Saturday, October 20, 2007, 12:29:09,

LE> Again, this is an html question, having nothing to do with php.

/agree, but...

LE> You can use javascript to make ENTER in some form field submit the form,

You can use "form.submit();" JS call even if there's no "type=submit" fields
in form.
(Just to clarify)


--
Sincerely Yours, AnrDaemon

Re: $_SERVER["PHP_SELF"] Question

am 21.10.2007 15:32:07 von AnrDaemon

Greetings, The Natural Philosopher.
In reply to Your message dated Saturday, October 20, 2007, 14:38:55,

TNP>
>
> *THIS* *IS* JavaScript. Actually.
>
>
That is what I said IIRC.

"Not in php, but its simple with javascript"..

and gave that example.

Re: Sorry, forgive my previous post please.

am 21.10.2007 15:44:50 von Courtney

AnrDaemon wrote:
> Greetings, The Natural Philosopher.
> In reply to Your message dated Saturday, October 20, 2007, 14:38:55,
>
> I wasn't pay enough attention reading Your answer.
>
>
Apology accepted. ;-)