RE: Can"t seem to transfer a dynamically chosen parameter to next page

RE: Can"t seem to transfer a dynamically chosen parameter to next page

am 17.03.2009 16:54:07 von Zleviticus

Why can you not pass the parameter in the url link of the new page using the
get variable?

Example


Name:
Age:



When the user clicks the "Submit" button, the URL sent could look something
like this:

http://www.w3schools.com/welcome.php?name=Peter&age=37

The "welcome.php" file can now use the $_GET variable to catch the form data
(notice that the names of the form fields will automatically be the ID keys
in the $_GET array):

Welcome .

You are years old!




-----Original Message-----
From: Bill Mudry [mailto:billmudry@rogers.com]
Sent: Tuesday, March 17, 2009 12:39 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Can't seem to transfer a dynamically chosen parameter to
next page

I hope someone has an answer to what has been a thorny problem for me. I am
still junior to using PHP.
I have a script that displays a bunch of woody botanical orders out of a
MySQL file nicely in columns.
That part works fine.

Next what is wanted is for a user to be able to click on one of them, the
result being that it would open up a new page that would get details on the
woody order the person chose out of another MySQL table.
Well .... I got it to link to a page that opens up ok ---- except after
numerous attempts and ways I cannot get the name of the chosen woody order
to transfer to this next page.

- the examples I have seen on the Internet and book use static
information for the better part while the
very parameter that needs to be passed is derived dynamically. I
am fairly sure that is complicating
things more.

- Cookies would be an overkill and have too much persistence. I
believe using "session" would be overkill,
too, even if it might work. All I need is to make the choice the
reader makes go global enough to use it
in the very page that it calls. It is then also used both for
titles on that page (dynamic) and to do a
query for information to display on that chosen order. Writing to
a file seems to be an inefficient way if
there is only a way to just make it be memory resident instead.

The running copy can be seen and tried (to the degree it is working so far)
at:
http://www.prowebcanada.com/taxa/viewallorders.php

The files used are viewallorders.php and the response page of showorder.php.
I will add these as attachments.

What *will* work? Hope someone can help.

Bill Mudry
MIssissauga, ON


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

Re: Can"t seem to transfer a dynamically chosenparameter to next page

am 17.03.2009 16:58:49 von James Crow

I haven't looked at your code, but it sounds like you need JavaScript.
On the page you are going to you will need to pass something. You can
pass values either through forms or through the URL. URL may be easiest.

If you have a link like http://somehost.com/page_two.php?variable=value
you can get the variable=value part from the $_GET array. Like this
$_GET['variable'] will equal 'value'. On your first page you can then
use JS to set the url for a link to include the value you want to pass.

I don't know how involved the page is, but you can use PHP to generate
the page and create the links with the variable=value part already on
them. i.e.






Cheer,
James


On Tue, 2009-03-17 at 11:39 -0500, Bill Mudry wrote:
> I hope someone has an answer to what has been a thorny problem for
> me. I am still junior to using PHP.
> I have a script that displays a bunch of woody botanical orders out
> of a MySQL file nicely in columns.
> That part works fine.
>
> Next what is wanted is for a user to be able to click on one of them,
> the result being that it would open up
> a new page that would get details on the woody order the person chose
> out of another MySQL table.
> Well .... I got it to link to a page that opens up ok ---- except
> after numerous attempts and ways I cannot
> get the name of the chosen woody order to transfer to this next page.
>
> - the examples I have seen on the Internet and book use static
> information for the better part while the
> very parameter that needs to be passed is derived dynamically. I
> am fairly sure that is complicating
> things more.
>
> - Cookies would be an overkill and have too much persistence. I
> believe using "session" would be overkill,
> too, even if it might work. All I need is to make the choice the
> reader makes go global enough to use it
> in the very page that it calls. It is then also used both for
> titles on that page (dynamic) and to do a
> query for information to display on that chosen order. Writing to
> a file seems to be an inefficient way if
> there is only a way to just make it be memory resident instead.
>
> The running copy can be seen and tried (to the degree it is working so far) at:
> http://www.prowebcanada.com/taxa/viewallorders.php
>
> The files used are viewallorders.php and the response page of
> showorder.php. I will add these as attachments.
>
> What *will* work? Hope someone can help.
>
> Bill Mudry
> MIssissauga, ON
> -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--
James Crow
IT Manager
ULTRATAN, Inc.



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

RE: Can"t seem to transfer a dynamically chosen parameter to next page

am 17.03.2009 17:02:19 von Zleviticus

Why would you need JS to set the url for the link. Why could it not all be
done via php?

Z

-----Original Message-----
From: James Crow [mailto:james@ultratans.com]
Sent: Tuesday, March 17, 2009 11:59 AM
To: Bill Mudry
Cc: php-windows@lists.php.net
Subject: Re: [PHP-WIN] Can't seem to transfer a dynamically chosen parameter
to next page

I haven't looked at your code, but it sounds like you need JavaScript.
On the page you are going to you will need to pass something. You can
pass values either through forms or through the URL. URL may be easiest.

If you have a link like http://somehost.com/page_two.php?variable=value
you can get the variable=value part from the $_GET array. Like this
$_GET['variable'] will equal 'value'. On your first page you can then
use JS to set the url for a link to include the value you want to pass.

I don't know how involved the page is, but you can use PHP to generate
the page and create the links with the variable=value part already on
them. i.e.






Cheer,
James


On Tue, 2009-03-17 at 11:39 -0500, Bill Mudry wrote:
> I hope someone has an answer to what has been a thorny problem for
> me. I am still junior to using PHP.
> I have a script that displays a bunch of woody botanical orders out
> of a MySQL file nicely in columns.
> That part works fine.
>
> Next what is wanted is for a user to be able to click on one of them,
> the result being that it would open up
> a new page that would get details on the woody order the person chose
> out of another MySQL table.
> Well .... I got it to link to a page that opens up ok ---- except
> after numerous attempts and ways I cannot
> get the name of the chosen woody order to transfer to this next page.
>
> - the examples I have seen on the Internet and book use static
> information for the better part while the
> very parameter that needs to be passed is derived dynamically. I
> am fairly sure that is complicating
> things more.
>
> - Cookies would be an overkill and have too much persistence. I
> believe using "session" would be overkill,
> too, even if it might work. All I need is to make the choice the
> reader makes go global enough to use it
> in the very page that it calls. It is then also used both for
> titles on that page (dynamic) and to do a
> query for information to display on that chosen order. Writing to
> a file seems to be an inefficient way if
> there is only a way to just make it be memory resident instead.
>
> The running copy can be seen and tried (to the degree it is working so
far) at:
> http://www.prowebcanada.com/taxa/viewallorders.php
>
> The files used are viewallorders.php and the response page of
> showorder.php. I will add these as attachments.
>
> What *will* work? Hope someone can help.
>
> Bill Mudry
> MIssissauga, ON
> -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--
James Crow
IT Manager
ULTRATAN, Inc.



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


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

Re: Can"t seem to transfer a dynamically chosen parameter

am 17.03.2009 17:03:49 von Lex Braun

--0015175cdf8070b1d1046552b6a3
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Bill,

2009/3/17 Bill Mudry

> I hope someone has an answer to what has been a thorny problem for me. I am
> still junior to using PHP.
> I have a script that displays a bunch of woody botanical orders out of a
> MySQL file nicely in columns.
> That part works fine.
>
> Next what is wanted is for a user to be able to click on one of them, the
> result being that it would open up
> a new page that would get details on the woody order the person chose out
> of another MySQL table.
> Well .... I got it to link to a page that opens up ok ---- except after
> numerous attempts and ways I cannot
> get the name of the chosen woody order to transfer to this next page.
>
> - the examples I have seen on the Internet and book use static
> information for the better part while the
> very parameter that needs to be passed is derived dynamically. I
> am fairly sure that is complicating
> things more.
>
> - Cookies would be an overkill and have too much persistence. I
> believe using "session" would be overkill,
> too, even if it might work. All I need is to make the choice the
> reader makes go global enough to use it
> in the very page that it calls. It is then also used both for
> titles on that page (dynamic) and to do a
> query for information to display on that chosen order. Writing to
> a file seems to be an inefficient way if
> there is only a way to just make it be memory resident instead.
>
> The running copy can be seen and tried (to the degree it is working so far)
> at:
> http://www.prowebcanada.com/taxa/viewallorders.php
>
> The files used are viewallorders.php and the response page of
> showorder.php. I will add these as attachments.
>
> What *will* work? Hope someone can help.
>

In showorder.php you have:

Echo "Information on ordername . $ordername"; //actual order<br /> name still not<br /> // transfering properly yet. Different attempts made.<br /> Echo "";

echo "Debug statement: Chosen order is . $ordername . $name"; // debig
statement only. Remove later.

$ordername has to be initialized to your query string variable. Thus,
$ordername = $_GET['name']. But this also requires a small change in
viewallorders.php so that a query string parameter of name is set:

echo "";

The above line should be changed to:
echo "
";

-Lex

--0015175cdf8070b1d1046552b6a3--

RE: Can"t seem to transfer a dynamically chosenparameter to next page

am 17.03.2009 17:11:45 von James Crow

If you create a dynamic page with elements changing based on AJAX DB
queries and such you must be able to change the page from within the
local browser. That requires JS. I think that may be a little advanced
for what the OP was trying to accomplish, but I only mentioned it
because it can make for a more interactive page.

The example with value{2,3,4} shows how to do static links and can be
done only with PHP.

Cheers,
James


On Tue, 2009-03-17 at 12:02 -0400, Zephaniah ha Levi wrote:
> Why would you need JS to set the url for the link. Why could it not all be
> done via php?
>
> Z
>
> -----Original Message-----
> From: James Crow [mailto:james@ultratans.com]
> Sent: Tuesday, March 17, 2009 11:59 AM
> To: Bill Mudry
> Cc: php-windows@lists.php.net
> Subject: Re: [PHP-WIN] Can't seem to transfer a dynamically chosen parameter
> to next page
>
> I haven't looked at your code, but it sounds like you need JavaScript.
> On the page you are going to you will need to pass something. You can
> pass values either through forms or through the URL. URL may be easiest.
>
> If you have a link like http://somehost.com/page_two.php?variable=value
> you can get the variable=value part from the $_GET array. Like this
> $_GET['variable'] will equal 'value'. On your first page you can then
> use JS to set the url for a link to include the value you want to pass.
>
> I don't know how involved the page is, but you can use PHP to generate
> the page and create the links with the variable=value part already on
> them. i.e.
>
>
>
>
>
>
> Cheer,
> James
>
>
> On Tue, 2009-03-17 at 11:39 -0500, Bill Mudry wrote:
> > I hope someone has an answer to what has been a thorny problem for
> > me. I am still junior to using PHP.
> > I have a script that displays a bunch of woody botanical orders out
> > of a MySQL file nicely in columns.
> > That part works fine.
> >
> > Next what is wanted is for a user to be able to click on one of them,
> > the result being that it would open up
> > a new page that would get details on the woody order the person chose
> > out of another MySQL table.
> > Well .... I got it to link to a page that opens up ok ---- except
> > after numerous attempts and ways I cannot
> > get the name of the chosen woody order to transfer to this next page.
> >
> > - the examples I have seen on the Internet and book use static
> > information for the better part while the
> > very parameter that needs to be passed is derived dynamically. I
> > am fairly sure that is complicating
> > things more.
> >
> > - Cookies would be an overkill and have too much persistence. I
> > believe using "session" would be overkill,
> > too, even if it might work. All I need is to make the choice the
> > reader makes go global enough to use it
> > in the very page that it calls. It is then also used both for
> > titles on that page (dynamic) and to do a
> > query for information to display on that chosen order. Writing to
> > a file seems to be an inefficient way if
> > there is only a way to just make it be memory resident instead.
> >
> > The running copy can be seen and tried (to the degree it is working so
> far) at:
> > http://www.prowebcanada.com/taxa/viewallorders.php
> >
> > The files used are viewallorders.php and the response page of
> > showorder.php. I will add these as attachments.
> >
> > What *will* work? Hope someone can help.
> >
> > Bill Mudry
> > MIssissauga, ON
> > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
> --
> James Crow
> IT Manager
> ULTRATAN, Inc.
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
James Crow
IT Manager
ULTRATAN, Inc.



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

RE: Can"t seem to transfer a dynamically chosenparameter to next page

am 17.03.2009 17:20:08 von Joao Gomes Madeira

Hello

Why would you want to do that with a query string? All form data is
passed on the variables $_POST or $_GET and that is supposed to function
like that.

A query string has a totally different purpose under html...

Cheers
JP


-----Original Message-----
From: Zephaniah ha Levi
To: 'Bill Mudry' ,
Subject: RE: [PHP-WIN] Can't seem to transfer a dynamically chosen
parameter to next page
Date: Tue, 17 Mar 2009 11:54:07 -0400

Why can you not pass the parameter in the url link of the new page using the
get variable?

Example


Name:
Age:



When the user clicks the "Submit" button, the URL sent could look something
like this:

http://www.w3schools.com/welcome.php?name=Peter&age=37

The "welcome.php" file can now use the $_GET variable to catch the form data
(notice that the names of the form fields will automatically be the ID keys
in the $_GET array):

Welcome .

You are years old!




-----Original Message-----
From: Bill Mudry [mailto:billmudry@rogers.com]
Sent: Tuesday, March 17, 2009 12:39 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Can't seem to transfer a dynamically chosen parameter to
next page

I hope someone has an answer to what has been a thorny problem for me. I am
still junior to using PHP.
I have a script that displays a bunch of woody botanical orders out of a
MySQL file nicely in columns.
That part works fine.

Next what is wanted is for a user to be able to click on one of them, the
result being that it would open up a new page that would get details on the
woody order the person chose out of another MySQL table.
Well .... I got it to link to a page that opens up ok ---- except after
numerous attempts and ways I cannot get the name of the chosen woody order
to transfer to this next page.

- the examples I have seen on the Internet and book use static
information for the better part while the
very parameter that needs to be passed is derived dynamically. I
am fairly sure that is complicating
things more.

- Cookies would be an overkill and have too much persistence. I
believe using "session" would be overkill,
too, even if it might work. All I need is to make the choice the
reader makes go global enough to use it
in the very page that it calls. It is then also used both for
titles on that page (dynamic) and to do a
query for information to display on that chosen order. Writing to
a file seems to be an inefficient way if
there is only a way to just make it be memory resident instead.

The running copy can be seen and tried (to the degree it is working so far)
at:
http://www.prowebcanada.com/taxa/viewallorders.php

The files used are viewallorders.php and the response page of showorder.php.
I will add these as attachments.

What *will* work? Hope someone can help.

Bill Mudry
MIssissauga, ON




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

Can"t seem to transfer a dynamically chosen parameter to next page

am 17.03.2009 17:39:08 von Bill Mudry

--=====================_13244124==_
Content-Type: text/plain; charset="us-ascii"; format=flowed

I hope someone has an answer to what has been a thorny problem for
me. I am still junior to using PHP.
I have a script that displays a bunch of woody botanical orders out
of a MySQL file nicely in columns.
That part works fine.

Next what is wanted is for a user to be able to click on one of them,
the result being that it would open up
a new page that would get details on the woody order the person chose
out of another MySQL table.
Well .... I got it to link to a page that opens up ok ---- except
after numerous attempts and ways I cannot
get the name of the chosen woody order to transfer to this next page.

- the examples I have seen on the Internet and book use static
information for the better part while the
very parameter that needs to be passed is derived dynamically. I
am fairly sure that is complicating
things more.

- Cookies would be an overkill and have too much persistence. I
believe using "session" would be overkill,
too, even if it might work. All I need is to make the choice the
reader makes go global enough to use it
in the very page that it calls. It is then also used both for
titles on that page (dynamic) and to do a
query for information to display on that chosen order. Writing to
a file seems to be an inefficient way if
there is only a way to just make it be memory resident instead.

The running copy can be seen and tried (to the degree it is working so far) at:
http://www.prowebcanada.com/taxa/viewallorders.php

The files used are viewallorders.php and the response page of
showorder.php. I will add these as attachments.

What *will* work? Hope someone can help.

Bill Mudry
MIssissauga, ON
--=====================_13244124==_
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: attachment; filename="showorder.php"

include ("connecttotaxa.php");
Echo "";
Echo "";
Echo "Information on ordername . $ordername"; //actual order name still not <br /> // transfering properly yet. Different attempts made.<br /> Echo "";


echo "";
echo "Debug statement: Chosen order is . $ordername . $name"; // debig statement only. Remove later.
echo "

Woody Order $ordername

";
// Can't seem to get the order name to transfer properly yet. Erase these lines once it is
// working fine.
//////////////////////////////////////////////////////////// /////////////////////////////
// Once the reporting function above for each woody order is working properly,
// a query has to be run to display all woody families of that order and, as with the
// woody order list, set as links to be chosen to go further down the botanicaal tree.
//
//
//////////////////////////////////////////////////////////// /////////////////////////////

echo "

This area will expand to show details on this order

(after the order chosen parameter transfers properly)

";

Echo "

";


echo "
";
echo "

Woody Families of this Order

";
echo "

(As above, the order name has to transfer properly first

before a query can bring forth all woody families that belong to the chosen order)

";

echo "";
echo "";
?>
--=====================_13244124==_
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: attachment; filename="viewallorders.php"



Link List of All Woody Orders






mysql_connect($hostname, $username, $password) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db(taxa);

$query = "SELECT * FROM sci_order";
$result = mysql_query($query);
//Echo "Got as far as \$result line
"; // debug statment only.
$j=0;
$k=0;
echo "

All Woody Orders

";
echo "

Each link leads to more information on the chosen botanical order

";
//Global $name, $ordername; // One of many vain efforts to make the order name chosen
// go global so it can be retrieved on the following page.

// Set up a table for displaying all the woody orders
echo "
";
//$name ="";

if($result) {
while($row = mysql_fetch_array($result)){
extract ($row);
$j++; // counter to set maximum columns lengths
$k++; // counter to increment for the next order
echo $j." - ";
//Global $name, $ordername; // stabbing in the dark to make the name stay in memory.
$ordername = $name; // stabbing in the dark to make the name stay in memory.

// Here is where each order is listed and as a link to the next page.

echo "";
echo $name;
echo"
.
\n";

if ($k>23)
{
echo "
";
$k=0;
};
}

}
else echo "No result value";
$name ="";
echo "



";
// End of display table.
Echo "

";

// essentially another debug statement of some use to users.
If ($name !="") {
Echo "
Echo "

You chose order named $name

\n";
Echo "
";
}
else {
echo "the order name is null";
}

?>



--=====================_13244124==_
Content-Type: text/plain; charset="us-ascii"; format=flowed



--=====================_13244124==_
Content-Type: text/plain; charset=us-ascii

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--=====================_13244124==_--

Re: Can"t seem to transfer a dynamically chosen parameter

am 17.03.2009 18:08:12 von Stut

2009/3/17 Bill Mudry
>
> I hope someone has an answer to what has been a thorny problem for me. I =
am still junior to using PHP.
> I have a script that displays a bunch of woody botanical orders out of a =
MySQL file nicely in columns.
> That part works fine.
>
> Next what is wanted is for a user to be able to click on one of them, the=
result being that it would open up
> a new page that would get details on the woody order the person chose out=
of another MySQL table.
> Well .... I got it to link to a page that opens up ok ---- except after n=
umerous attempts and ways I cannot
> get the name of the chosen woody order to transfer to this next page.
>
>        - the examples I have seen on the Internet and=
book use static information for the better part while the
>          very parameter that needs to be passed =
is derived dynamically. I am fairly sure that is complicating
>          things more.
>
>        - Cookies would be an overkill and have too mu=
ch persistence. I believe using "session" would be overkill,
>          too, even if it might work. All I need =
is to make the choice the reader makes go global enough to use it
>          in the very page that it calls. It is t=
hen also used both for titles on that page (dynamic) and to do a
>          query for information to display on tha=
t chosen order. Writing to a file seems to be an inefficient way if
>          there is only a way to just make it be =
memory resident instead.
>
> The running copy can be seen and tried (to the degree it is working so fa=
r) at:
>        http://www.prowebcanada.com/taxa/viewallorders=
..php
>
> The files used are viewallorders.php and the response page of showorder.p=
hp. I will add these as attachments.
>
> What *will* work? Hope someone can help.

What *will* work is understanding how HTTP works and where variables
come from within a script. For this you need to read up on it - I'm
sure Google can find you a basic introduction to web development.

As for your current problem please ignore all talk of JS and forms,
neither of which are needed. In viewallorders.php where you have...

echo "
";

....change it to...

echo "
";

Then in showorder.php that value will be available in
$_GET['ordername'], so for example your debugging statement would
change from...

echo "Debug statement: Chosen order is . $ordername . $name";

....to...

echo "Debug statement: Chosen order is ".htmlentities($_GET['ordername'=
]);

Notice how I'm encoding the value going into the URL and escaping it
when it gets echo'd back to the browser. This is important for
security reasons. For more on that please read
http://phpsec.org/projects/guide/.

-Stuart

--=20
http://stut.net/

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

Re: Can"t seem to transfer a dynamically chosenparameter to next page

am 17.03.2009 19:20:59 von Joao Gomes Madeira

Hello Bill

I mixed up names and ended up answering the wrong message. Sorry.

Actually it is quite easy...

In viewallorders.php you should replace:

echo "
";

with

echo '
';

and then, in showorder.php

parse_str($_SERVER['QUERY_STRING'], $qs);
$name = $qs['name'];

and that's it!

Now, the strings passed through this method are insecure. You should use
a parser function to clean or sanitize them (like urlencode/urldecode).

Cheers
JP





-----Original Message-----
From: Bill Mudry
To: php-windows@lists.php.net
Subject: [PHP-WIN] Can't seem to transfer a dynamically chosen parameter
to next page
Date: Tue, 17 Mar 2009 11:39:08 -0500

I hope someone has an answer to what has been a thorny problem for
me. I am still junior to using PHP.
I have a script that displays a bunch of woody botanical orders out
of a MySQL file nicely in columns.
That part works fine.

Next what is wanted is for a user to be able to click on one of them,
the result being that it would open up
a new page that would get details on the woody order the person chose
out of another MySQL table.
Well .... I got it to link to a page that opens up ok ---- except
after numerous attempts and ways I cannot
get the name of the chosen woody order to transfer to this next page.

- the examples I have seen on the Internet and book use static
information for the better part while the
very parameter that needs to be passed is derived dynamically. I
am fairly sure that is complicating
things more.

- Cookies would be an overkill and have too much persistence. I
believe using "session" would be overkill,
too, even if it might work. All I need is to make the choice the
reader makes go global enough to use it
in the very page that it calls. It is then also used both for
titles on that page (dynamic) and to do a
query for information to display on that chosen order. Writing to
a file seems to be an inefficient way if
there is only a way to just make it be memory resident instead.

The running copy can be seen and tried (to the degree it is working so far) at:
http://www.prowebcanada.com/taxa/viewallorders.php

The files used are viewallorders.php and the response page of
showorder.php. I will add these as attachments.

What *will* work? Hope someone can help.

Bill Mudry
MIssissauga, ON
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


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

Re: Can"t seem to transfer a dynamically chosen parameter

am 17.03.2009 21:03:57 von Stut

2009/3/17 Joao Gomes Madeira :
> Hello Bill
>
> I mixed up names and ended up answering the wrong message. Sorry.
>
> Actually it is quite easy...
>
> In viewallorders.php you should replace:
>
> echo "
";
>
> with
>
> echo '
';
>
> and then, in showorder.php
>
> > parse_str($_SERVER['QUERY_STRING'], $qs);
> $name =3D $qs['name'];
>
> and that's it!

What have you been smoking? This is already done for you, and the
results are in $_GET. Why duplicate the work?

-Stuart

--=20
http://stut.net/

> Now, the strings passed through this method are insecure. You should use
> a parser function to clean or sanitize them (like urlencode/urldecode).
>
> Cheers
> JP
>
>
>
>
>
> -----Original Message-----
> From: Bill Mudry
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Can't seem to transfer a dynamically chosen parameter
> to next page
> Date: Tue, 17 Mar 2009 11:39:08 -0500
>
> I hope someone has an answer to what has been a thorny problem for
> me. I am still junior to using PHP.
> I have a script that displays a bunch of woody botanical orders out
> of a MySQL file nicely in columns.
> That part works fine.
>
> Next what is wanted is for a user to be able to click on one of them,
> the result being that it would open up
> a new page that would get details on the woody order the person chose
> out of another MySQL table.
> Well .... I got it to link to a page that opens up ok ---- except
> after numerous attempts and ways I cannot
> get the name of the chosen woody order to transfer to this next page.
>
>        - the examples I have seen on the Internet and=
book use static
> information for the better part while the
>          very parameter that needs to be passed =
is derived dynamically. I
> am fairly sure that is complicating
>          things more.
>
>        - Cookies would be an overkill and have too mu=
ch persistence. I
> believe using "session" would be overkill,
>          too, even if it might work. All I need =
is to make the choice the
> reader makes go global enough to use it
>          in the very page that it calls. It is t=
hen also used both for
> titles on that page (dynamic) and to do a
>          query for information to display on tha=
t chosen order. Writing to
> a file seems to be an inefficient way if
>          there is only a way to just make it be =
memory resident instead.
>
> The running copy can be seen and tried (to the degree it is working so fa=
r) at:
>        http://www.prowebcanada.com/taxa/viewallorders=
..php
>
> The files used are viewallorders.php and the response page of
> showorder.php. I will add these as attachments.
>
> What *will* work? Hope someone can help.
>
> Bill Mudry
> MIssissauga, ON
> -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: =
http://www.php.net/unsub.php
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Re: [PHP-WIN] Can"t seem to transfer a dynamically chosen parameter

am 18.03.2009 18:10:59 von Stut

Please keep the discussion on-list.

2009/3/18 Bill Mudry :
> At 04:44 AM 3/18/2009, you wrote:
>
> 2009/3/18 Joao Gomes Madeira :
>> Hey Stuart
>>
>> That's what I thought at first, but Bill mentioned the usage of a form
>> only as an example, in reality he is not using it. He just wanted
>> this... Right Bill?
>
> It doesn't matter if the URL is coming from a form with method="get"
> or a plain link, $_GET will still be populated - there is absolutely
> no difference in the resulting request.
>
> -Stuart
>
> It would be good practice for me to try your simplified way when I can get
> some time again.
> For now, it is great to find any solution that works.

It's not a "simplified way", it's just the way PHP works. I really
don't see where the confusion lies. Maybe an example would help...

http://dev.stut.net/php/mudry.php

-Stuart

--
http://stut.net/

>> -----Original Message-----
>> From: Stuart
>> To: Joao Gomes Madeira
>> Cc: Bill Mudry , php-windows@lists.php.net
>> Subject: Re: [PHP-WIN] Can't seem to transfer a dynamically chosen
>> parameter to next page
>> Date: Tue, 17 Mar 2009 20:03:57 +0000
>>
>> 2009/3/17 Joao Gomes Madeira :
>>> Hello Bill
>>>
>>> I mixed up names and ended up answering the wrong message. Sorry.
>>>
>>> Actually it is quite easy...
>>>
>>> In viewallorders.php you should replace:
>>>
>>> echo "
";
>>>
>>> with
>>>
>>> echo '
';
>>>
>>> and then, in showorder.php
>>>
>>> >>> parse_str($_SERVER['QUERY_STRING'], $qs);
>>> $name = $qs['name'];
>>>
>>> and that's it!
>>
>> What have you been smoking? This is already done for you, and the
>> results are in $_GET. Why duplicate the work?
>>
>> -Stuart
>>
>>
>>

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