Current location: Hot Scripts Forums » Programming Languages » PHP » exchange currency


exchange currency

Reply
  #11 (permalink)  
Old 09-24-09, 08:17 AM
soesanmg soesanmg is offline
Newbie Coder
 
Join Date: Sep 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Yes. I want to give my php file for looking up what is wrong. Pleas drown load in the following links
SEND6 - Send large files In this link is sql file too.
Please help me. what is wrong. If i write php code wrong, Please explain me. If you have a same code for my php code, Please give me as example . very very thanks...
Reply With Quote
  #12 (permalink)  
Old 09-24-09, 01:12 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Please post the currency exchange code in the forum. It makes it easier for people to help you.
Reply With Quote
  #13 (permalink)  
Old 09-24-09, 03:17 PM
soesanmg soesanmg is offline
Newbie Coder
 
Join Date: Sep 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
ruble.php
<?
include("includes/db.php");
$result=mysql_query("select * from products");
$R=$_GET['rub'];
while($row=mysql_fetch_array($result))
{
$id=$row['productid'];
$a=$row['currencies'];
$type=$row['type'];
if($R!=$type&&$type=='US dollor'){
$b=($a*30);
}
else if($R!=$type&&$type=='Ks'){
$b=($a/50);
}
else {
$b=$a;
}
$sql =mysql_query("update products set currencies ='$b',type='Ru' where productid='$id'");
}
header("location:index.php");
exit();
?>
Reply With Quote
  #14 (permalink)  
Old 09-24-09, 03:19 PM
soesanmg soesanmg is offline
Newbie Coder
 
Join Date: Sep 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
dollor.php
PHP Code:

<?

include("includes/db.php");
$result=mysql_query("select * from products");
$D=$_GET['d'];
$z=$_GET['do'];
while(
$row=mysql_fetch_array($result))
{
$id=$row['productid'];
$p=$row['price'];
$a=$row['currencies'];
$type=$row['type'];
if(
$D!=$type&&$type=='Ks'){
$a=$row['currencies'];
$b=($a/1000);

else if(
$D!=$type&&$type=='Ru'){
$a=$row['currencies'];
$b=($a/30);
}
else{ 
$b=$p;
}
$sql =mysql_query("update products set currencies='$b',type='US dollor' where productid='$id'");
}
header("location:index.php");
exit();
?>

Last edited by wirehopper; 09-24-09 at 03:48 PM. Reason: PHP tags
Reply With Quote
  #15 (permalink)  
Old 09-24-09, 03:50 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
I think you should look at some of the scripts in HotScripts. Your code doesn't look like it can adapt to changes in the exchange rates without code changes.

The price for items should be stored in the database in the currency of the store - if it is a Russian store, it should be Russian currency. Then, if a person wants to pay with a different currency, the Russian price should be converted to the requested currency, based on the current exchange rates.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Link Exchange w/ Google Page Ranks ajs5mz2 Traffic Exchange 6 05-26-07 01:53 AM
Link Exchange Management linkmore General Advertisements 0 11-23-05 08:38 AM
Free Link Exchange Program JC3 General Advertisements 0 09-30-05 12:02 PM
Link Exchange JC3 General Advertisements 0 09-22-05 04:29 PM
Traffic exchange script hbourchi Traffic Exchange 0 06-22-04 12:26 PM


All times are GMT -5. The time now is 08:00 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.