Click to See Complete Forum and Search --> : query string/checkbox


tripwater
07-01-2003, 08:05 AM
I have an image for a button that when clicked passes over some info via query string. I just added a checkbox on this page for a condition I need.

I have been introduced to <a href= page.php?myinfo=currentlysendingthis&otherinfohere>
<img src=button></a>


I need to understand the syntax where &otherinfohere is. Would I put "&checkboxname" or
"&isChecked=false"?

I need to know if the checkbox was checked on my next page. My checkbox name is testcomp.

Also if you are familiar with php, would I need to explode the '&' as a delimiter from the $_get["myinfo"] ?

Thank you for any help.

pyro
07-01-2003, 08:09 AM
I wrote this to behave much like the PHP $_GET function:

http://www.infinitypages.com/research/querystring.htm

pyro
07-01-2003, 08:14 AM
Just reread your post and I guess I'm not really sure what you are looking for... Do you want to get the values of various querystring keys in PHP? If so, for a query string like this:

page.php?key1=test&key2=another_test&key3=yet_another_test

you can get the values individually like this:

$_GET["key1"] # will equal "test"
$_GET["key2"] # will equal "another_test"
$_GET["key3"] # will equal "yet_another_test"

tripwater
07-01-2003, 08:25 AM
Thank you for the reply.

You answered one question. Thanks. The last post you gave helped me with how to get the separate values from the query string.

Most importantly though is the proper way for me to pass over whether my check box has been checked or not via query string as I am not using the submit for the form action.

Do I put the checkbox name after the & ?

I am unclear as to how I would get the true or false values at this point.

Thanks again.

pyro
07-01-2003, 08:35 AM
Why can't you just submit the form? It'd be a lot easier...

If you can't, you will probably have to use an onclick handler in the checkbox which will then run a function to go to the specified URL with the query string attached.

tripwater
07-01-2003, 08:52 AM
Why can't you just submit the form? It'd be a lot easier...

I really am not using a form. I am using a image for the user to click on when a task is completed, when they click this image I pass over the taskid in order to know which task to mark as completed.

We now have a testing section so once the task marked completed it goes into testing. But some tasks can go straight to fully completed and bypass testing by checking the "testing complete" checkbox.

So I just wanted to be able to add whether or not this box was checked along with the taskid.