Page 1 of 1

Help on forms, How to display using forms

Posted: Thu Apr 06, 2006 11:01 am
by radhekrishna
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello PHP people,
I am new to PHP.So I started reading a PHP books.While reading a got a small doubt please help me .


My doubt
==========

I want to display currency in INDIA Rupess when US Dollar given as input.
Input is US Dollar.Output is Indian Rupee.
it is simply currency convertion.
1 US$=46 Indian Rupee.

So My aim is when Us dollar is input ina text form.When submit button press it must display the indian rupee in same page.

so I written like this and found many errors .please help me and rectify.

Code: Select all

<html>
<form>
Enter US Dollar
<input type=text name=USD>
<input type=submit value="submit">
<?php
$rate=46;
$INR=$USD*$rate;
?>
The coverted dollar is:
<?php 
echo $(INR)
?>
</form>
<html>
I got some errors.please help me.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Thu Apr 06, 2006 11:05 am
by feyd
why are there parens around INR?

Unless register_globals is on, $USD will not exist upon submission. You should post the errors you are receiving too.