bluecorr Posted December 12, 2006 Share Posted December 12, 2006 My knowledge of PHP is limited to making slight changes to existing scripts. I now have the ambition to do a comparison tool as follows.I want to compare apples, oranges, bananas, grapes and pears. Each option would have a checkbox. When someone checks apples, oranges and bananas, they'd be taken to static page comp_aob.html, when someone checks apples and bananas, they'd be taken to comp_ab.html.Could someone help me get started? I'd like this to be as simple as possible but I have no idea where to start.Thanks! Link to comment https://forums.phpfreaks.com/topic/30352-need-help-on-a-comparison-tool-multiple-checkbox-selection/ Share on other sites More sharing options...
timmah1 Posted December 12, 2006 Share Posted December 12, 2006 You want to have static pages already setup for the combinations that people might pick?I'm kinda confused on what you want Link to comment https://forums.phpfreaks.com/topic/30352-need-help-on-a-comparison-tool-multiple-checkbox-selection/#findComment-139660 Share on other sites More sharing options...
bluecorr Posted December 12, 2006 Author Share Posted December 12, 2006 Yes pages are already setup for each combination Link to comment https://forums.phpfreaks.com/topic/30352-need-help-on-a-comparison-tool-multiple-checkbox-selection/#findComment-139668 Share on other sites More sharing options...
timmah1 Posted December 12, 2006 Share Posted December 12, 2006 then most likely, you don't need to use PHPIf you are already going to set up the pages as a different name for every combination, then you could put the comparision right on the page already. Link to comment https://forums.phpfreaks.com/topic/30352-need-help-on-a-comparison-tool-multiple-checkbox-selection/#findComment-139672 Share on other sites More sharing options...
Psycho Posted December 12, 2006 Share Posted December 12, 2006 Assuming you have a page with checkboxes named apples, oranges, etc.just set the action of the form to call a processing page with something like this:[code]<?php$compPage = "comp_";$compPage .= (isset($_POST['apples'])) ? "a" : "";$compPage .= (isset($_POST['oranges'])) ? "o" : "";$compPage .= (isset($_POST['bananas'])) ? "b" : "";$compPage .= (isset($_POST['grapes'])) ? "g" : "";$compPage .= (isset($_POST['pears'])) ? "p" : "";$compPage .= ".html";header("Location: " . $compPage);?>[/code] Link to comment https://forums.phpfreaks.com/topic/30352-need-help-on-a-comparison-tool-multiple-checkbox-selection/#findComment-139691 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.