PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
It is currently Wed Sep 30, 2020 9:03 pm

All times are UTC - 5 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Jul 21, 2014 1:50 pm 
Forum Newbie

Joined: Sat Jul 19, 2014 3:01 pm
Posts: 2
Hello everyone,

I need some help with what I see in my mind as a somehow simple code.
I have an extension on Joomla, called EShop, and what I want to do is, when a customer from one geozone(preset) buys something via our cart, he pays through one PayPal account, and when a customer from another geozone buys something, it redirects its payment to another PP account.

So, lets say customer 1 is from the US, 1st geozone, and customer 2 from, lets say, Spain, 2nd geozone.
Customer 1 buys a product and pays on PayPal acc #1, customer 2 buys the same product, but pays on PayPal acc #2.

Is it possible?
In my head it is, but I got very rusty during time with programming so I need major help :D I could even pay if needed to write the code.(I would need the whole code working, can't write anything by myself -.-)

Here is the begining fo the code that might work:
Use a variable for your PayPal account and populate the variable based on the payee's location.
Syntax: [ Download ] [ Hide ]
$paypal_account = ($payee_zone == 2) ? $account2 : $account1;
<form action="">
        <input name="business" value="<?= $paypal_account; ?>">

Kind regards and thank you in advance!

PostPosted: Tue Jul 22, 2014 10:14 am 
Forum Newbie

Joined: Tue Jul 22, 2014 9:57 am
Posts: 1 ... jex/ip.sql
Just save the file in your database

The following script outputs the full country name of the current visitor.
so in your php script paypal account

its recommended to use destructor and constructor as well as check $servername to avoid xxs - goodluck ^^

just add
if ($countryName === "united states") {print "uspaypalaccountus"}
elseif ($countryName === "spain") {print "uspaypalaccountspain"}


$server = ''; // MySQL hostname
$username = ''; // MySQL username
$password = ''; // MySQL password
$dbname = ''; // MySQL db name

$db = mysql_connect($server, $username, $password) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$sql = 'SELECT
ip2nationCountries c,
ip2nation i
c.code =
i.ip DESC
LIMIT 0,1';

list($countryName) = mysql_fetch_row(mysql_query($sql));

// Output full country name
echo $countryName;


resource/info -

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours

Who is online

Users browsing this forum: Google [Bot] and 28 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group