Jump to content

dtommy79

New Members
  • Posts

    5
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://domain-sector.com/forum/

Profile Information

  • Gender
    Not Telling

dtommy79's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks
  2. Hi, I created a simple script that converts miles to kilometer. I added it to an HTML file and it works fine, but when I load the page (and there is nothing to convert) it gives me an error: So basically what I want is to display nothing on page load or if there is nothing in the input field. Here is my code: <h3 class="section-heading">Convert Miles to Kilometer II.</h3> <hr class="primary"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" style="margin-top: 20px;"> <p>Add Miles: <input type="text" class="form-control" placeholder="miles" name="mile" size="2" /> </p> <p> <input type="submit" class="btn btn-primary" value="Submit" /> </p> </form> <?php $miles = $_POST['mile']; //This is line 130 // How many km is one mile? $onemile = 1.609344; $totalkm = $miles * $onemile; print "<p>$miles miles is $totalkm kilometer.</p>"; ?> Thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.