Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Duan_D

Members
  • Joined

  • Last visited

  1. HI! An update, So I've been solidly working through tutorials on http://thephpbasics.com/ and reading http://www.w3schools.com/ and I've got a much clearer understanding of how HTML and PHP interact now. I've now got onto the tutorials for MYSQL but I'm feeling a little confused. All the tutorials seem to be written in a way that teach you all the functions etc but I still have very little understanding of how these things can be applied practically. So I think I know what I want for my website, but I'm not really closer to understanding how to achieve the results.. which development tools do I use/learn to get which results? So I'm hoping you'll be able to point me in the right direction again, even if you just focus my thoughts a little. Here's my site as it is at the moment: http://www.ickeck.comze.com/index.php Oh also, by the way, how come other websites don't tend to have .php extensions, they always have html. Is the use of "include" and "require" PHP for headers and footers not a common thing, or do they just save the files as .html anyway? So now I need to get from having the calculator outputting a value, to using that value in a confirmation and then transaction (paypal to begin with most likely?). Then, having completed the transaction, the user needs to get to a page populated with the appropriate number of file upload boxes (each accompanied with a text input), or a checkbox saying they will send a CD in the post containing their unmixed product. Does the fact that I need so much information remembered mean I need to carry on learning about MSQL? Is it possible to look at my needs and recommend any specific functions in any specific tool? I'm hoping you can offer some relief haha I'm so muddled! Cheers, Duan
  2. You're a genius! I actually cheered out loud the first time the dropdown box appeared with the corresponding number of options haha! Awesome! Thanks so much, every now and then I go and pretend I'm using it for real haha. Anyway, I got reading a PHP walk-through and read the whole thing. But it was only once I'd finished that I realised I only understood like the first couple of paragraphs and I must have spent the rest of the time just kidding myself that I understood what it all meant. But today with each meal I've watched youtube vids on the basics and I'm starting to get to grips with the syntax rules and getting my head around client side and server side and stuff. And I've got some free hosting space now to test out posting and echoing and all this other stuff I'm not sure I understand enough to be doing! My HTML understanding is improving with all of this as well, now I know nesting forms is illegal So here's the page online: http://www.ickeck.comze.com/quote.html What has it done to my "£25"? Here it is in JFiddle to see if I've changed something by accident: http://jsfiddle.net/Duan_d/22Hu2/ Cheers, Duan.
  3. WOW I've spent today researching AJAX and PHP and I don't think I'm any nearer to my goal yet! Overwhelmingly new concepts to me, I've got a looong way to go! Anyway I've been adjusting my "quote builder" again, and while doing so I wondered if it wouldn't be possible to get new form fields appearing using js to hide them when the page loads until the checkboxes are checked? Or is that clunky way of doing it? Also, I wondered if you could advise me on what to use to get the dropdown boxes (once they have appeared) to populate themselves with the text inputted in the above text box. Or is that way over the top? Here's my code so you can see what I mean: (ignore the "your price" thing, I plan to use it to replace the "Total".) <!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" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <title>Untitled Document</title> </head> <body> <form id="calc" name="calc"> <p> <H1>Mix - Quote Builder</H1> Step 1. </p> <p>Please input the number of songs you wish to submit for mixing. </p> <p> <input id="mixes" name="mixes" type="text" /> <label for="mixes">Number of mixes</label> <p>Please select the optional extras that you require.</p> <p> <input type="checkbox" name="extras" value="25" class="chk-option" /> <label for "mixes">24bit Stems (ready for mastering)</label> </p> <form action=""> <select name="options"> <option value="All">All</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> </form> <p> <input type="checkbox" name="extras" value="25" class="chk-option" /> <label for "mixes">A Capella Mix</label> </p> <form action=""> <select name="options"> <option value="All">All</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> </form> <p> <input type="checkbox" name="extras" value="25" class="chk-option" /> Instrumental Mix </p> <form action=""> <select name="options"> <option value="All">All</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> </form> </p> <p> <input name="calculateTotal" id="calculateTotal" type="button" value="Calculate Total" /> </p> <div id="result" style="clear:both;"> <strong>Total:</strong> <span id="total"></span> <strong>Per mix:</strong> <span id="permix"></span> </div> </form> <p> <table class="table"> <tr class="table-firstrow"><th>Your Price</th><th> </th></tr> <tr><td>Order Code</td><td>example</td></tr> <tr><td>Number of mixes</td><td>0</td></tr> <tr><td>Optional Extras</td><td>0</td></tr> <tr><td>Total</td><td>0</td></tr> </table> </p> <p> <FORM action="mixquotebuilderstep2.html" target="_blank"> <INPUT type=submit value="Proceed"> </FORM> </p> <script> $(document).ready(function() { $('#calculateTotal').click(function() { //individual mix price before reduction var mixPriceIndiv = 50; //number of mixes selected by user var nummixes = parseInt($('#mixes').val()); //get mix price based on number of mixes var mixPrice = getmixPrice(nummixes); //for each of the chk-option checkboxes, add values if checked $('.chk-option').each(function() { if( $(this).is(':checked') ) { mixPrice+= parseInt($(this).val()); } }); //grand total $('#total').html('£' + mixPrice.toFixed(2)); //per mix $('#permix').html('£' + mixPriceIndiv.toFixed(2)); }); function getmixPrice(el) { numS = parseInt(el); //calculate mix price shPrice = 50*numS; //get percentage value based on number of mixes e.g. if 2 mixes, take off 1% percentVal = (el!==1) ? ((numS-1)/100)*shPrice : 1 //get mix price minus the percentage mixPrice = (el!==1) ? (50*el) - percentVal : 50 //console.log(mixPrice); return mixPrice; } }); </script> </body> </html> ANY advice is gratefully received, as always! Duan
  4. AJAX!!! I've never heard of that in my life before but it does exactly what I hoped someone would suggest! Thanks Lyndsey, I've used PHP in a contact form once before so I should be able to get my head around doing this with the help of those tutorials you linked. And I also found an AJAX tut on the first site you linked for PHP. I'm going to take a few days out on the tutorials and hopefully I can come back with something to make you proud haha. And thank you so much for the checkbox update, I don't think that's something I would ever have worked out on my own! Wish me luck! Duan
  5. Let me start by thanking you guys, I really didn't expect such helpful people! I have some more questions but I do realise that people get paid to do this stuff. So seriously, just tell me when to stop bugging you guys for help and to start paying someone (and then your last piece advice can be who to pay!). So anyway I got the code that Lyndsey made into Dreamweaver and made some changes to the html to make it suit my needs a little better. I wasn't sure how to adjust the script however. For example, I deleted some text boxes so now surely I have some redundant javascript? Here's my code as it is at the moment: <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <title>Untitled Document</title> </head> <body> <form id="calc" name="calc"> <p> <H1>Quote Builder</H1> </p> <p>Please input the number of songs you wish to submit for mixing. </p> <p> <input id="mixes" name="mixes" type="text" /> <label for="mixes">Number of mixes</label> </p> <p>Optional Extras (£25 each):</p> <p> <input type="checkbox" name="extras" value="25" class="chk-option" /> <label for "mixes">24bit Stems (ready for mastering)</label> </p> <p> <input type="checkbox" name="extras" value="25" class="chk-option" /> <label for "mixes">A Capella Mix</label> </p> <p> <input type="checkbox" name="extras" value="25" class="chk-option" /> <label for "mixes">Instrumental Mix</label> </p> <p> <input name="calculateTotal" id="calculateTotal" type="button" value="Calculate Total" /> </p> <div id="result" style="clear:both;"> <strong>Total:</strong> <span id="total"></span> <strong>Per mix:</strong> <span id="permix"></span> </div> </form> <script> $(document).ready(function() { $('#calculateTotal').click(function() { //individual mix price before reduction var mixPriceIndiv = 50; //number of mixes selected by user var nummixes = parseInt($('#mixes').val()); //get mix price based on number of mixes var mixPrice = getmixPrice(nummixes); //per color price var perColorPrice = 5.99; //num front colors var frontColors = ($('#colorsOnFront').val()) ?parseInt($('#colorsOnFront').val()) : 0; //num back colors var backColors = ($('#colorsOnBack').val()) ? parseInt($('#colorsOnBack').val()) : 0; console.log(mixPrice); var totalCost = mixPrice + (perColorPrice*frontColors) + (perColorPrice*backColors); //grand total $('#total').html('£' + totalCost.toFixed(2)); var permixCost = mixPriceIndiv + (perColorPrice*frontColors) + (perColorPrice*backColors); //per mix $('#permix').html('£' + permixCost.toFixed(2)); }); function getmixPrice(el) { numS = parseInt(el); //calculate mix price shPrice = 50*numS; //get percentage value based on number of mixes e.g. if 2 mixes, take off 1% percentVal = (el!==1) ? ((numS-1)/100)*shPrice : 1 //get mix price minus the percentage mixPrice = (el!==1) ? (50*el) - percentVal : 50 console.log(mixPrice); return mixPrice; } }); </script> </body> </html> Question 1. What do I add the code to get the calculator to include the check-boxes? Question 2. Once a user has used the calculator to get an idea of how much this service will cost them, how do I move on with the information they have provided? In my head I see it working like this... - They use the calculator and then click a link e.g "agree", and are then lead to page where they can upload their un-mixed material and input their bank details. How do I get the new page to know how many songs this user chose to upload for mixing, in the last page? Question 3. Can anyone suggest a way of getting around the situation where someone wants to upload 4 tracks to be mixed, but only wants an 'optional extra' on 1 of them? I hope this isn't too much to ask guys, let me know if it is! Duan
  6. Hey it's actually possible this is fantastic!! Thanks so much Lyndsey!! I'm too thick to get this into Dreamweaver but once I do I plan to add an extra £25 check box. Hopefully I'll be able to go from here but I'll post here if not! Thanks again!
  7. So mine would go some thing like: user inputs 1 - the price is £50 user inputs 2 - (50 x 2) -1% = £99 user inputs 3 - (50 x 3) -2% = £147 user inputs 4 - (50 x 4) -3% = £194 etc.. Would something like that work?
  8. My aim is to create a form whereby the user can input the number of a services required (in a text input box that validates numerically), and where I can specify the price. The catch is that I need to be able to specify how the price adds up i.e if the user enters "1" the quote generator needs to output "£50" however if the user inputs "2", the quote generator needs to output "£99". The further catch is that it needs to be possible for the user to input any number up till 100 before a pop-up advises to email for a quote. The closest thing I've been able to find from searching forums and google has been this: <!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>Calc</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script type="text/javascript"> <!-- $(document).ready(function() { $('#calculateTotal').click(function() { var shirtsPrice = 10.50, perColorPrice = 5.99; var inputNum_of_Shirts = $('#shirts').val(); var inputNum_of_FColor = $('#colorsOnFront').val(); var inputNum_of_BColor = $('#colorsOnBack').val(); var totalCost = (inputNum_of_Shirts*parseFloat(shirtsPrice)) +(parseFloat(perColorPrice)*inputNum_of_FColor) +(parseFloat(perColorPrice)* inputNum_of_BColor ); var perShirtCost = (parseFloat(shirtsPrice)) +(parseFloat(perColorPrice)*inputNum_of_FColor) +(parseFloat(perColorPrice)*inputNum_of_BColor); $('#total').html(formatCurrency(totalCost)); $('#perShirt').html(formatCurrency(perShirtCost)); $('#result').css('display', 'block'); }); }); // This Function I have searched from Web function formatCurrency(strValue) { strValue = strValue.toString().replace(/\$|\,/g,''); dblValue = parseFloat(strValue); blnSign = (dblValue == (dblValue = Math.abs(dblValue))); dblValue = Math.floor(dblValue*100+0.50000000001); intCents = dblValue%100; strCents = intCents.toString(); dblValue = Math.floor(dblValue/100).toString(); if(intCents<10) strCents = "0" + strCents; for (var i = 0; i < Math.floor((dblValue.length-(1+i))/3); i++) dblValue = dblValue.substring(0,dblValue.length-(4*i+3))+','+ dblValue.substring(dblValue.length-(4*i+3)); return (((blnSign)?'':'-') + '$' + dblValue + '.' + strCents); } --> </script> </head> <body> <form id="calc" name="calc"> <p> <input id="shirts" name="shirts" type="text"> <label for="shirts">Number of Shirts</label> </p> <p> <input id="colorsOnFront" name="colorsOnFront" type="text"> <label for="colorsOnFront">Number of Colors on Front</label> </p> <p> <input id="colorsOnBack" name="colorsOnBack" type="text"> <label for="colorsOnBack">Number of Colors on Back</label> </p> <p><input name="calculateTotal" id="calculateTotal" type="button" value="Calculate Total" /></p> <div id="result" style="display:none;"><strong>Total:</strong> <span id="total"></span> <strong>Per Shirt:</strong> <span id="perShirt"></span></div> </div> </form> </body> </html> The only thing wrong with this is that there can only be one set price, I need 100 different prices that can be called up depending on what number under 100 the user inputs. IS THIS EVEN POSSIBLE? I would be so grateful if someone could shed some light! Cheers, Duan
  9. This is amazing Wynn, works like a dream! There are some tweaks I'd like to make I just don't know how. Don't worry, I'm no expecting anyone to do this for me I just don't even know what to put into google to come up with the right tutorials or whatever; so feel free to point me in right direction of some key words or something. A tweak I'd like to try out is as follows: With the drop down selection boxes (options 1+2), you've made it possible to specify an outome based on what the user selects e.i if you select 1, the total can be 35.4 for example. Is it possible to get the same happening with the input boxes? So that the user could input a number and the total could be a number assigned by me? I guess this is more complicated as there are infinite "option values", if that's the right term. Maybe like an algorythm type thing? Apolgies if it's clear that I know nothing about this! Duan
  10. Thanks jimmymustang! That helped ALOT! I've made a new post on that thread now.
  11. This is brilliant! I'm wondering if there would be a way of replacing the drop down boxes with a text input box? ...so the "Total" reacts to whatever is inputted?
  12. Was this ever concluded? I'm looking to create a quote builder such as the "Jane's Ironing Service" one (http://www.janesironingservice.com/calculator.php) except made from text input boxes (numerical) and tick boxes instead of dropdown boxes. Any help is much appreciated. Cheers! Duan

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.