Unableto add in PHP

General discussions related to php

Moderators: macek, egami, gesf

Post Reply
peterachutha
New php-forum User
New php-forum User
Posts: 10
Joined: Sat May 31, 2014 10:35 pm

Re: Unableto add in PHP

Post by peterachutha » Sat May 31, 2014 10:45 pm

The code worked very well on my server. No problems.

Just a suggestion: I would not use '1' and '2' as later on when you code gets more complex you might mis-read it.

developerahusain
New php-forum User
New php-forum User
Posts: 44
Joined: Tue May 28, 2013 10:04 pm
Location: India,Lucknow

Re: Unableto add in PHP

Post by developerahusain » Sat May 31, 2014 10:45 pm

Instead of Print %total,you use echo $total.That would be more ideal.
Developerahusain

peterachutha
New php-forum User
New php-forum User
Posts: 10
Joined: Sat May 31, 2014 10:35 pm

Re: Unableto add in PHP

Post by peterachutha » Sat May 31, 2014 10:58 pm

May be you miss-interpreted how placeholder works. It does not transfer a value into the field.

If you wanted a default value transferred into the fields you could have written it as:-

<input type="number" name="1" placeholder="number" value="<?php echo $var1; ?>"/>
<input type="number" name="2" placeholder="number2" value="<?php echo $var2; ?>" />

I hope this helps.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest