Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 11th Jul 2013, 01:40 AM   #1
HyperActive Warrior
Registered Member
 
Join Date: 2012
Posts: 189
Thanks: 66
Thanked 14 Times in 14 Posts
Blog Entries: 1
Default
PHP Tutorial
Share on: 
fb share twitter share gplus share more share

Can any one suggest a tutorial that would teach me to build something like this "bottle service price calculator"

https://www.ezvip.com/events/36025/#tables-estimate

Looks pretty simple, but I don't know any PHP


Thanks

Peter
pvijeh is offline  
Unread 11th Jul 2013, 06:54 AM   #2
HyperActive Warrior
War Room Member
 
Join Date: 2004
Location: , , .
Posts: 179
Thanks: 5
Thanked 44 Times in 33 Posts
Default
Re: PHP Tutorial
Share on: 
fb share twitter share gplus share more share

You don't need php for this, it's javascript.
phpg is offline  
The Following User Says Thank You to phpg For This Useful Post:
Unread 11th Jul 2013, 09:33 AM   #3
Advanced Warrior
War Room Member
 
Brandon Tanner's Avatar
 
Join Date: 2006
Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
Default
Re: PHP Tutorial
Share on: 
fb share twitter share gplus share more share

Looks like they are using jQuery AND PHP for that particular calculator. If you look at that page's source code, then scroll about half way down it -- you'll see a bunch of <option> tags and then jQuery code below it. One of the jQuery lines calls a PHP file (orderprocess.php) and extracts data from it.

But phpg is correct that you don't need to use PHP to create a calculator like this. You can do it in pure Javascript / jQuery.

Here's a quick example how something like that could be accomplished using jQuery (assuming that you want the cost for each person to be $100)...

HTML Code:
<!DOCTYPE html>
<html>
<head>
    <script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
</head>

<body>

<label>Guys</label>
<select id="guys" class="people">
    <option value="0" selected>0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
</select>

<label>Girls</label>
<select id="girls" class="people">
    <option value="0" selected>0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
</select>

<label>Total Cost</label>
<input type="text" id="cost" value="$0">

<script>
$('.people').change(function() { 
    var quantity = $('#guys').val() * 1 + $('#girls').val() * 1;
    var price = "$" + quantity * 100;
    $('#cost').val(price);
});
</script>

</body>
</html>


Brandon Tanner is offline  
The Following User Says Thank You to Brandon Tanner For This Useful Post:
Unread 11th Jul 2013, 01:51 PM   #4
HyperActive Warrior
Registered Member
 
Join Date: 2012
Posts: 189
Thanks: 66
Thanked 14 Times in 14 Posts
Blog Entries: 1
Default
Re: PHP Tutorial
Share on: 
fb share twitter share gplus share more share

thanks! very helpful
pvijeh is offline  
Unread 12th Jul 2013, 01:15 AM   #5
HyperActive Warrior
 
Join Date: 2009
Location: Philippines
Posts: 255
Thanks: 5
Thanked 3 Times in 3 Posts
Default
Re: PHP Tutorial
Share on: 
fb share twitter share gplus share more share

Try to visit W3Schools Online Web Tutorials . It has many useful information and tutorials mostly about web development (HTML,PHP, CSS etc. )

Business Consulting Services - Kittelson & Carpo Consulting
rypher21 is offline  
Closed Thread


Bookmarks

Tags
php, tutorial


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 11:57 AM.