Page 1 of 1

TAXI FARE CALCULATE

Posted: Tue Sep 25, 2007 5:08 am
by redskin
i have made a mistake...
sorry...

Posted: Tue Sep 25, 2007 5:26 am
by aceconcepts
When you're "echoing" HTML within PHP you need to use backslashes.

i.e.

Code: Select all

echo"<select name=\"selectList\">";
Also, post you PHP code with the

Code: Select all

tags provided.

Posted: Tue Sep 25, 2007 7:04 am
by redskin
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]


PHP Code;

Code: Select all

<?
echo '<form action="'. $_SERVER['PHP_SELF'] .'" method="post">
       Select your destiny:<select name=\"city\">'; //I HAVE MODIFIED
foreach($city_array AS $city => $km) {
  echo '<option value="'. $city .'">'. $city ."</option>\n";
}
echo '</select><br />
Select total person:<select name="\persons\">';  //I HAVE MODIFIED
for($i=1;$i <= $max_persons; $i++) {
  echo'<option value="'. $i .'">'. $i ."</option>\n";
}
echo '</select><br />
Select between stops:<select name="\betweenstop\"><option value="0">No</option>';
for($i=1;$i <= $max_stop; $i++) {
  echo'<option value="'. $i .'">'. $i ."</option>\n";
}
echo '</select><br />
<input type="submit" value="Calculate" name="submit" />
</form>';
}
?>
BUT IT STILL SHOWS THE SAME PROBLEM, ANY IDEA?


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: Tue Sep 25, 2007 7:36 am
by Begby
change the name of your file so that it ends with .php instead of .html then try it again.

Fare Calculate okay

Posted: Wed Sep 26, 2007 8:11 am
by redskin
Thanks for your reply...

Now after calculating the price (one way price)
i would like to have a radio button for return(2 ways)
(de formula is totalprice*2-5% discount)



this is de scription which i have.

How to make it?

insert the fare calculated result in an orderform

Posted: Thu Sep 27, 2007 4:52 am
by redskin
Dear friends...

i wonder how to add the calculated fare in an bookingform?
i dont get throught with it becouse the script is using echo.


anyone knows? perhaps a little sample...
thanks

need

Posted: Mon Oct 01, 2007 12:59 pm
by redskin
need this script...
taxi fare calcute