TAXI FARE CALCULATE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
redskin
Forum Newbie
Posts: 5
Joined: Mon Sep 24, 2007 10:46 am

TAXI FARE CALCULATE

Post by redskin »

i have made a mistake...
sorry...
Last edited by redskin on Mon Oct 01, 2007 12:57 pm, edited 4 times in total.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Post 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.
redskin
Forum Newbie
Posts: 5
Joined: Mon Sep 24, 2007 10:46 am

Post 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]
Begby
Forum Regular
Posts: 575
Joined: Wed Dec 13, 2006 10:28 am

Post by Begby »

change the name of your file so that it ends with .php instead of .html then try it again.
redskin
Forum Newbie
Posts: 5
Joined: Mon Sep 24, 2007 10:46 am

Fare Calculate okay

Post 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?
Last edited by redskin on Tue Mar 31, 2009 6:04 am, edited 3 times in total.
redskin
Forum Newbie
Posts: 5
Joined: Mon Sep 24, 2007 10:46 am

insert the fare calculated result in an orderform

Post 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
redskin
Forum Newbie
Posts: 5
Joined: Mon Sep 24, 2007 10:46 am

need

Post by redskin »

need this script...
taxi fare calcute
Post Reply