Jump to content

simon157

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

simon157's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Eve, How you describe is exactly what I'm trying to do. I thought it would be fairly simple but it's been a real problem. Do you have any idea of a java script I could use? Thanks Simon [!--quoteo(post=375756:date=May 21 2006, 08:13 AM:name=eves)--][div class=\'quotetop\']QUOTE(eves @ May 21 2006, 08:13 AM) [snapback]375756[/snapback][/div][div class=\'quotemain\'][!--quotec--] Are you trying to dynamically change the path of the form when the user checks the checkbox? say, If the checkbox is checked, form will submit to page A, else submit to page B? If yes, use JavaScript (client-side) if not, is the page submitted from another file? try these: [code]if (isset($_POST['checkbox']) && intval($_POST['checkbox'])==1)[/code] [/quote]
  2. I tried that Andy but still does the same. I'm really not sure why ! I have attached the complete bit of code which might help solve the problem. It's a mess but I'll tidy it up after the problem is solved so my applogies for that. <? if ($_POST['checkbox'] ==1) { $action = "databaseintroresultsthumb.php"; } else { $action = "databaseintroresults.php"; } ?> <form action = "<?php echo $action; ?>" method="get" name="indexform" id="indexform"> <table width="90%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFCC"> <tr bgcolor="#485B3C"> <td colspan="22"><div align="center"><span class="style10">Search species index alphabetically - select a letter below , and press 'Go' to search databases and list results from all species databases. </span></div></td> <td><div align="center"><span class="style10"> <input type="submit" name="Submit4" value="Go"> </span></div></td> </tr> <tr bgcolor="#485B3C"> <td><div align="center">A</div></td> <td><div align="center">B</div></td> <td><div align="center">C</div></td> <td><div align="center">D</div></td> <td><div align="center">E</div></td> <td><div align="center">F</div></td> <td><div align="center">G</div></td> <td><div align="center">H</div></td> <td><div align="center">I</div></td> <td><div align="center">J</div></td> <td><div align="center">K</div></td> <td><div align="center">L</div></td> <td><div align="center">M</div></td> <td><div align="center">N</div></td> <td><div align="center">O</div></td> <td><div align="center">P</div></td> <td><div align="center">R</div></td> <td><div align="center">S</div></td> <td><div align="center">T</div></td> <td><div align="center">U</div></td> <td><div align="center">V</div></td> <td><div align="center">W</div></td> <td><div align="center">Y</div></td> </tr> <tr bgcolor="#485B3C"> <td><div align="center"> <input name="speciesindex" type="radio" value="A"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="B"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="C"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="D"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="E"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="F"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="G"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="H"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="I"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="J"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="K"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="L"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="M"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="N"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="O"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="P"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="R"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="S"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="T"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="U"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="V"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="W"> </div></td> <td><div align="center"> <input name="speciesindex" type="radio" value="Y"> </div></td> </tr> </table> <input name="checkbox" type="checkbox" id="checkbox" value="1"> </form> Thanks Simon [!--quoteo(post=375752:date=May 21 2006, 07:22 AM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 21 2006, 07:22 AM) [snapback]375752[/snapback][/div][div class=\'quotemain\'][!--quotec--] try $_POST instead of $_post [/quote]
  3. Thanks so much for that. It's very nearly working. There are no errors but it just loads databaseresult.php even if the checkbox is checked. Any ideas? I have attached my code for the checkbox. Please see below.. <input name="checkbox" type="checkbox" id="checkbox" value="1"> I set the checked value to "1". Is this correct? If you could help with this final problem then that would be great. Thanks again Simon [!--quoteo(post=375728:date=May 21 2006, 05:50 AM:name=alpine)--][div class=\'quotetop\']QUOTE(alpine @ May 21 2006, 05:50 AM) [snapback]375728[/snapback][/div][div class=\'quotemain\'][!--quotec--] You need to echo the results, i've set it up like this for you as its more readable in my oppinion [code] <? if ($_post['checkbox'] == 1) { $action = "databaseresultsthumb.php"; } else { $action = "databaseresults.php"; } ?> <form action = "<?php echo $action; ?>" method="get" name="indexform" id="indexform"> [/code] or yours would look like this [code] <form action = "<?php $field1 = $_post['checkbox']; if ( $field1 == 1 ) { echo "databaseresultsthumb.php"; } else { echo "databaseresults.php"; } ?>" method="get" name="indexform" id="indexform"> [/code] [/quote]
  4. Some help would be great is possible I have tried the following code to determine whether a checkbox has been checked or not whith the result of a different page loading of form submission. Here is a snippet from the code. <form action = "<?php $field1 = $_post['checkbox']; if ( $field1 == 1 ) { "databaseresultsthumb.php"; } else { "databaseresults.php"; } ?>" method="get" name="indexform" id="indexform"> If someone can help me to get this working then that would be great as it's a real headache. Many Thanks Simon
  5. I have a nature website which uses php to search databases. I am currently adding a option for displaying images by thumbnails. I currently have some radio buttons where the user selects a letter and submits it which then pulls all the records with that character out of the database. What I would like to add is, as well as selecting a letter they can choose to display the records by thumbnail images. I was hoping to add another radio button for the thumbnail option, but I'm not sure on the php code for taking into account the character selected and whether also the thumbnail option has been checked as well. If someone could help me out here then that would be great. Thanks Simon
  6. [!--quoteo(post=365060:date=Apr 15 2006, 07:55 AM:name=litebearer)--][div class=\'quotetop\']QUOTE(litebearer @ Apr 15 2006, 07:55 AM) [snapback]365060[/snapback][/div][div class=\'quotemain\'][!--quotec--] Although its not a php solution, this should accomplish what you want to do. [a href=\"http://www.codetoad.com/dhtml_thumbnail.asp\" target=\"_blank\"]http://www.codetoad.com/dhtml_thumbnail.asp[/a] Lite... [/quote] Thanks for the reply. The code looks and works great. I would however like to add some code to it. This code displays three thumbnails. In mysql database I have three columns to hold the filenames of the images I want to use (image, addimage1 & addimage2). I've succesfully changed the code to pull the image source direct from the database. However, if I don't have an image filename in addimage1 or addimage2 then a empty image box is shown. Is there anyway to only display thumbnails where there is an entry in the database column. I hope you can help me. Thanks Simon
  7. Hi, I'm a complete novice to php so could do with some help. I run an insect website which can display an insect image along with a small write. The image and text is displayed dynamically from a mysql database. Quite often I have more than one image of the same insect, so what I want to do is on the page, display a main large image and somewhere on the page a thumbnail image of the alternative image. Users can then click on the thumbnail to change the main large image and vice a versa. Sorry about my poor description Does anyone know of a script out there than canallow me to do this? Thanks Simon
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.