
craigtolputt
Members-
Posts
161 -
Joined
-
Last visited
Never
Everything posted by craigtolputt
-
Hi, I am trying to build a jQuery and PHP love it button where the user clicks it and the number increments and saves to a DB. I have it all working apart from the Saving to the DB part : ) I have this currently to save but it doesnt seem to work. <?php mysql_connect("localhost", "web183-loveit", "password") or die ("Error."); mysql_select_db("web183-loveit") or die ("error"); $increase = "UPDATE results SET value=value+1 WHERE id=1;"; $active_rate = mysql_query("SELECT * FROM results WHERE id=1;"); $val = 0; if($rt = mysql_fetch_assoc($active_rate)) { $val = $rt['value']; } if($_POST['action'] == 'add') { mysql_query($increase); print $val++; } ?> Please see it here http://bit.ly/dKx15z Any ideas?? cheers Craig
-
Email the page function adds + in between each word
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Hi Thanks for your response, erm, im not sure if i need to convert or not. I bought this script and it seems to have a few funny bugs throughout but the developers arent helpful at all. What would you suggest? -
Hi All, I have a script that i bought and a part of it has a share icon with an email icon so if the user clicks the email icon then it opens up your email client and adds the details of the deal to the email. The problem is that it seems to break each word up by placing a + between them. So for example you get this... Come+and+check+out+Welcome+to+theSocialDeal,+they+have+this+great+local+deal,+if+we+all+buy+it+then+we+get+it+cheaper! Today's+Deal:+4+hours+of+extreme+MTB+action+at+John+Doe+Extreme+Trail+Centre+for+the+price+of+1+hour Click+this+link+to+check+it+out:+ which should be this... Come and check out Welcome to theSocialDeal, they have this great local deal, if we all buy it then we get it cheaper! Today's Deal: 4 hours of extreme MTB action at John Doe Extreme Trail Centre for the price of 1 hour Click this link to check it out: Here is the php function, does anyone know what this could be and how i can stop it? function share_mail($team) { global $login_user_id; global $INI; if (!$team) { $team = array( 'title' => $INI['system']['sitename'] . '(' . $INI['system']['wwwprefix'] . ')', ); } $pre[] = "Come and check out {$INI['system']['sitename']}, they have this great local deal, if we all buy it then we get it cheaper!"; if ( $team['id'] ) { $pre[] = "Today's Deal: {$team['title']}"; $pre[] = "Click this link to check it out: "; $pre[] = $INI['system']['wwwprefix'] . "/team.php?id={$team['id']}&r={$login_user_id}"; $pre = mb_convert_encoding(join("\n\n", $pre), 'UTF-8', 'UTF-8'); $sub = "The Deal: {$team['title']}"; } else { $sub = $pre[] = $team['title']; } $sub = mb_convert_encoding($sub, 'UTF-8', 'UTF-8'); $query = array( 'subject' => $sub, 'body' => $pre, ); $query = http_build_query($query); return 'mailto:?'.$query; }
-
Simple browse for image and save to DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Quality! Thanks alot for your help i have integrated this now with my form and everything is saving and inserting correctly. cheers all... -
Simple browse for image and save to DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Thanks, that seems to work now. So how could i implement that with my form so that it also saves the destination url of the image in my DB? -
Simple browse for image and save to DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Hi sorry for the delay in doing this, I did what you said and the page refreshed to this... Warning: copy(/uploads/f2011032545.jpg) [function.copy]: failed to open stream: No such file or directory in /home/thesoc11/public_html/thesocialdeal.co.uk/test_upload.php on line 11 File copy failed -
Simple browse for image and save to DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Hi yes the image is NOT in the folder and the image info is NOT in the database either?? And yes the folder permissions are set to 777 -
Simple browse for image and save to DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Hi, thanks for that but i have tried to implement it with my form and the form saved all the data apart from the image. I didnt get any error message or nothing. Heres my php page <?php include "../connect.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>theSocialDeal | be social and get local deals daily</title> <meta name="description" content="" /> <meta name="keywords" content="" /> <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/> <link rel="stylesheet" href="../css/jqtransform.css" type="text/css" media="all" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script src="../js/cufon-yui.js" type="text/javascript"></script> <script src="../js/aachen.font.js" type="text/javascript"></script> <script type="text/javascript"> Cufon.replace('#nav li', { hover: 'true', fontFamily: 'aachen' }); Cufon.replace('h2.title', { hover: 'true', fontFamily: 'aachen' }); Cufon.replace('p.besocial', { hover: 'true', fontFamily: 'aachen' }); Cufon.replace('a.closebtn', { hover: 'true', fontFamily: 'aachen' }); Cufon.replace('h1.whatis', { hover: 'true', fontFamily: 'aachen' }); Cufon.replace('p.headtitle', { hover: 'true', fontFamily: 'aachen' }); Cufon.replace('p.fieldlabel', { hover: 'true', fontFamily: 'aachen' }); </script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script type="text/javascript" src="../js/cookies.js"></script> <script type="text/javascript" src="../js/modalload.js"></script> <script type="text/javascript" src="../js/clickopen.js"></script> <link href="../css/signup.css" rel="stylesheet" type="text/css" /> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="../css/ie7-signup.css"> <![endif]--> </head> <body> <!-- **** Wrapper **** --> <div id="wrap"> <!-- **** Header **** --> <div id="header" style="height:120px;"> <!-- **** Header **** --> <h1 id="logo" style="margin-top:35px;">theSocialDeal</h1> </div> <!-- **** Header **** --> <!-- **** Navigation **** --> <div id="nav"> <ul> <li><a href="../past_deals.html">past Deals</a></li> <li><a href="../index.html">todays Deal</a></li> <li><a href="../future_deals.html">future Deals</a></li> <li><a href="../how_it_works.html">how it Works</a></li> </ul> <div class="loginLinks"> <div class="simpleLink"><a href="#">Login</a> | <a href="#">Register</a></div> <a href="#" class="fconnect">facebook connect</a> </div> </div> <!-- **** Navigation **** --> <!-- **** Main **** --> <div id="main"> <div class="content_top"></div> <!-- **** Content **** --> <div class="content"> <!-- **** Left **** --> <div id="LeftC"> <h1 class="whatis" style="position:relative; float:left; font-family:Arial, Helvetica, sans-serif; font-size:24px; font-weight:normal; color:#0d243f; margin:10px 0 0 5px;"> Promote your business. </h1> <div style="position:relative; float:left; clear:left; width:640px; margin-left:24px; margin-top:20px;"> <? $error = ''; $imagewarn = ''; $name = ''; $company = ''; $address = ''; $phone = ''; $email = ''; $website = ''; $payable = ''; $title = ''; $value = ''; $price = ''; $minpurchase = ''; $maxpurchase = ''; $allowedvouchers = ''; $highlight1 = ''; $highlight2 = ''; $highlight3 = ''; $highlight4 = ''; $highlight5 = ''; $highlight6 = ''; $highlight7 = ''; $highlight8 = ''; $highlight9 = ''; $highlight10 = ''; $fineprint1 = ''; $fineprint2 = ''; $fineprint3 = ''; $fineprint4 = ''; $fineprint5 = ''; $fineprint6 = ''; $fineprint7 = ''; $fineprint8 = ''; $fineprint9 = ''; $fineprint10 = ''; $description = ''; if(isset($_POST['submitemail'])) { $tableName = "deals"; // Where the file is going to be placed $target_path = "/uploads/"; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $name = $_POST['name']; $company = $_POST['company']; $address = $_POST['address']; $phone = $_POST['phone']; $email = $_POST['email']; $website = $_POST['website']; $payable = $_POST['payable']; $title = $_POST['title']; $value = $_POST['value']; $price = $_POST['price']; $minpurchase = $_POST['minpurchase']; $maxpurchase = $_POST['maxpurchase']; $allowedvouchers = $_POST['allowedvouchers']; $highlight1 = $_POST['highlight1']; $highlight2 = $_POST['highlight2']; $highlight3 = $_POST['highlight3']; $highlight4 = $_POST['highlight4']; $highlight5 = $_POST['highlight5']; $highlight6 = $_POST['highlight6']; $highlight7 = $_POST['highlight7']; $highlight8 = $_POST['highlight8']; $highlight9 = $_POST['highlight9']; $highlight10 = $_POST['highlight10']; $fineprint1 = $_POST['fineprint1']; $fineprint2 = $_POST['fineprint2']; $fineprint3 = $_POST['fineprint3']; $fineprint4 = $_POST['fineprint4']; $fineprint5 = $_POST['fineprint5']; $fineprint6 = $_POST['fineprint6']; $fineprint7 = $_POST['fineprint7']; $fineprint8 = $_POST['fineprint8']; $fineprint9 = $_POST['fineprint9']; $fineprint10 = $_POST['fineprint10']; $description = $_POST['description']; if(trim($name) == '') { $error = '<div class="error_message">What is your name?</div>'; } else if(trim($company) == '') { $error = '<div class="error_message">Please enter a company name</div>'; } else if(trim($phone) == '') { $error = '<div class="error_message">Please enter a contact telephone number</div>'; } else if(trim($email) == '') { $error = '<div class="error_message">Please enter your email address</div>'; } else if(!isEmail($email)) { $error = '<div class="error_message">Please enter a valid email address</div>'; } else if(trim($payable) == '') { $error = '<div class="error_message">Who should we make cheques payable to?</div>'; } else if(trim($title) == '') { $error = '<div class="error_message">Please enter a title for your deal</div>'; } else if(trim($value) == '') { $error = '<div class="error_message">What is the value of your deal?</div>'; } else if(trim($price) == '') { $error = '<div class="error_message">What is the price of your deal?</div>'; } else if(trim($minpurchase) == '') { $error = '<div class="error_message">What is the minumum amount of purchases allowed?</div>'; } else if(trim($maxpurchase) == '') { $error = '<div class="error_message">What is the maximum amount of purchases allowed?</div>'; } else if(trim($allowedvouchers) == '') { $error = '<div class="error_message">How many vouchers are allowed per person?</div>'; } else if(trim($description) == '') { $error = '<div class="error_message">Please enter a deal description</div>'; } else if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { $imagewarn = '<div class="refresh_message">Image has been uploaded</div>'; } else { $imagewarn = '<div class="refresh_message">Your deal image has been uploaded</div>'; } if($error == '') { $insert = mysql_query("INSERT INTO $tableName (name,company,address,phone,email,website,payable,title,value,price,minpurchase,maxpurchase,allowedvouchers,highlight1,highlight2,highlight3,highlight4,highlight5,highlight6,highlight7,highlight8,highlight9,highlight10,fineprint1,fineprint2,fineprint3,fineprint4,fineprint5,fineprint6,fineprint7,fineprint8,fineprint9,fineprint10,description) VALUES ('$name','$company','$address','$phone','$email','$website','$payable','$title','$value','$price','$minpurchase','$maxpurchase','$allowedvouchers','$highlight1','$highlight2','$highlight3','$highlight4','$highlight5','$highlight6','$highlight7','$highlight8','$highlight9','$highlight10','$fineprint1','$fineprint2','$fineprint3','$fineprint4','$fineprint5','$fineprint6','$fineprint7','$fineprint8','$fineprint9','$fineprint10','$description')") or die(mysql_error()); $e_subject = 'Thanks for promoting your business'; $headers = "From: info@thesocialdeal.co.uk\r\n"; $headers .= 'Bcc: craig@thesocialdeal.co.uk' . "\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1 "; $headers .= "MIME-Version: 1.0 "; $msg = ""; $msg .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td align=\"center\" valign=\"top\"><br /> <table width=\"670\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td width=\"670\" height=\"20\" align=\"center\" valign=\"top\" bgcolor=\"#d7ebf6\"><img src=\"http://www.thesocialdeal.co.uk/images/email1.gif\" alt=\"\" width=\"670\" height=\"20\" /></td> </tr> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#d7ebf6\"><br /> <a href=\"http://www.thesocialdeal.co.uk\"><img src=\"http://www.thesocialdeal.co.uk/images/email2.gif\" alt=\"\" width=\"311\" height=\"47\" border=\"0\" /></a><br /> <p style=\"font-family:Arial, Helvetica, sans-serif; font-size:20px; font-weight:bolder; color:#0d243f;\"><br /> Thanks for promoting your business.</p> <p style=\"font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:normal; color:#0d243f;\">A member of our team will contact you regarding your deal.<br /> You have submitted the following details:</p> <p style=\"font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold; color:#0099CC;\"> $name<br /> $company<br /> $address<br /> $phone<br /> $email<br /> $website<br /> $payable<br /> $title<br /> $value<br /> $price<br /> $minpurchase<br /> $maxpurchase<br /> $allowedvouchers<br /> $highlight1<br /> $highlight2<br /> $highlight3<br /> $highlight4<br /> $highlight5<br /> $highlight6<br /> $highlight7<br /> $highlight8<br /> $highlight9<br /> $highlight10<br /> $fineprint1<br /> $fineprint2<br /> $fineprint3<br /> $fineprint4<br /> $fineprint5<br /> $fineprint6<br /> $fineprint7<br /> $fineprint8<br /> $fineprint9<br /> $fineprint10<br /> $description</p> <br /> <p style=\"font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:normal; color:#0d243f;\">In the meantime though:</p> <p style=\"font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:normal; color:#0d243f;\"><a href=\"http://www.facebook.com/pages/Tamworth-United-Kingdom/TheSocialDeal/140062476046688\"><img src=\"http://www.thesocialdeal.co.uk/images/email3.gif\" alt=\"\" width=\"149\" height=\"33\" border=\"0\" /></a><br /> <br /> <a href=\"http://www.twitter.com/thesocialdeal\"><img src=\"http://www.thesocialdeal.co.uk/images/email4.gif\" alt=\"\" width=\"149\" height=\"33\" border=\"0\" /></a></p> <br /></td> </tr> <tr> <td width=\"670\" height=\"23\" align=\"center\" valign=\"top\"><a href=\"http://www.thesocialdeal.co.uk\"><img src=\"http://www.thesocialdeal.co.uk/images/email5.gif\" alt=\"\" width=\"670\" height=\"23\" border=\"0\" /></a></td> </tr> </table> <p> </p></td> </tr> </table>"; mail($email, $e_subject, $msg, $headers); // Email has sent successfully, echo a success page. echo "<div id='succsess_page'>"; echo "<h1>Thanks, a member of our team will contact you about your deal.</h1>"; echo "</div>"; } } if(!isset($_POST['submitemail']) || $error != '') // Do not edit. { ?> <? echo $error; ?> <form enctype="multipart/form-data" method="post" action=""> <p class="headtitle">Company Details</p> <p class="fieldlabel">Full Name</p> <input name="name" type="text" id="name" size="30" value="" class="thefield"/> <p class="fieldlabel">Company</p> <input name="company" type="text" id="company" size="30" value="" class="thefield"/> <p class="fieldlabel">Address</p> <textarea name="address" cols="40" rows="3" id="address" class="thefield"></textarea> <p class="fieldlabel">Telephone</p> <input name="phone" type="text" id="phone" size="30" value="" class="thefield"/> <p class="fieldlabel">Email</p> <input name="email" type="text" id="email" size="30" value="" class="thefield"/> <p class="fieldlabel">Website</p> <input name="website" type="text" id="website" size="30" value="" class="thefield"/> <p class="fieldlabel">Cheques Payable to</p> <input name="payable" type="text" id="payable" size="30" value="" class="thefield"/> <p class="headtitle">The Deals Details</p> <p class="fieldlabel">Deal Title</p> <input name="title" type="text" id="title" size="30" value="" class="thefield"/> <p class="fieldlabel">Deal Value</p> <input name="value" type="text" id="value" size="30" value="" class="thefield"/> <p class="fieldlabel">Deal Price</p> <input name="price" type="text" id="price" size="30" value="" class="thefield"/> <p class="fieldlabel">Minimum Purchases</p> <input name="minpurchase" type="text" id="minpurchase" size="30" value="" class="thefield"/> <p class="fieldlabel">Maximum Purchases</p> <input name="maxpurchase" type="text" id="maxpurchase" size="30" value="" class="thefield"/> <p class="fieldlabel">Allowed Vouchers Per Person</p> <input name="allowedvouchers" type="text" id="allowedvouchers" size="30" value="" class="thefield"/> <p class="fieldlabel">Deal Highlights <span style="font-size:12px; color:#0d243f;">(Max 10)</span></p> <input name="highlight1" type="text" id="highlight1" size="30" value="" class="thefield"/> <input name="highlight2" type="text" id="highlight2" size="30" value="" class="thefield"/> <input name="highlight3" type="text" id="highlight3" size="30" value="" class="thefield"/> <input name="highlight4" type="text" id="highlight4" size="30" value="" class="thefield"/> <input name="highlight5" type="text" id="highlight5" size="30" value="" class="thefield"/> <input name="highlight6" type="text" id="highlight6" size="30" value="" class="thefield"/> <input name="highlight7" type="text" id="highlight7" size="30" value="" class="thefield"/> <input name="highlight8" type="text" id="highlight8" size="30" value="" class="thefield"/> <input name="highlight9" type="text" id="highlight9" size="30" value="" class="thefield"/> <input name="highlight10" type="text" id="highlight10" size="30" value="" class="thefield"/> <p class="fieldlabel">The Fine Print <span style="font-size:12px; color:#0d243f;">(Max 10)</span></p> <input name="fineprint1" type="text" id="fineprint1" size="30" value="" class="thefield"/> <input name="fineprint2" type="text" id="fineprint2" size="30" value="" class="thefield"/> <input name="fineprint3" type="text" id="fineprint3" size="30" value="" class="thefield"/> <input name="fineprint4" type="text" id="fineprint4" size="30" value="" class="thefield"/> <input name="fineprint5" type="text" id="fineprint5" size="30" value="" class="thefield"/> <input name="fineprint6" type="text" id="fineprint6" size="30" value="" class="thefield"/> <input name="fineprint7" type="text" id="fineprint7" size="30" value="" class="thefield"/> <input name="fineprint8" type="text" id="fineprint8" size="30" value="" class="thefield"/> <input name="fineprint9" type="text" id="fineprint9" size="30" value="" class="thefield"/> <input name="fineprint10" type="text" id="fineprint10" size="30" value="" class="thefield"/> <p class="fieldlabel">Full Description</p> <textarea name="description" cols="40" rows="3" id="description" class="thefield"></textarea> <p class="fieldlabel">Deal Image</p> <? echo $imagewarn; ?> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> <input type="file" name="image" id="inp" class="thefield"> <input name="submitemail" type="submit" id="submitemail" class="senddeal" value="promote this deal"/> </form> <? } function isEmail($email) { // Email address verification, do not edit. return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email)); } ?> </div> </div> <!-- **** Left **** --> <!-- **** Right **** --> <div id="RightC"> <a href="#" class="banner"></a> <div class="fbholder"> <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/pages/Tamworth-United-Kingdom/TheSocialDeal/140062476046688" width="232"></fb:like-box></div> </div> <!-- **** Right **** --> </div> <!-- **** Content **** --> <div class="content_bottom"></div> </div> <!-- **** Main **** --> </div> <!-- **** Wrapper **** --> <div id="popup_name" class="popup_block"> <a class="close" title="Close this window">Close</a> <h1 class="smlogo">theSocialDeal</h1> <h2 class="title">Who wants to be notified about the best deals in <span>Tamworth</span>?</h2> <iframe name="signup" src="../signupDB.php" width="672" height="77" frameborder="0" scrolling="auto" class="iframe" allowtransparency="true"></iframe> <a href="#" class="closebtn" title="What is theSocialDeal?">What is the<span>Social</span>Deal?</a> <a href="http://www.twitter.com/thesocialdeal" class="smltwitter" title="Follow us on twitter">twitter</a> <a href="http://www.facebook.com/pages/Tamworth-United-Kingdom/TheSocialDeal/140062476046688" class="smlfacebook" title="Become a fan of theSocialDeal">facebook</a> <p class="besocial">be social</p> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-8333979-3']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> What do you think could be the issue? thanks Craig -
Hi Guys, Please can someone here help me with a simple browse for an image from the computer and then when the form is submitted it uploads the image and then saves the image url in my DB. my form page is here http://bit.ly/gntCvD Any help will be appreciated. thanks Craig
-
Displaying a price based on drop down selections`
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Sorry still no luck, This is what i have altogether now... <?php include "connect.php"; $tableName = "pricelist"; $quantity = $_POST['quantity']; $size = $_POST['size']; $stock = $_POST['stock']; $colours = $_POST['colours']; $sides = $_POST['sides']; $variations = $_POST['variations']; if(isset($_POST['getprice'])) { $sql1 = mysql_query("SELECT price FROM $tableName WHERE quantity = '$quantity' AND size = '$size' AND stock = '$stock' AND colours = '$colours' AND sides = '$sides' AND variations = '$variations'"); $row1 = mysql_num_rows($sql1); //if there is a result it will be either 1 or higher if($row1 >= 1) { // ONE OR MORE ROWS $dbData = mysql_fetch_assoc($sql1); // GET THE DATA FROM THE FIRST ROW // IF $row1 IS GREATER THAN 1, THIS MAY NOT BE THE CORRECT PRICE $price = $dbData['price']; } } ?> -
Could anyone give me some exercides / challenges?
craigtolputt replied to Darkelve's topic in PHP Coding Help
I wonder if you can help me?? I need the user to select an option from 6 different drop downs and then i need to check a DB to see if there is a row that contains all the values, if theres is a row with all the values in then i need to return or echo the price value from that row??? do you know how to do this? -
Displaying a price based on drop down selections`
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Thanks, so somthing like this do you think? <?php include "connect.php"; $tableName = "pricelist"; //Post all of the users information (md5 Encrypt the dna_no) $sql1 = mysql_query("SELECT price FROM $tableName WHERE quantity = '$quantity' AND size = '$size' AND stock = '$stock' AND colours = '$colours' AND sides = '$sides' AND variations = '$variations'"); $row1 = mysql_num_rows($sql1); //if there is a result it will be either 1 or higher if($row1 > 1) { $price = $_GET['price']; } if(isset($_POST['contactus'])) { $quantity = $_POST['quantity']; $size = $_POST['size']; $stock = $_POST['stock']; $colours = $_POST['colours']; $sides = $_POST['sides']; $variations = $_POST['variations']; } ?> -
Displaying a price based on drop down selections`
craigtolputt replied to craigtolputt's topic in PHP Coding Help
I have setup the DB so that every different option is accounted for so i have the following and i just need to return the price that matches the row that the user selects so colours+size+quantity+sides+stock+variations == Return Price in that row id colours size quantity sides price stock variations 902 1 A5 0-99 Single 103 250gsm Silk Artpaper 1 903 1 A5 100-199 Single 104 250gsm Silk Artpaper 1 904 1 A5 200-299 Single 105 250gsm Silk Artpaper 1 905 1 A5 300-399 Single 106 250gsm Silk Artpaper 1 906 1 A5 400-499 Single 107 250gsm Silk Artpaper 1 907 1 A5 500-599 Single 108 250gsm Silk Artpaper 1 908 1 A5 600-699 Single 109 250gsm Silk Artpaper 1 909 1 A5 700-799 Single 110 250gsm Silk Artpaper 1 910 1 A5 800-899 Single 111 250gsm Silk Artpaper 1 911 1 A5 900-999 Single 112 250gsm Silk Artpaper 1 912 1 A5 1000-1099 Single 113 250gsm Silk Artpaper 1 913 1 A5 1100-1199 Single 114 250gsm Silk Artpaper 1 -
Displaying a price based on drop down selections`
craigtolputt replied to craigtolputt's topic in PHP Coding Help
**** BUMP ******** BUMP ******** BUMP ******** BUMP **** Is this really hard to accomplish? I thought that it would be easy but i have searched the internet all day now and still i cant find an answer. Please if someone knows how to do this i need to learn please please **** BUMP ******** BUMP ******** BUMP ******** BUMP **** -
Displaying a price based on drop down selections`
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Sorry i dont fully understand, what i want to do is basically return the value in the price field if the other fields match up you can see the form here http://bit.ly/9yDO8T and in my db i have all the different combinations listed so what ever the user selects from the drop down lists there will be a price value -
Displaying a price based on drop down selections`
craigtolputt replied to craigtolputt's topic in PHP Coding Help
**** BUMP **** Please if someone knows how to do this i would really appreciate the help please **** BUMP **** -
Hi Guys, I have successfully managed to get my select drop down boxes to populate from a DB which i am very proud of as I'm still learning PHP but I really need some help on the next part please... I want to display a price based on the drop down selections so in my DB i have this... id colours size quantity sides price stock variations 1 1 A6 0-99 SINGLE 200 100g GLOSS 1 2 1 A6 100-199 SINGLE 300 100g GLOSS 1 What would i need to add to my PHP so that it checks the selections made by the user and displays the relevant price in the price filed in my page????? Hopefully someone can help. thanks Craig
-
Inserting Checkbox values into my DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
thanks very much, all sorted -
Inserting Checkbox values into my DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Ah thanks alot this has worked a treat and yes i did want some of the answers radio buttons but thought that would be making the script to complicated for my knowledge. If i did want to add radio buttons what code would i need to add to get the value of the radios? -
Inserting Checkbox values into my DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
If anyone here knows how i can store checkbox values into a database please can you help me. I have been searching for days now and i cant figure out what i need to add my checkbox values to a database. please please help. -
Inserting Checkbox values into my DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Hi Sorry, Im a newbie to submitting to DB's and cant figure out what i need at the top of my page so that it actually sends my form... this is what i have at the minute but i just get a qhite page <?php if(isset($_GET['submit'])) include "connect.php"; $tableName = "results"; $q1 = mysql_real_escape_string(implode(' ',',',$_GET["q1"])); $q2 = mysql_real_escape_string(implode(' ',',',$_GET["q2"])); $q3 = mysql_real_escape_string(implode(' ',',',$_GET["q3"])); $q4 = mysql_real_escape_string(implode(' ',',',$_GET["q4"])); $q5 = mysql_real_escape_string(implode(' ',',',$_GET["q5"])); $q6 = mysql_real_escape_string(implode(' ',',',$_GET["q6"])); $q7 = mysql_real_escape_string(implode(' ',',',$_GET["q7"])); $q8 = mysql_real_escape_string(implode(' ',',',$_GET["q8"])); $q9 = mysql_real_escape_string(implode(' ',',',$_GET["q9"])); $add_all = "INSERT INTO $tableName (id,qone,qtwo,qthree,qfour,qfive,qsix,qseven,qeight,qnine) VALUES ('','$q1','$q2','$q3','$q4','$q5','$q6','$q7','$q8','$q9')"); mysql_query($add_all) or die(mysql_error()); ?> -
Inserting Checkbox values into my DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
<form action="<?php echo $PHP_SELF;?>" method="post"> <h2>1. Which flavour(s) did you try?</h2> <div class="qarea1"> <input type="checkbox" class="styled" /> <input type="checkbox" class="styled" /> <input type="checkbox" class="styled" /> <input type="checkbox" class="styled" /> <label>Aloe Vera Lime (dark green)</label><input name="q1[]" type="checkbox" class="check" value="Lime" /> <label>Aloe Vera White Grape (pale green)</label><input name="q1[]" type="checkbox" class="check" value="Grape" /> <label>Aloe Vera Apple (white)</label><input name="q1[]" type="checkbox" class="check" value="Apple" /> </div> <h2>2. Please rate the following (1-5):</h2> <p class="opt1">Strongly Dislike</p> <p class="opt2">Dislike</p> <p class="opt3">Neither Dislike or Like</p> <p class="opt4">Like</p> <p class="opt5">Like Alot</p> <div class="qarea2"> <label>Packaging</label><input name="q2[]" type="checkbox" class="check2" value="Packaging - Strongly Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Packaging - Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Packaging - Neither" /><input name="q2[]" type="checkbox" class="check2" value="Packaging - Like" /><input name="q2[]" type="checkbox" class="check2" value="Packaging - Like Alot" /> <label>Flavour</label><input name="q2[]" type="checkbox" class="check2" value="Flavour - Strongly Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Flavour - Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Flavour - Neither" /><input name="q2[]" type="checkbox" class="check2" value="Flavour - Like" /><input name="q2[]" type="checkbox" class="check2" value="Flavour - Like Alot" /> <label>Aloe Vera Pieces</label><input name="q2[]" type="checkbox" class="check2" value="Pieces - Strongly Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Pieces - Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Pieces - Neither" /><input name="q2[]" type="checkbox" class="check2" value="Pieces - Like" /><input name="q2[]" type="checkbox" class="check2" value="Pieces - Like Alot" /> <label>How the drink looks</label><input name="q2[]" type="checkbox" class="check2" value="Looks - Strongly Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Looks - Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Looks - Neither" /><input name="q2[]" type="checkbox" class="check2" value="Looks - Like" /><input name="q2[]" type="checkbox" class="check2" value="Looks - Like Alot" /> </div> <h2>3. Which of the following words do you think describe this drink? (Tick as many as you agree with.)</h2> <div class="qarea3"> <label>Refreshing</label><input name="q3[]" type="checkbox" class="check3" value="Refreshing" /> <label>Fruity</label><input name="q3[]" type="checkbox" class="check3" value="Fruity" /> <label>Lumpy</label><input name="q3[]" type="checkbox" class="check3" value="Lumpy" /> <label>Juicy</label><input name="q3[]" type="checkbox" class="check3" value="Juicy" /> <label>Light</label><input name="q3[]" type="checkbox" class="check3" value="Light" /> <label>Fresh</label><input name="q3[]" type="checkbox" class="check3" value="Fresh" /> </div> <div class="qarea3a"> <label>Healthy</label><input name="q3[]" type="checkbox" class="check3" value="Healthy" /> <label>Cooling</label><input name="q3[]" type="checkbox" class="check3" value="Cooling" /> <label>Unusual</label><input name="q3[]" type="checkbox" class="check3" value="Unusual" /> <label>Chewy</label><input name="q3[]" type="checkbox" class="check3" value="Chewy" /> <label>Don't Know</label><input name="q3[]" type="checkbox" class="check3" value="Dont Know" /> <label>Other</label><input name="q3[]" type="checkbox" class="check3" value="Other" /> </div> <h2>4. Would you buy this drink?</h2> <div class="qarea4"> <label>Yes</label><input name="q4[]" type="checkbox" class="check" value="Yes" /> <label>Maybe</label><input name="q4[]" type="checkbox" class="check" value="Maybe" /> <label>No</label><input name="q4[]" type="checkbox" class="check" value="No" /> <label>Don't Know</label><input name="q4[]" type="checkbox" class="check" value="Dont Know" /> </div> <h2>5. If yes, what would be your reasons for buying this drink? (Tick as many as you agree with.)</h2> <div class="qarea5"> <label>It's refreshing</label><input name="q5[]" type="checkbox" class="check3" value="Its refreshing" /> <label>It's healthy</label><input name="q5[]" type="checkbox" class="check3" value="Its healthy" /> <label>Aloe vera cotents</label><input name="q5[]" type="checkbox" class="check3" value="Aloe vera cotents" /> <label>Low in sugar</label><input name="q5[]" type="checkbox" class="check3" value="Low in sugar" /> </div> <div class="qarea5a"> <label>I like the taste</label><input name="q5[]" type="checkbox" class="check3" value="I like the taste" /> <label>It’s different</label><input name="q5[]" type="checkbox" class="check3" value="Its different" /> <label>It’s new</label><input name="q5[]" type="checkbox" class="check3" value="Its new" /> </div> <h2>6. Would you recommend this drink to people<br />you know?</h2> <div class="qarea4"> <label>Yes</label><input name="q6[]" type="checkbox" class="check" value="Yes" /> <label>Maybe</label><input name="q6[]" type="checkbox" class="check" value="Maybe" /> <label>No</label><input name="q6[]" type="checkbox" class="check" value="No" /> <label>Don't Know</label><input name="q6[]" type="checkbox" class="check" value="Dont Know" /> </div> <h2>7. Do you have any other feedback about<br />this product?</h2> <textarea cols="" rows="" name="q7" wrap="physical"></textarea> <h2>8. How old are you?</h2> <div class="qarea4"> <label>0-16</label><input name="q8[]" type="checkbox" class="check" value="0 to 16" /> <label>17-25</label><input name="q8[]" type="checkbox" class="check" value="17 to 25" /> <label>26-35</label><input name="q8[]" type="checkbox" class="check" value="26 to 35" /> <label>36-49</label><input name="q8[]" type="checkbox" class="check" value="36 to 49" /> <label>50-Over</label><input name="q8[]" type="checkbox" class="check" value="50 and Over" /> </div> <h2>9. Are you?</h2> <div class="qarea4"> <label>Male</label><input name="q9[]" type="checkbox" class="check" value="Male" /> <label>Female</label><input name="q9[]" type="checkbox" class="check" value="Female" /> </div> <input type="submit" name="submit" value="Submit Survey" class="complete"/> </form> -
Inserting Checkbox values into my DB
craigtolputt replied to craigtolputt's topic in PHP Coding Help
Ok this is my index.php which has all the php in and the form i have used. <?php include "connect.php"; $tableName = "results"; $q1 = $_POST["q1"]; $q2 = $_POST["q2"]; $q3 = $_POST["q3"]; $q4 = $_POST["q4"]; $q5 = $_POST["q5"]; $q6 = $_POST["q6"]; $q7 = $_POST["q7"]; $q8 = $_POST["q8"]; $q9 = $_POST["q9"]; $insert = mysql_query("INSERT INTO $tableName (id,qone,qtwo,qthree,qfour,qfive,qsix,qseven,qeight,qnine) VALUES ('','$q1','$q2','$q3','$q4','$q5','$q6','$q7','$q8','$q9')") or die(mysql_error()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Online Survey</title> <meta name="description" content="" /> <meta name="keywords" content="" /> <link href="css/screen.css" rel="stylesheet" type="text/css" /> <script src="js/checkbox.js" type="text/javascript"></script> <script src="js/jquery-1.2.6.js" type="text/javascript"></script> </head> <body> <!-- **** Wrapper **** --> <div id="wrap"> <!-- **** Logo **** --> <h1 class="logo"> AloeVeraDrink.me, survey </h1> <!-- **** Logo **** --> <!-- **** Scroll Window **** --> <div id="scrollwindow"> <form action="<?php echo $PHP_SELF;?>" method="post"> <!-- **** Container **** --> <div id="container"> <!-- **** Screen One **** --> <div id="s1" class="screen"> <p> Thank you for taking the time to answer this quick questionnaire.<br /> It should take you about 5 minutes to fill in.<br /><br /> It’s designed to help us find out what you think about our new Aloe Vera Drinks.<br /><br /> Before you start: <ul> <li>You can skip any question you don’t want to answer by using the ‘next’ button.</li> <li>You can return to a question later using the ‘back’ button if you want to change your answer.</li> </ul> <a href="#s2">Click here to start the questionnaire.</a> </p> </div> <!-- **** Screen One **** --> <!-- **** Screen Two **** --> <div id="s2" class="screen"> <h2>1. Which flavour(s) did you try?</h2> <div class="qarea1"> <label>Aloe Vera Lime (dark green)</label><input name="q1[]" type="checkbox" class="check" value="Lime" /> <label>Aloe Vera White Grape (pale green)</label><input name="q1[]" type="checkbox" class="check" value="Grape" /> <label>Aloe Vera Apple (white)</label><input name="q1[]" type="checkbox" class="check" value="Apple" /> </div> <!-- **** NEXT/PREV **** --> <div id="butts"> <a href="#s1" class="prev">PREV</a> <a href="#s1" class="numbers" rel="panel" style="margin-left:110px;">start</a> <a href="#s2" class="numbers" rel="panel">1</a> <a href="#s3" class="numbers" rel="panel">2</a> <a href="#s4" class="numbers" rel="panel">3</a> <a href="#s5" class="numbers" rel="panel">4</a> <a href="#s6" class="numbers" rel="panel">5</a> <a href="#s7" class="numbers" rel="panel">6</a> <a href="#s8" class="numbers" rel="panel">7</a> <a href="#s9" class="numbers" rel="panel">8</a> <a href="#s10" class="numbers" rel="panel">9</a> <a href="#s3" class="next">NEXT</a> </div> <!-- **** NEXT/PREV **** --> </div> <!-- **** Screen Two **** --> <!-- **** Screen Three **** --> <div id="s3" class="screen"> <h2>2. Please rate the following (1-5):</h2> <p class="opt1">Strongly Dislike</p> <p class="opt2">Dislike</p> <p class="opt3">Neither Dislike or Like</p> <p class="opt4">Like</p> <p class="opt5">Like Alot</p> <div class="qarea2"> <label>Packaging</label><input name="q2[]" type="checkbox" class="check2" value="Packaging - Strongly Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Packaging - Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Packaging - Neither" /><input name="q2[]" type="checkbox" class="check2" value="Packaging - Like" /><input name="q2[]" type="checkbox" class="check2" value="Packaging - Like Alot" /> <label>Flavour</label><input name="q2[]" type="checkbox" class="check2" value="Flavour - Strongly Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Flavour - Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Flavour - Neither" /><input name="q2[]" type="checkbox" class="check2" value="Flavour - Like" /><input name="q2[]" type="checkbox" class="check2" value="Flavour - Like Alot" /> <label>Aloe Vera Pieces</label><input name="q2[]" type="checkbox" class="check2" value="Pieces - Strongly Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Pieces - Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Pieces - Neither" /><input name="q2[]" type="checkbox" class="check2" value="Pieces - Like" /><input name="q2[]" type="checkbox" class="check2" value="Pieces - Like Alot" /> <label>How the drink looks</label><input name="q2[]" type="checkbox" class="check2" value="Looks - Strongly Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Looks - Dislike" /><input name="q2[]" type="checkbox" class="check2" value="Looks - Neither" /><input name="q2[]" type="checkbox" class="check2" value="Looks - Like" /><input name="q2[]" type="checkbox" class="check2" value="Looks - Like Alot" /> </div> <!-- **** NEXT/PREV **** --> <div id="butts"> <a href="#s2" class="prev">PREV</a> <a href="#s1" class="numbers" rel="panel" style="margin-left:110px;">start</a> <a href="#s2" class="numbers" rel="panel">1</a> <a href="#s3" class="numbers" rel="panel">2</a> <a href="#s4" class="numbers" rel="panel">3</a> <a href="#s5" class="numbers" rel="panel">4</a> <a href="#s6" class="numbers" rel="panel">5</a> <a href="#s7" class="numbers" rel="panel">6</a> <a href="#s8" class="numbers" rel="panel">7</a> <a href="#s9" class="numbers" rel="panel">8</a> <a href="#s10" class="numbers" rel="panel">9</a> <a href="#s4" class="next">NEXT</a> </div> <!-- **** NEXT/PREV **** --> </div> <!-- **** Screen Three **** --> <!-- **** Screen Four **** --> <div id="s4" class="screen"> <h2>3. Which of the following words do you think describe this drink? (Tick as many as you agree with.)</h2> <div class="qarea3"> <label>Refreshing</label><input name="q3[]" type="checkbox" class="check3" value="Refreshing" /> <label>Fruity</label><input name="q3[]" type="checkbox" class="check3" value="Fruity" /> <label>Lumpy</label><input name="q3[]" type="checkbox" class="check3" value="Lumpy" /> <label>Juicy</label><input name="q3[]" type="checkbox" class="check3" value="Juicy" /> <label>Light</label><input name="q3[]" type="checkbox" class="check3" value="Light" /> <label>Fresh</label><input name="q3[]" type="checkbox" class="check3" value="Fresh" /> </div> <div class="qarea3a"> <label>Healthy</label><input name="q3[]" type="checkbox" class="check3" value="Healthy" /> <label>Cooling</label><input name="q3[]" type="checkbox" class="check3" value="Cooling" /> <label>Unusual</label><input name="q3[]" type="checkbox" class="check3" value="Unusual" /> <label>Chewy</label><input name="q3[]" type="checkbox" class="check3" value="Chewy" /> <label>Don't Know</label><input name="q3[]" type="checkbox" class="check3" value="Dont Know" /> <label>Other</label><input name="q3[]" type="checkbox" class="check3" value="Other" /> </div> <!-- **** NEXT/PREV **** --> <div id="butts"> <a href="#s3" class="prev">PREV</a> <a href="#s1" class="numbers" rel="panel" style="margin-left:110px;">start</a> <a href="#s2" class="numbers" rel="panel">1</a> <a href="#s3" class="numbers" rel="panel">2</a> <a href="#s4" class="numbers" rel="panel">3</a> <a href="#s5" class="numbers" rel="panel">4</a> <a href="#s6" class="numbers" rel="panel">5</a> <a href="#s7" class="numbers" rel="panel">6</a> <a href="#s8" class="numbers" rel="panel">7</a> <a href="#s9" class="numbers" rel="panel">8</a> <a href="#s10" class="numbers" rel="panel">9</a> <a href="#s5" class="next">NEXT</a> </div> <!-- **** NEXT/PREV **** --> </div> <!-- **** Screen Four **** --> <!-- **** Screen Five **** --> <div id="s5" class="screen"> <h2>4. Would you buy this drink?</h2> <div class="qarea4"> <label>Yes</label><input name="q4[]" type="checkbox" class="check" value="Yes" /> <label>Maybe</label><input name="q4[]" type="checkbox" class="check" value="Maybe" /> <label>No</label><input name="q4[]" type="checkbox" class="check" value="No" /> <label>Don't Know</label><input name="q4[]" type="checkbox" class="check" value="Dont Know" /> </div> <!-- **** NEXT/PREV **** --> <div id="butts"> <a href="#s4" class="prev">PREV</a> <a href="#s1" class="numbers" rel="panel" style="margin-left:110px;">start</a> <a href="#s2" class="numbers" rel="panel">1</a> <a href="#s3" class="numbers" rel="panel">2</a> <a href="#s4" class="numbers" rel="panel">3</a> <a href="#s5" class="numbers" rel="panel">4</a> <a href="#s6" class="numbers" rel="panel">5</a> <a href="#s7" class="numbers" rel="panel">6</a> <a href="#s8" class="numbers" rel="panel">7</a> <a href="#s9" class="numbers" rel="panel">8</a> <a href="#s10" class="numbers" rel="panel">9</a> <a href="#s6" class="next">NEXT</a> </div> <!-- **** NEXT/PREV **** --> </div> <!-- **** Screen Five **** --> <!-- **** Screen Six **** --> <div id="s6" class="screen"> <h2>5. If yes, what would be your reasons for buying this drink? (Tick as many as you agree with.)</h2> <div class="qarea5"> <label>It's refreshing</label><input name="q5[]" type="checkbox" class="check3" value="Its refreshing" /> <label>It's healthy</label><input name="q5[]" type="checkbox" class="check3" value="Its healthy" /> <label>Aloe vera cotents</label><input name="q5[]" type="checkbox" class="check3" value="Aloe vera cotents" /> <label>Low in sugar</label><input name="q5[]" type="checkbox" class="check3" value="Low in sugar" /> </div> <div class="qarea5a"> <label>I like the taste</label><input name="q5[]" type="checkbox" class="check3" value="I like the taste" /> <label>It’s different</label><input name="q5[]" type="checkbox" class="check3" value="Its different" /> <label>It’s new</label><input name="q5[]" type="checkbox" class="check3" value="Its new" /> </div> <!-- **** NEXT/PREV **** --> <div id="butts"> <a href="#s5" class="prev">PREV</a> <a href="#s1" class="numbers" rel="panel" style="margin-left:110px;">start</a> <a href="#s2" class="numbers" rel="panel">1</a> <a href="#s3" class="numbers" rel="panel">2</a> <a href="#s4" class="numbers" rel="panel">3</a> <a href="#s5" class="numbers" rel="panel">4</a> <a href="#s6" class="numbers" rel="panel">5</a> <a href="#s7" class="numbers" rel="panel">6</a> <a href="#s8" class="numbers" rel="panel">7</a> <a href="#s9" class="numbers" rel="panel">8</a> <a href="#s10" class="numbers" rel="panel">9</a> <a href="#s7" class="next">NEXT</a> </div> <!-- **** NEXT/PREV **** --> </div> <!-- **** Screen Six **** --> <!-- **** Screen Seven **** --> <div id="s7" class="screen"> <h2>6. Would you recommend this drink to people<br />you know?</h2> <div class="qarea4"> <label>Yes</label><input name="q6[]" type="checkbox" class="check" value="Yes" /> <label>Maybe</label><input name="q6[]" type="checkbox" class="check" value="Maybe" /> <label>No</label><input name="q6[]" type="checkbox" class="check" value="No" /> <label>Don't Know</label><input name="q6[]" type="checkbox" class="check" value="Dont Know" /> </div> <!-- **** NEXT/PREV **** --> <div id="butts"> <a href="#s6" class="prev">PREV</a> <a href="#s1" class="numbers" rel="panel" style="margin-left:110px;">start</a> <a href="#s2" class="numbers" rel="panel">1</a> <a href="#s3" class="numbers" rel="panel">2</a> <a href="#s4" class="numbers" rel="panel">3</a> <a href="#s5" class="numbers" rel="panel">4</a> <a href="#s6" class="numbers" rel="panel">5</a> <a href="#s7" class="numbers" rel="panel">6</a> <a href="#s8" class="numbers" rel="panel">7</a> <a href="#s9" class="numbers" rel="panel">8</a> <a href="#s10" class="numbers" rel="panel">9</a> <a href="#s8" class="next">NEXT</a> </div> <!-- **** NEXT/PREV **** --> </div> <!-- **** Screen Seven **** --> <!-- **** Screen Eight **** --> <div id="s8" class="screen"> <h2>7. Do you have any other feedback about<br />this product?</h2> <textarea cols="" rows="" name="q7" wrap="physical"></textarea> <!-- **** NEXT/PREV **** --> <div id="butts"> <a href="#s7" class="prev">PREV</a> <a href="#s1" class="numbers" rel="panel" style="margin-left:110px;">start</a> <a href="#s2" class="numbers" rel="panel">1</a> <a href="#s3" class="numbers" rel="panel">2</a> <a href="#s4" class="numbers" rel="panel">3</a> <a href="#s5" class="numbers" rel="panel">4</a> <a href="#s6" class="numbers" rel="panel">5</a> <a href="#s7" class="numbers" rel="panel">6</a> <a href="#s8" class="numbers" rel="panel">7</a> <a href="#s9" class="numbers" rel="panel">8</a> <a href="#s10" class="numbers" rel="panel">9</a> <a href="#s9" class="next">NEXT</a> </div> <!-- **** NEXT/PREV **** --> </div> <!-- **** Screen Eight **** --> <!-- **** Screen Nine **** --> <div id="s9" class="screen"> <h2>8. How old are you?</h2> <div class="qarea4"> <label>0-16</label><input name="q8[]" type="checkbox" class="check" value="0 to 16" /> <label>17-25</label><input name="q8[]" type="checkbox" class="check" value="17 to 25" /> <label>26-35</label><input name="q8[]" type="checkbox" class="check" value="26 to 35" /> <label>36-49</label><input name="q8[]" type="checkbox" class="check" value="36 to 49" /> <label>50-Over</label><input name="q8[]" type="checkbox" class="check" value="50 and Over" /> </div> <!-- **** NEXT/PREV **** --> <div id="butts"> <a href="#s8" class="prev">PREV</a> <a href="#s1" class="numbers" rel="panel" style="margin-left:110px;">start</a> <a href="#s2" class="numbers" rel="panel">1</a> <a href="#s3" class="numbers" rel="panel">2</a> <a href="#s4" class="numbers" rel="panel">3</a> <a href="#s5" class="numbers" rel="panel">4</a> <a href="#s6" class="numbers" rel="panel">5</a> <a href="#s7" class="numbers" rel="panel">6</a> <a href="#s8" class="numbers" rel="panel">7</a> <a href="#s9" class="numbers" rel="panel">8</a> <a href="#s10" class="numbers" rel="panel">9</a> <a href="#s10" class="next">NEXT</a> </div> <!-- **** NEXT/PREV **** --> </div> <!-- **** Screen Nine **** --> <!-- **** Screen Ten **** --> <div id="s10" class="screen"> <!-- Show Message for AJAX response --> <div id="insert_response"></div> <h2>9. Are you?</h2> <div class="qarea4"> <label>Male</label><input name="q9[]" type="checkbox" class="check" value="Male" /> <label>Female</label><input name="q9[]" type="checkbox" class="check" value="Female" /> </div> <input type="submit" name="submit" value="Submit Survey" class="complete"/> <!-- **** NEXT/PREV **** --> <div id="butts"> <a href="#s9" class="prev">PREV</a> <a href="#s1" class="numbers" rel="panel" style="margin-left:110px;">start</a> <a href="#s2" class="numbers" rel="panel">1</a> <a href="#s3" class="numbers" rel="panel">2</a> <a href="#s4" class="numbers" rel="panel">3</a> <a href="#s5" class="numbers" rel="panel">4</a> <a href="#s6" class="numbers" rel="panel">5</a> <a href="#s7" class="numbers" rel="panel">6</a> <a href="#s8" class="numbers" rel="panel">7</a> <a href="#s9" class="numbers" rel="panel">8</a> <a href="#s10" class="numbers" rel="panel">9</a> <a href="#" class="next">NEXT</a> </div> <!-- **** NEXT/PREV **** --> </div> <!-- **** Screen Ten **** --> </div> <!-- **** Container **** --> </form> </div> <!-- **** Scroll Window **** --> </div> <!-- **** Wrapper **** --> </body> </html> thanks Craig -
Hu Guys, I have created a survey type form with 9 questions and multiple answers for each. So the user can select as many answers that they want. So i have the form and it stores the answers to a DB but instead of the actual words it just adds array to the table. does anyone know how to make the actual value of the checkbox store in the db? this is what i get id qone qtwo qthree qfour qfive qsix qseven qeight qnine 2 Array Array Array Array Array Array test Array Array 4 Array Array Array Array Array Array test Array Array cheers Craig
-
Sorted, i have enabled PHP5 on the server and then changed the name of the php.ini file to php5.ini and its worked.