Help me dig out of a mini-nightmare. Some parameters transfer, others do not.
am 28.07.2010 07:13:53 von Bill Mudry--=====================_5796747==.ALT On 28 July 2010 06:13, Bill Mudry
Content-Type: text/plain; charset="us-ascii"; format=flowed
Along with suggestions from this group, I was able to transfer
parameters across html pages so that
a user could pick a wood species and the new page would faithfully
report details on that wood.
Later (with help from the group again) I was so glad to see that
these pages were able to pick up
JPEG scans of how some woods look like, one more important step
forward for the project. When I then added a form for users to choose
what extra data they wanted to see and it would recycle to
the same page, the scan picture would disappear. A suggestion of
adding a hidden field in the form
even fixed that :-) . Things went swimmingly for a while.
I don't know just what I did wrong but somewhere between trying to
add some Javascript to create
new pop ups (they even work now, too) for user choices for showing
other photos, I messed up the page bad enough that it took a few days
to even get everything showing up again. Well .... almost everything.
It is able to pick up the choice of botanical name that a user
chooses from a very large list of woods and display the text data for
that one wood just fine again on another page. What I cannot seem to
get back again is to show the wood scans for those woods for which I
have scans (.... literally scanned on a scanner, btw, instead of a camera).
I have temporarily hard coded a full path and file name for a typical
wood that should have a picture
to show .... and the scan shows up just great, proving that part of
the logic is still intact, fine and working. The problem seems to be
for some reason that I no longer understand in getting the name and
partial path of the scan file to show up via the super-globals.
Both the botanical name ('species_name') and the scan picture name
('picture_filename1')
are stored in the table 'species'. The scans actually have a gallery
folder as part of what is stored
(eg. "gallery_a/ablies_alba, gallery_b/betula_nigra, and so on).
I have tried using (parse_str($_SERVER['QUERY_STRING'], $qs). I have
tried using $_GET that
has worked well before ..... but to no avail. I did try experimenting
quite a bit before finally and
with some regret deciding I am past what I know on why NOW
(remembering this used to work)
I just cannot get the content from column picture_file1 to come
across also. I keep saying it SHOULD
work.... but it doesn't.
With more and more functions being installed on this page, I will
still put the whole page code,
even though it will have sections that need no attention ... just to
be on the cautious side. This seems
so elementary and yet I cannot get it to work. (bear with so many
commented statements .... stabs
at getting this to work).
Three steps forward ..... one step back ......
Bill Mudry
============================================================ ============
parse_str($_SERVER['QUERY_STRING'], $qs);
$species_name=$qs['species_name'];
Echo "on line18 \$qs is - $qs
";
parse_str($_SERVER['QUERY_STRING'], $qs2);
$picture_filename1 = $qs2['picture_filename1'];
Echo "on line 21 \$picture_filename is - $picture_filename
";
//$picture_filename1=$qs['picture_filename1'];
//$picture_filename = $_GET['picture_filename'];
$species_commonname = $_GET['species_commonname'];
//echo "\$species_commonname value at line 24 is - $species_commonname
";
#
//////////////////////////////////////////////////////////// ////////////////////////
# CONNECT TO DATABASE
#
//////////////////////////////////////////////////////////// ////////////////////////
include ("connecttotaxa.php");
$connection = mysql_connect($hostname, $username, $password)
or die("Unable to connect to database server");
$db = mysql_select_db($dbname, $connection)
or die("Unable to connect to database");
/*
------------------------------------------------------------ --------------------
HOPEFULLY CONNECTED AT THIS POINT
------------------------------------------------------------ ----------------------
*/
$query6 = "SELECT * FROM species WHERE species_name='$species_name'";
//var_dump($query6);
$result6 = mysql_query($query6)
or die(mysql_error());
If ($result6)
{
$row6=mysql_fetch_array($result6, MYSQL_ASSOC);
Echo "\$row6 is - $row6
\n";
Echo MYSQL_ERROR();
};
/*
if ($row6){
$z=extract($row6); //Echo MYSQL_ERROR();
};
*/
?>
Echo "
$species_name .
//Echo "";
?>
bgcolor='antiquewhite' border='5' bordercolor='navy' width='800'>
>
//////////////////////////////////////////////////////////// //////////////////////////////////////////
// Start
of reporting general data.
//////////////////////////////////////////////////////////// //////////////////////////////////////////
Echo "
border='2' bordercolor='saddlebrown' width='800'>";
Echo ""; ";
Echo " ";General Data for
Species $species_name
Echo "
Echo ""; ";
Echo "Authority - $authorities_species ";
Echo "Varieties, cultivars, Hybrids, Subspecies - ";
\n $varieties
Echo "
Echo ""; ";
Echo "Common Names - $species_commonname ";
Echo "Synonyms - $syn_species ";
Echo "
Echo ""; ";
Echo "Gymnosperm or Angiosperm? $gymno_angio ";
Echo "Commercial wood? - $commercial_wood ";
Echo "
Echo ""; ";
Echo "Uses - $species_uses ";
Echo "Durability - $durability ";
Echo "
Echo ""; ";
Echo "Plant forms - $species_life_form ";
Echo "Typical sizes of plant - $species_lifeform_size ";
Echo "
Echo ""; ";
Echo "Seasoning - $seasoning ";
Echo "Stability - . $stability ";
Echo "
Echo ""; ";
Echo "General Description - ";
$species_description
Echo "
Echo ""; ";
Echo "Typical Defects - $defects ";
Echo "
Echo ""; ";
Echo "Toxicity - $toxicity ";
Echo "
Echo ""; ";
Echo "World Distribution - $location ";
Echo "
Echo ""; ";
Echo "Comments - $comments ";
Echo "
Echo "
\n"; //Close off data table;
Echo "
";
//////////////////////////////////////////////////////////// //////////////////////////////////////////
//
// Let users decide if they wish to view woodworking
and/or numeric test data.
//
//////////////////////////////////////////////////////////// //////////////////////////////////////////
//$show_woodworking = "off";
//$show_numeric = "off";
?>
Choose if you wish to also view Woodworking or
Numeric Data
////////////////////////////////////////////////////////
// END OF FORM, START OF PROCESSING USER INPUT
////////////////////////////////////////////////////////
//$display_working_data =""; // initialize responses to empty before
retrieving them
//$display_numeric_data ="";
//Echo "line 254 \$display_working_data is - $display_working_data ";
//Echo "
";
//Echo "line 256 \$display_numeric_data is - $display_numeric_data ";
//Echo "
";
//bring in user's answers from form:
$display_working_data = $_GET['show_woodworking'];
$display_numeric_data = $_GET['show_numeric'];
//check what user responses are:
//echo "Line 269 - \$display_working_data is - $display_working_data
";
//Echo "line 270 - \$display_numeric_data is - $display_numeric_data
";
if ($display_working_data) {
Echo "line 269 - \$display_working_data is - $display_working_data ";
Echo "
";
include "./woodworking_data.php";
}
else {
Echo "Working data chosen not to show
";
// echo "Line 274 - \$display_working_data is -
$display_working_data
";
};
// echo "working_data is - $display_working_data";
//Echo "line 282 - \$display_numeric_data is - $display_numeric_data ";
if ($display_numeric_data) {
//Echo "line 284 - \$display_numeric_data is - $display_numeric_data ";
Echo "
";
include "./numeric_data.php";
}
else {Echo "Numeric data chosen not to show
";
};
//echo "numeric_data is - $display_numeric_data";
echo "
";
//include "./wood_data.php";
?>
END OF WOOD DATA REPORT
--=====================_5796747==.ALT--
Re: Help me dig out of a mini-nightmare. Some parameters
am 28.07.2010 11:16:37 von Richard Quadling
> Along with suggestions from this group, I was able to transfer parameters
> across html pages so that
> a user could pick a wood species and the new page would faithfully report
> details on that wood.
> Later (with help from the group again) I was so glad to see that these pages
> were able to pick up
> JPEG scans of how some woods look like, one more important step forward for
> the project. When I then added a form for users to choose what extra data
> they wanted to see and it would recycle to
> the same page, the scan picture would disappear. A suggestion of adding a
> hidden field in the form
> even fixed that :-) . Things went swimmingly for a while.
>
> I don't know just what I did wrong but somewhere between trying to add some
> Javascript to create
> new pop ups (they even work now, too) for user choices for showing other
> photos, I messed up the page bad enough that it took a few days to even get
> everything showing up again. Well .... almost everything.
>
> It is able to pick up the choice of botanical name that a user chooses from
> a very large list of woods and display the text data for that one wood just
> fine again on another page. What I cannot seem to get back again is to show
> the wood scans for those woods for which I have scans (.... literally
> scanned on a scanner, btw, instead of a camera).
>
> I have temporarily hard coded a full path and file name for a typical wood
> that should have a picture
> to show .... and the scan shows up just great, proving that part of the
> logic is still intact, fine and working. The problem seems to be for some
> reason that I no longer understand in getting the name and partial path of
> the scan file to show up via the super-globals.
>
> Both the botanical name ('species_name') and the scan picture name
> ('picture_filename1')
> are stored in the table 'species'. The scans actually have a gallery folder
> as part of what is stored
> (eg. "gallery_a/ablies_alba, gallery_b/betula_nigra, and so on).
>
> I have tried using (parse_str($_SERVER['QUERY_STRING'], $qs). I have tried
> using $_GET that
> has worked well before ..... but to no avail. I did try experimenting quite
> a bit before finally and
> with some regret deciding I am past what I know on why NOW (remembering this
> used to work)
> I just cannot get the content from column picture_file1 to come across also.
> I keep saying it SHOULD
> work.... but it doesn't.
>
> With more and more functions being installed on this page, I will still put
> the whole page code,
> even though it will have sections that need no attention ... just to be on
> the cautious side. This seems
> so elementary and yet I cannot get it to work. (bear with so many commented
> statements .... stabs
> at getting this to work).
>
> Three steps forward ..... one step back ......
>
> Bill Mudry
>
Hello Bill,
My personal preference is to store the data in the $_SESSION. Once you
do that, each page really only has to provide your code with new data.
Once you are back at the server, any previously received data is in
the session. This will be available for all requests (css, images,
javascript, etc.) so you don't need to tack parameters onto the URL or
hidden
So, for a popup making requests for an image will have access to the
$_SESSION exactly the same way (assuming the request is to a PHP
script which has to find the image, etc.)
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php