Me too
I'll take a look and see what I can do, just keep in mind that I can't run any code (even JS) as of the time being since I have no webserver.
Me too
I'll take a look and see what I can do, just keep in mind that I can't run any code (even JS) as of the time being since I have no webserver.
Hey Logan,
Did you know javascript is clientside?
You do not need a webserver to run javascript, just a browser :p
Hi Lila,
Since you were using GET for the form, I left them that way.
Hope this solves it all.
Working on it now, p.1 fine, parse error on p.2 which I haven't found yet -
Parse error: parse error, unexpected '[', expecting ']' in /usr/local/psa/home/vhosts/froesamlerne.dk/httpdocs/php_lila/bibliotek_forsoeg_paa_form/page2[1].php on line 20
This line or the one like it gave problems in the first version too. That time I think it was single vs. double quotes. This time they all seem to be escaped? I've tried replacing some but so far no luck.
I also get this:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/local/psa/home/vhosts/froesamlerne.dk/httpdocs/php_lila/bibliotek_forsoeg_paa_form/page2[1].php on line 26
Hi lila,
yeah could be that this:
$select_name[$_GET[genusname]] = "selected";
works better like:
$select_name['$_GET['genusname']'] = "selected";
(For all the array declarations probably)
The fetcharray problem indicates that the query was invalid or did not produce any records. These I copied from your file. Echo the actual query, and see what is in them.
J.
On page 3 where you use $_GET[artsform], shouldn't it be [artsname]? Is that a problem on p2 also? The select name is = artsname, but submit = artsform.?
oops.
Yes. The test for isset refer to the select boxes.
I also noted that in page2 I left the "selected" in the dropboxes. Of course, you do not want that! ( <option selected value="">Vælg Art</option>"; )
J.
Seems like
$select_name['$_GET[genusname]'] = "selected";
works OK, without ping around genusname.
The $list line is still wrong,
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /usr/local/psa/home/vhosts/froesamlerne.dk/httpdocs/php_lila/bibliotek_forsoeg_paa_form/page2[1].php on line 23
but I'm not sure how to adapt what you wrote to $row statements, and the syntax is a little different to what I'm used to, so I'm having trouble debugging it.
Going out for a while, will look at it again later this afternoon. Thanks for working on it!
Yes, I do know JS is clientside. But since the form values are generated by PHP through a MySQL database, how would JS get the values to use in the first place?
I got the code; I'll have a look at it. Plus I'll see what leatherback did as well.
P.S. Leatherback, you changed your sig! When did that happen?
lila wrote:The $list line is still wrong,
Hi Lila,
Yep, found it:
$list .= "<option $select_name[$row[GenusID]] value=\"".$row["GenusID"]."\">".$row["GenusName"]."</option>
should be:
$list .= "<option $select_name[$row[GenusID]] value=\"".$row['GenusID']."\">".$row['GenusName']."</option>
I seem to use double / single quotes reversed from you, resulting in many typos.. Besides that I do not thin my coding style is that much different, is it?
Logan: Changed my sif today. I will add my PhD thesis link to it when I get the time to actrually put it only somewhere. (If you are keen to read it: http://www.itc.nl/library/Papers_2005/phd/ferwerda.pdf)
Afraid it still doesn't work (still getting the error message with "[ "expected" ]".
Other than singel/double quotes (and I did try changing them once!) and the fact that I'm not too good at going from php to html and back in echo statements, the only difference I suppose is that I've never seen/used a variable with double brackets and can't tell whether some part of it is wrong, or something quite different.
Your thesis looks very interesting. Wageningen, isn't the Dutch national gene bank there? Or is it something else I'm thinking of?
I will keep trying...
Hi Lila,
How about this: Send me a databasedump of your database for mysql (Preferably with only a few records, or even none, and I will get the pages working for you. It realy should be no problem, if I have all the components to test.
Well, Wageningen is the main university for life sciences, and the environmental sciences group is the #3 most important research group on environmental science in the world, based on publications. I am not sure about the genebank. Could well. It does hold a big part of the national herbarium. But in general, it is an important univ.in environmental sciences. The other institute (ITC) is an institute for spatial sciences and remote sensing.
What is your background? Are you a taxonomist? Or are you just doing a project for some biologists?
J.
Actually it seems to work or at least the error messages go away if you use curly brackets (in Danish called "Tuborgs" from an old Tuborg beer ad) instead of the double square brackets at $row. (I copied it from a page in an Atkinson & Suraski book).
However, the value chosen is wildly inaccurate: I chose Brassica, and it prints the correct genus ID (44) but the name shown is Vicia and the species is the one related to Vicia (faba). Now I'm really astonished!
I think this is what you asked for. I took out almost all the data except the GENUS table.
Hi Lila,
Check you email: The code should work now. (It did on my PC) just not clear what you want to submit to in page3.php
J.
Hi everybody,
Everything works perfectly now! I can't thank you enough. Fantastic help! I'll mark it resolved, and if anyone wants to see the finished code (still 3 pages, to be condensed) they can ask.
To answer leatherback's question: I'm not a taxonomist but an amateur seed saver with the Danish organisation "Frøsamlerne" which is an NGO in the area of plant genetic resources, i.e. a grass-roots gene bank, like the Seed Savers Exchange (USA) or Heritage Seed Library (G. I'm creating (well. trying to) our database for our seed collection.