I am not very good with MySQL server side scripts. So any help would be awesome! My database info is as follows: - <?php
-
define('DB_HOST', 'pingback.db.5645640.hostedresource.com');
-
define('DB_USER', 'pingback');
-
define('DB_PASSWORD', 'Wind**p1');
-
define('DB_DATABASE', 'pingback');
-
?>
This is how my sql is setup: http://i52.tinypic.com/2lsv19t.jpg
And under ultrapoints is were the points are stored. I don't know if that will help you with the code or not.
Now below is that code I am suppose to use to have my site listen for payment wall to send a pinkback or callback to my site.
Where // Give credits to user I am suppose to make my own code with the database connect thing using the info above... Please help!! - <?php
-
-
define('SECRET', '1b229e***d5f8c***ab5a0ac****');
-
define('CREDIT_TYPE_CHARGEBACK', 2);
-
-
$ipsWhitelist = array(
-
'174.36.92.186',
-
'174.36.96.66',
-
'174.36.92.187',
-
'174.36.92.192',
-
'174.37.14.28'
-
);
-
-
$userId = isset($_GET['uid']) ? $_GET['uid'] : null;
-
$credits = isset($_GET['currency']) ? $_GET['currency'] : null;
-
$type = isset($_GET['type']) ? $_GET['type'] : null;
-
$refId = isset($_GET['ref']) ? $_GET['ref'] : null;
-
$signature = isset($_GET['sig']) ? $_GET['sig'] : null;
-
-
$result = false;
-
-
if (!empty($userId) && !empty($credits) && isset($type) && !empty($refId) && !empty($signature)) {
-
-
$signatureParams = array(
-
'uid' => $userId,
-
'currency' => $credits,
-
'type' => $type,
-
'ref' => $refId
-
);
-
-
$signatureCalculated = generateSignature($signatureParams, SECRET);
-
-
// check if IP is in whitelist and if signature matches
-
if (in_array($_SERVER['REMOTE_ADDR'], $ipsWhitelist) && ($signature == $signatureCalculated)) {
-
-
$result = true;
-
-
if ($type == CREDIT_TYPE_CHARGEBACK) {
-
-
// Deduct credits from user
-
// This is optional, but we recommend this type of crediting to be implemented as well
-
// Note that currency amount sent for chargeback is negative, e.g. -5, so be caferul about the sign
-
// Don’t deduct negative number, otherwise user will get credits instead of losing them
-
-
}
-
else {
-
-
// Give credits to user
-
-
}
-
}
-
}
-
-
if ($result) {
-
echo 'It works';
-
}
-
-
function generateSignature($params, $secret) {
-
$str = '';
-
-
foreach ($params as $k=>$v) {
-
$str .= "$k=$v";
-
}
-
$str .= $secret;
-
-
return md5($str);
-
}
-
?>
1 2973 code green 1,726
Recognized Expert Top Contributor
code help needed
Is not really a question and from the code posted I can't work out what you are trying to do.
So please define the problem and ask a specific question.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Kenneth Illingsworth |
last post by:
I cannot seem to find this in the MYSQL Reference. Are there other places =
I should check? The message text in my log started out with 'You have...'. =
But, it was truncated and I could not see the rest. It occurred on a =
submitted insert statement originating in an application. The insert =
statement works ok directly on the MySQL server. The ODBC connector =
performs its function in the application without any errors.=20
Thanks in...
|
by: Kenneth Illingsworth |
last post by:
--=_603E7359.5B3A569C
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
I suspect that this is some kind of issue with privileges. However, the =
account I am using has been given 'ALL' privileges to the database I am =
trying to insert to. Am I save to assume that ALL includes insert =
privileges?
|
by: Kenneth Illingsworth |
last post by:
--=_603E7359.5B3A569C
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
I suspect that this is some kind of issue with privileges. However, the =
account I am using has been given 'ALL' privileges to the database I am =
trying to insert to. Am I save to assume that ALL includes insert =
privileges?
|
by: tread |
last post by:
Objective:
The primary table I loaded into MySql has 2.5 MM records: ID, Ticker,
Date, Price; and all works well. My need is to write a QUERY to export
outfile?) multiple text files. For example, I have 6 years worth of
data, and need to generate 1 file per day that contains all the Tickers
and Prices for that day. Furthermore, I need the text file name to be
the name of the date (e.g. April 4, 1998 with 1000 Tickers & Prices
would result...
|
by: Shilpa |
last post by:
Hi All,
I need C# code needed to open the windows "Open with" dialog
Regards,
Shilpa
| |
by: bromio |
last post by:
can someone help me to make code for digital clock using AT89S52. The
specs of clock are 12 hour clock,am-pm display,use timer interrupts to
have delay.two external inputs to adjust hours and minutes,use 4 digit
hex display multiplexing.
|
by: ultradiv |
last post by:
I have a VB.NET application partly built that produces an xml output (just a
file at present)
I have a .NET webserver and SQLserver 2000
I need to be able to send the xml to the webserver/database (some crunching
is needed before the data is stored)
The database (stored proc.) will reply with several small pieces of data
which need to be sent back to the client app.
I am thinking that all of this could be accomplished in one call to a...
|
by: manigattani |
last post by:
Please let me know of some java code for converting dbf file to text file
|
by: janetopps |
last post by:
I receive this error in an asp login page. I recently transferred my data from Access to MySQL and have to sort out a few glitches in the code.
I know i need to change the TOP 1 to a limit but i cant get it right. Could someone show me what i need to put in the line of code beginning SQL....
This is the error i get
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
You have an error in your SQL syntax; check the...
|
by: raamay |
last post by:
I want to run the mysql generated dump values of a database through a textarea in php. I am copying the whole dump code in a textarea and then let the php run the entire code. But here the problem is that the unwanted tags or lines like the mysql comments needs to be ignored and only the actual sql queries should run. How do i do it?
May be this is not very clear. Well, i have a database which needs to be updated in every 3 or 6 months for...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |