Nokia Posted April 4, 2008 Share Posted April 4, 2008 Hi guys, new here, found the site via google. I've little or no PHP experience, but my website is written in PHP. I would like to setup a website, were visitors can look at a list of features for a product and put a check mark/ or an x beside the feature they would like. Then the site would return the list of products that meets those features. An example x Autoupdate feature x Help feature useless feature and then say we recommend "product alpha, as it has the following features; updater, helper, etc..." Would this be asking too much? The work would be outsourced to an online auction. Quote Link to comment https://forums.phpfreaks.com/topic/99525-guidance-on-buying-development/ Share on other sites More sharing options...
Yesideez Posted April 4, 2008 Share Posted April 4, 2008 Not a great problem although you'll be needing a database containing all the information about each product. Have an HTML form requesting the data to search with then a query to pull the required data from the database although how you'd write the query to provide close matches I've no idea - MySQL not my real strong point here. Then all you need is a loop to display the data. Depending on how much data you've got in your database depends on whether you'll be needing to look at pageinating the results. Quote Link to comment https://forums.phpfreaks.com/topic/99525-guidance-on-buying-development/#findComment-509144 Share on other sites More sharing options...
Nokia Posted April 5, 2008 Author Share Posted April 5, 2008 and is there a site where i could hire a coder to do all of this? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/99525-guidance-on-buying-development/#findComment-509897 Share on other sites More sharing options...
AndyB Posted April 5, 2008 Share Posted April 5, 2008 and is there a site where i could hire a coder to do all of this? thanks! phpfreaks freelancer forum is one place Quote Link to comment https://forums.phpfreaks.com/topic/99525-guidance-on-buying-development/#findComment-509950 Share on other sites More sharing options...
ardyandkari Posted April 6, 2008 Share Posted April 6, 2008 i think that this would be a pretty simple code for you to get your feet wet if you did want to start learning php. Quote Link to comment https://forums.phpfreaks.com/topic/99525-guidance-on-buying-development/#findComment-510797 Share on other sites More sharing options...
ardyandkari Posted April 6, 2008 Share Posted April 6, 2008 ok...i just came up with a code in about an hour to make this happen (basic, but the main idea is still there). i will post it here... <?php include "dbconnect.php"; //this is whatever file you use to connect to your databese. //if you dont have one you will need to write one in accordance to your host's //directions (GoDaddy is different than some) if(!isset($_POST['f1']) && !isset($_POST['f2']) && !isset($_POST['f3']) && !isset($_POST['f4'])){ echo '<form name="form1" method="post" action=""> <table width="150" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <th scope="col">Select the features that you require. </th> </tr> <tr> <td><p align="center"> <input type="checkbox" name="f1" value="1"> Feature 1</p></td> </tr> <tr> <td><div align="center"> <input type="checkbox" name="f2" value="1"> Feature 2 </div></td> </tr> <tr> <td><div align="center"> <input type="checkbox" name="f3" value="1"> Feature 3 </div></td> </tr> <tr> <td><div align="center"> <input type="checkbox" name="f4" value="1"> Feature 4 </div></td> </tr> <tr> <td><input type="submit" name="Submit" value="Submit"></td> </tr> </table> </form>'; } else { if(!isset($_POST['f1'])){ $f1='0';} else{ $f1=1;} if(!isset($_POST['f2'])){ $f2='0';} else{ $f2=1;} if(!isset($_POST['f3'])){ $f3='0';} else{ $f3=1;} if(!isset($_POST['f4'])){ $f4='0';} else{ $f4=1;} $query="SELECT * FROM features WHERE f1=$f1 AND f2=$f2 AND f3=$f3 AND f4=$f4"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; echo "The Product that you need is:"; while ($i < $num) { $name=mysql_result($result,$i,"prodName"); $id=mysql_result($result,$i,"prodId"); $fe1=mysql_result($result,$i,"f1"); $fe2=mysql_result($result,$i,"f2"); $fe3=mysql_result($result,$i,"f3"); $fe4=mysql_result($result,$i,"f4"); echo "<br> $name."; $i++; }} ?> now, i am not an experienced programmer, so anyone looking at this can tell me if i screwed anything up royally, but as i understand it, using checkboxes doesn't create a mysql security issue...if i am wrong, just tell me. also, this code is being provided "as is" and you can use at your own risk...i just wanted to see if i could do it. Quote Link to comment https://forums.phpfreaks.com/topic/99525-guidance-on-buying-development/#findComment-510837 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.