Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Want Currency Converter In Php Code


i want to convert one country currency to another country currency in my shopping web site without redirecting to another site. can u suggest some idea to do this.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
FLV Converter With Php
Somedy know how to convert avi, mpg or other video files in flv format,
with PHP script?

Html To Pdf Converter?
I am searching for code that convert html to pdf. Do anybody had idea or anylink to exisisting source code.

Md5 Password Converter
just want to ask if there is any tool or code that can convert md5 password to the normal password?

Converter For PhpBB To VBullettin
I want to convert an existing site in phpBB to Vbullettin.Is there any
converters available for the same.Please let me know more about this as
this is an urgent requirement

PhpWiki To Mediawiki Converter In Php Or Perl?
I'm looknig for advice / inspiration / modules / libraries,
I'm a little more fluent in perl, but a php solution would also be fine.

I'm having two Wiki servers:

Server1:
- phpwiki with user authentication
- direct access to the mysql data base possible
- contains about 400 entries

Server1:
- MediaWiki (Wikipedia is Mediawiki based) with user authentification
- direct access to the mysql data base possible
- contains about 30 entries

I'd like to copy over about 350 entries from Server1 to Server2(I could
apply a filter rule or semiautomatically create a list with entries to copy

As the amount of entries is low I don't really need an optimized solution.

Entries in server 2 can be overwritten.

I wanted to have your advice:
1.) Is there already something similiar, that exists?
2.) Is there a Wikiadmin focused news group (I don't like mailing lists
and web based forums, as you have to create a noew account for most of
them or to increase your spam rate even more) ?

If not:
I know very little about the wiki internals and was thinking about a
'brute force' method, not knowing if something better exists:

The idea:
1.) get all the entries from the phpWiki via mysql ( from table "wiki" )
2.) fix naming style (my phpwiki entries contain spaces)
3.) replace the phpWiki syntax with Mediawiki syntax (I found url with
some sed rules, which are probably incomplete, but could be a goiod
starting point) and fix naming styles of interlnal links.
4.) access the Mediawiki via http, authenticate and post the new entries

My idea was to 'post' new entries though it is probaly slower than
directly populating the mysql data base as this allows to populate
Mediawiki without having to know how the internal mysql book keeping
works exactly.

Easy Comma-delimited List To Dropdown Box Converter
I was working on a simple converter when I realized that by not setting the id param of the option tag, it wasn't going to send the value of the dropdown box to my php script. I had this to start with: Code:

Currency
is there any places where i can get som
currency data for free with php ?

Currency
i want to build a script that create US dollar to Philippines Peso.
example:

its auto:  1 USD = "Auto" PHP peso

currency script for this.

Currency
How do I output currency, as the zero on the end of the following value gets cut off:

e.g. £0.50

How do I add a zero, if a zero is expected to appear at the end of the value?

XML Currency Script
I have a table in my database that has 4 different currencies in it (I plan to add more when i have this xml update script done). This has 4 fields, 2 of which are code (eg USD, JPY) and multiplier (USD is taken as 1, and the rest are multiplied from there). Now, I would like to automatically update these currency multipliers using this xml data feed:

"http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"

The only problem is, i dont know where to start with it. Now if anyone could help me either create an array from this data (so i could use $cymulti['USD'] would equal the rate from the data feed that had the currency USD) or create individual variables such as $USD would equal the rate from the data feed for the currency USD).

Currency Formatting
i'm trying to format the output of a record in access, which i am
pulling from through php (odbc) and the formatting is set at 4 decimal
places, which i don't want. i want currency and no decimal places.
I was trying to use this example, but i have no bloody idea howo to use it.
or where to put it for that matter:

<?php

$number = 1234.56;

// let's print the international format for the en_US locale
setlocale(LC_MONETARY, 'en_US');
echo money_format('%i', $number)."
";
// USD 1,234.56

?>

Currency Symbols
I have a problem, we use a microsoft (mssql) product at work which stores currency symbols in the database.

Now when I retrieve these symbols from the database and try to echo them to the screen using php I just get a funny square box symbol instead of the actual currency symbol. Any idea on how I can get the symbols to show correctly?

Currency Rounding
I have the following output from a calculation: 211.5

I want to print this to screen as 211.50 (currency), but the round($value,2) doesn't force a rounding... is it possible?

Format Currency
I want to take a variable and make sure that I output to the browser in dollar format ie if I set $price=100. I want to make sure that $price appears as 100.00. in turn make sure that when $price=100.97 is outputted as 100.97

Format Currency With More Than 2 Decimals
I've tried to use both round and money_format but I can't seem to get what i what.

I have a shopping cart on my web site and I had the tax to the subtotal for calculating the total.

However the following problem arises when using round():
$13.2818
becomes $13.28 (should be $13.29)

$13.2772
becomes $13.28 (works fine)

Is there another function that will ALWAYS round up after X number of decimals?

Numeric Currency To Words
I have a program which calculates some transactions and giving the total as numbers. for eg. 1000.00. I want to display it in words also. Like (One thousand only)..

Clean Currency Input
I wrote the following function as a "cleaner" for a currency input:

function is_currency($v) {
//returns a string with only the numbers for a currency format
$v = str_replace("$", "", $v);
$regex = '/(?:([0-9]+)|.)/'
if(preg_match($regex, trim($v) ) ){
$v = $v + 0.00001;
if (is_float($v)) {
return round($v, 2);
}
}
else {
return 0;
}
}

I want users to be able to put in things like:
NZ$12.34
$12.34
12
12.3456
1,002.23
and it should always translate into a number with two decimals (e.g. 12.34
or 12.00)

I am sure that this is probably the clumsiest way ever to do this. How can
I improve this function?

PS despite numerous efforts I am still super weak on regular expressions. I
can only copy them and not write them myself.

Authorised.NET + Multiple Currency
Has any one integrate Authorised.net with multiple Currency? Example : I want to make transaction for $10 . with different currency types.

Force 2 Decimal Places For Currency
How can I force a value to retain 2 decimal places (or atleast display them)? E.G. force $19.90 to be displayed as such, not $19.9

Language And Currency Changing Script ?
I am asking this on behalf of a friend who is - as I am - completely
ignorant of php. Almost.

He has CartWeaver shopping cart. The php version. He need to be able to
allow users to swap currency and language with a click, but still have
the cart connected to one single and the same data base.

He has been in touch with the developers, and their reply is that the
feature might be included in next version.

Question is: Can he in some way apply this in a way himself with some
link(s) to extra language and currency files? If so, how should it be
done? Are there any samples out there? (we have both searched the web
for a month - in vane).

How Do I Insert And Display Currency In PHP/MySQL?
I have a field in mysql which is a double and I trying to store say $5.00. I'm entering 5.00 but my select statements are returning 5, I need the .00 as well though.

Data Field With Currency Not Sorting Accurately
I have a datatable with a varchar field know as "price". At this time I have 3 rows in it; they are as follows: $ 18,500 $19,500 and $ 9,500. The problem is that when I try to sort in either ascending or descending order; it does not sort right. I know the problem lies in the $ 9,500, because I added a zero in front of the 9,500 (like this: $ 09,500) and it sorted fine. At first I thought it may have had something to do with the dollar sign, but it didn't because I removed and tested it without dollar sign and still had the same problem.

What I want to know is, how I can make datatable sort accurately with putting a zero in front of the 9,500. I tried to use a CSS style to cover up the zero, but when I did that, datatable still would not sort the right way. MySQL code in my web page is accurate, because you can take the $ 9,500 and add a 5 digit number and it works fine.

PAYPAL Problem :- Not Adding The Shipping Amount If Currency Is CHF

I have come up with a problem with PAYPAL integration in my project.
I have choosed the currency as CHF (swiss frank).

I have posted amount and shipping amont properly.

But When It is going to paypal. It is showing only amount ( its not including the shipping amount)

This problem do not occur if i choose currency as USD or CAD or any other.

I have attached the screen shots.

Displaying Currency Exchange Rates On A Page For Product Price
i want to display the price of a product on my site in multiple
currencies that is constantly updated to keep in line with exchange
rate fluctuations can anyone tell me how i could get access to basic
exchange rate data automatically for my site? (just a few major
currencies)

Command-line Php Displays Code Instead Of Executing Code
I am using CLI PHP to run a PHP script, c:wampphpphp.exe, but
instead of executing my script, it's actually displaying the raw code
instead.

How can I run my code using CLI PHP? I installed WAMP5 on WinXP.

Old Code Vs New Code - Language Syntax Change?
I've recently begun programming PHP again and have found my old code doesn't work anymore. It's been a few years since my code was written, and simple functions don't seem to be working. I've done a bit of research into the syntax again and found the following;

I used to use a function as such;

if ($REQUEST_METHOD=="POST") {
Now I've seen alot of the syntax is
if ($_SERVER($REQUEST_METHOD=="POST")) {
And referencing variables from the form is as such;
$_POST['variable']

Where previously I could reference them in the simple form; $variable

Has there been a language syntax change that would cause my old code to be obsolete? Is there a configuration line that could be changed to allow this old code to work?

BB Code - Escape A Bracket In BB Code?
Is there a way to escape a "bracket" in BB code? The beginning of a bbcode
post I made starts with something in brackets [like this]. This causes a
strange thing to happen to the remainder of my post. Removing the brackets
makes my post normal. That shows me that I need to escape the brackets.
However, a simple backslash does not seem to do the trick i.e. this [wont
work]

I am not the administrator of the bb forum, just a poster. So I need to know
what to do on my end (as opposed to an adiministrator's power to
reconfigure, etc.

Translate Perl Code To PHP Code.
Can some one transfer this Perl into PHP? It is from the Spreadsheet-WriteExcel. PHP Code:

Code To Display My Code
I am taking a class in PHP and thought that it would be nice to display
the PHP code that generated my pages when the user clicked a link (or
submit button). I have seen page that will display the underlying HTML
on the page and it would be a nice touch...

Adding Php Code Or To Include A Page With Php Code Into A .tpl Page
how would i do this, i am intergrating a phpbb forum system into my site!

BB Code
i am making my own forums and i've got everything working pretty good except the bb code. i can get the easy ones like bold and emails but ones like 'url=index.php'Test'/url' (' = [ and ]) confuse me. i could get it if it was just url= or just plain url but when it can be either one i can't get it to work right.

How To Add A Pop-up Code To Php
cecho"<script>"
. "function openpopup()"
{
. "var popurl="clip.html""
. "winpops=windows.open(popurl,"",width=640,height=480,toolbar,directories,scrollba rs,"
}
. "</script>"Hi,
ÿ. "</script>"Hi,
s.open(popurl,"",width=640,height=480,toolbar,directories,scrollba rs,"
in.php?op=modules">"._ADDAHOME."</a> ]</center>";

GPS, Zip Code DB
I am searching for a database that I can write a PHP
application against. I am not looking for bulky packages, or anything
fancy or maps, ... just some raw SQL data I can mix & match from
tables, ... stuff like Zip codes, Latitude and Longitude, and any
other basic address & coordinate info. I can cross reference and tie...

SSL Php Code
I am using linux, php and trying to do some ssl code. I want to send some identifier that connects my database to the client browser. I was looking into a secure cookie. I only want the page accessed over a SSL connection. Whats the best way to insure the clinet browser can only see my
page if they are ssl connected to it? In adding a 1 to the end of my send cookie code, it sends the cookie regardless of if they are ssl connected or not.

Zip Code
I have a database of zipcodes with latitude and longitude. I also have the
method of calculating the distance between two zipcodes. What I want to
know is if there is an efficient algorithm for obtaining the zip codes
within a specified distance of the first zipcode without having to retrieve
and calculate for every record in the database.

Zip Code From IP
I found this on the internet in a process of grabbing weather from weather.com and it uses the IP to trace back the closest zip code. It looks up the whois info in arin.net and once, worked correctly. I was wondering if anyone knew why it no longer grabs the correct zip code. I don't want the weather anymore but rather just the zipcode. Code:

Code?
This is straight out of a book I'm reading to learn PHP. I'm thinking
maybe I set either apache or PHP up incorrectly on my computer.
Simpler PHP's snippets work fine so I just don't know. Could someone
look this over and see if I have a problem?

<?php
function printColor($text,
$color="black", &$count=NULL)
{
//print the text with style
print("<span style="color: $color">" .
"$text</span>");

//if given a count, increment it
if(isset($count))
{
$count++;
}
}

//call with one argument
printColor("This is black text");
print("<br>
");

//override default color
printColor("This is blue text", "blue");
print("<br>
");

//pass in count reference
$c = 0;
printColor("This is red text", "red", $c);
print("<br>
");
printColor("This is green text", "green", $c);
print("<br>
");
print("Count: $c<br>");
?>

PHP Bug (or My Bad Code)?
Consider this code:

<?
$mask_n = (pow(2,32) - (pow(2,32-24)-1));
printf("%x
", $mask_n);
?>

On PHP 4.1.2 it prints:

ffffff00

On PHP 4.3.10 is prints:

ffffff01

Both versions of PHP are the standard Debian packaged versions (4.1.2
from Woody, 4.3.10 from Sarge)

tecra# php -v
PHP 4.3.10-9 (cli) (built: Mar 6 2005 17:45:14)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

admin# php -v
4.1.2

Results are (predictably) the same under both the CLI version and under
the Apache module.

Is this a bug in PHP, or is there something broken in my code?

Zip Code
I have this code that returns the distance between two zip codes and will return a radius of zips within so many miles.

I am wanting to add onto this code to have it select from a new table that I have all of the rows of zip codes within that range. This new table would have name, address, zip, ect. Code:

Php Code In A .gif?
I have heard of it being done, But i cant quite figure out how its done. I would like to make a .gif that would maybe have a mail() or something in it.

Add Code To My Code
I have a good file exists code and want to add it to a different file, i tried several times but i get coninual errors. Could someone please help me and paste my code into my full file, i promise to learn from your work. i know it should be simple but im a bigginer to php. Code:

Add Code To Code
how i can add code 1 to code 2 witch is below?what im trying to do is have a banned email code so when some one signs up it will say the email has been banned i have a table in my database with the list of emails that i want banned its called banned_emails and iin the banned emails table its called banned_email that is where the emails are Code:

Run The Code More Than Once...
I am trying to get my code running more than once when a user submits their form.
For example, when a user vists the page called "search", then can enter a number between 1 and 100. Once they hit submit, I want the code to run completely, x amount of times, depending on what the user requests.

BB Code
Can someone give me an example of how the BB Code works?
Basicly I have a page were users add comments... I got all the nessesery options like B I U Image Link, Smiles...
Now when the comment has been posted how can i change all those [B][i][u] :) :-) into html code and images..

BB Code
Im trying to replace certain bits of text that is displayed from the database $fetch->quote to allow BB Codes.

So if they enter into the quote, it will output <center>

Can someone help me please? i have a file that i was told should do it, but i dont see how it works as nothing is assigned to $txt ...

<?
function replace($txt) {

$txt = str_replace(":sup:", "<img src="../images/smiles/thumbsup.gif">", $txt);
return $txt;
?>

Code Obfuscation
I am a PHP developer on a web design company. I was told to protect the PHP code I write obfuscating it. I found a lot of tools for doing that, mostly scripts on websites that work very well.
but the problem is that a medium project can have like 30 or maybe more PHP files. how to maintain consistency between function names that are on other files?

an example. two php files. one of them has a function and the other one calls that function. what if the function name on the two files are different? do it exist any software that can obfuscate several PHP files?

Using Sudo Or Su In Php Code
I am writing an admin page that needs to create a folder on a hosted web server.

Problem:
I had tried using PHP's mkdir() but that created a uid and gid of "apache", which made it impossible to modify, delete or write to from a web page. I have been reading about using "sudo" or "su -root" but have not been able to get it to work.

Question:
How can I use either sudo or su to change the user and group permissions of a folder/file?

My Code:
In the code below, the folder is created and the user/group permissions are set to "apache". But I get no error msgs nor is the user/group changed from/by the passthru cmds.

Export Sql Code
Can I use a php script to move a database from a db on my local machine to a db on a server..

How exactly would it be structured, and what commands would I have to use?

I'm also looking into using mysql to export the code and content from the db on my computer and then import it using phpMyAdmin on the server, but I still havent found out how to do that after searching these forums and reading through the mysql manual.

Code Organization
Is there any article anyone can point me to which talks basically about code organization?

As I add more files, I realise the code can get quite messy and confusing.

How is it that I can organise it better? Other than indention and comments, should I use classes?

How should I break up my files?


Copyright © 2005-08 www.BigResource.com, All rights reserved