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




Authorize.net AIM Connection


Has anyone else connected using the AIM method yet? Code snippets would help me see the error of my ways.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
PHP And Authorize.net
Has anyone here on the forum ever integrated a php based site with authorize.net? I am having a particular problem with user redirection after the information is submitted to the authorize gateway. I cannot get the site to redirect to my thank you page.

PHP, Authorize.net, SIM Or AIM
has anyone successfully set up there php pages to work w/ authorize.net's new integration methods? i am attempting to use the SIM method but i get a mhash error:

Fatal error: Call to undefined function: mhash() in . and i'm using the php scripts they provided.

Authorize.net
I am trying to set up transactions to the authoize.net payment gateway. After running a test transaction I get this error back: Error with Transaction:
SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

I do not have an SSL umbrella over this page. Is their anything I could put in my code that might would overive this?

Authorize.net Without Curl
I'm setting up scripts to use the AIM method of Authorize.net to process credit cards, but I can't find any examples that don't use curl. Is there any way to do it without curl?

Shouldn't I be able to just set the transaction.dll as the action in a form? But then how do I get the response?

Integration Method Authorize.net
Have anyone use the simple integration method to link a post action to a form using Authorize.net

Authorize.net And Curl Problem
Getting a bit fuzzy on the Authorize.net and the Curl Integration.

I have the script using the for the authorize.net Integration
with the curl command
exec("/usr/local/bin -m 120 -d "$data" $authnet_url",
$return_string);

well the curl path is right /usr/local/bin/
The curl is installed wiht the ssl support
The values passed are also very right .

But yet i am not getting the response from the authorize.net

I tried using the complete string onto the command line on the SSH
access.
The response I got was only that the problem in the syntax.

Well I have a keen notion that the problem does exists in the Curl
installation with some more support or features.

Interfacing To Authorize.net Using AIM Method And CURL
I have a small PHP ecommerce site set up using Authorize.net's SIM (simple)
interface. Working fine, but... I'd like to implement their AIM interface
(so visitor's will never see the gateway's URL).

I found a script that does this but requires cURL... and my hosting provider
doesn't support it.

Here is the snippet of the code that uses cURL functions ($data values are
set before this from the purchase form):

$curl_handle = curl_init ();
curl_setopt ($curl_handle, CURLOPT_URL,
"https://secure.authorize.net/gateway/transact.dll");
curl_setopt ($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($curl_handle, CURLOPT_POST, 1);
curl_setopt ($curl_handle, CURLOPT_POSTFIELDS, $data);
$response = curl_exec ($curl_handle) or die ("There has been an error
connecting to Authorize.net.");
curl_close ($curl_handle);

It appears that data is being posted to the gateway and information returned
(credit card accepted/declined) and then processed without actual web pages
being displayed.

What is cURL actually doing and can it be done some other way?

Is there any way I can accomplish the same thing without curl libraries...
maybe write my own lower level code? I can certainly post data to the
gateway... and, if I knew how to accept the returned data, can perform the
necessary steps from there. My big blank spot seems to be how to receive
that data response.

DB Connection Handling - I Get "too Many Connection" - What's The Solution?
I have a php-webpage that needs the database in the beginning and in
the end of the script. In the middle there is a lot of processing that
takes several seconds - during that time I don't use the database
connection.

What is the best approach? Should I close the connection after I'm
done with it OR should I reuse the connection thru my whole script?

Where can I read more about this? Any pointers?

Today I'm using the same connection thru my script. And sometimes I
get an error from the database "too many connections". What does that
mean? My webserver provider says that I have at least 100 connections
to play with. How come I get this error?

Raw SSL Connection
I need to send (not post, just send) some string to an SSL server. This is nog a SSL enabled webserver, but a pure SSL-server wich doensn't understand HTTP. Therefor I think I need to make a SSL socket connection and fwrite() the string to the socket. The SSL-server performs certificate authorisation, so I need to send my certificate and private key with the string.
As far as I understand, PHP can't to this so I need to perform the ssl handshake myself with some openssl functions, then ssl encrypt the string with another openssl function, send it to the socket... read the response, decrypt it, and process this further?

Does anyone have a clue how to do this?
cURL is not an option since cURL, as far as I know, only talks HTTP over a wide range of protocols.

I've been messing with 'openssl s_client' but after the SSL handshaking completes the connection is closed and I am unable to send a message.

Php Sql Connection
i get this error when trying to use php to add something into the database, i thought Php wasnt compiled correctly but i am using phpMyAdmin so surely that uses mysql_connect!! and that works fine. I am using a cobalt raq4 if that has anything to do with it!
Error i get!

Fatal error: Call to undefined function: mysql_connect() in /home/sites/site20/web/vb/confadd.php on line 2 Code:

<?php
mysql_connect ('localhost','username','password');
mysql_select_db ('database');
$result=mysql_query("INSERT INTO table (accesscode,referee,username,password) VALUES ('$accesscode','$referee','$newuser','$password')");
echo ("User has been added");?>

Which Connection Is Best?
I started with php and mysql and i discovered three methods for connecting
to a database:


$conn="DRIVER={MySQL ODBC 3.51 DRIVER};SERVER=10.0.0.181;DATABASE=reserv";
$connect=odbc_connect($conn,'root','pw');

include('/inetpub/wwwroot/resphpaccess/adodb/adodb.inc.php');
$db = &ADONewConnection('mysql');
$db->Connect('localhost', 'root', 'pw', 'reserv');

$link = mysql_connect("localhost", "mysql_user", "mysql_password")
or die("Impossible de se connecter : " . mysql_error());


Which one is the best and why?
What are the pro/contras for each?

Connection To An Outside Db
Can we connect to a database(mySQL) using php, on another site. IE:  siteOne.co.uk runs some script that can connect to siteTwo.co.uk mysql database, therefore looking as its got is own etc? Any ideas or a straight NO.

I did mention about running a php to xml page that reads the db and converts it to an xml page and then it can get the data from there with absolute path etc ?

Database Connection ?
I am very new to PHP...Can i get the starting code for connecting to database....how to open the connection...what is the connectionstring ?

Oracle Connection
I am running a PHP script on unix. I am trying to connect to Oracle database. Before i start using the functions like Ora_Logon etc, what steps do i have to take in order to make PHP talk to Oracle database?

Microsoft SQL Connection
I am looking to have a php page that will have a required include of a
config file with the MS SQL connection creation. I want to have a form
that saves into a MS SQL database. Could call out to a stored
procedure or have inline code in the php page.

Anyone have examples or generic sample code I can use?

I Need A Universal Connection
I am interested in developing a web application to which I can attach any of db
like mysql,access,sql server,oracle ... as it is there in most of projects where during the installation we select any of optional db.

how to write such a code which can work with all of databases.

Db Connection Issues
The pages I have are template driven and they seem to work until I try and connect to the MySql db - then the pages don't want to display properly. I am sure it is some error in the way I am coding it. code:

Connection Errors ?
host -{ The server }- is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'

anyone know why this message show up allot of times and goes away only after restarting mysql and apache ? is there a other way if fixing this ?

SQL Anywhere 5.5 Odbc Connection
Is possible connect to database SQL Anywhere 5.5 started by
rtdsk50.exe from php using odbc?

I have error : Unable to connect to database server: unable to start
database engine, SQL state 08001.

I can connect to database using the same data source from MS Access.

Best Way To Set DB Connection Settings
I was wondering what is the best way to code the DB connection settings, by settings I mean the username/password and DB name. Right now I'm doing it in every php file that talks to the MySQL DB, but I think it may not be a good idea. How do you guys do it? like call it from a central file or something?

Remote DSN Connection
I am trying to set up a website to connect to an SQL Anywhere database located on a remote machine.

The webserver is located on a linux server, while the database is running on a windows machine on the local network.

How can I connect to this remote database, and what ports will I have to enable access to through the firewall?

Connection Pooling In PHP?
Is that when using pconnect to mysql, it is already mean connection
pooling?

Open Db Connection
I'm trying to close unnecessary db connection to reduce the concurrent
connection. Is there any way I can find the open connection?

PHP SSH And Mysql Connection
For a long time I've been trying to connect to mysql through a SSH tunnel. Although that si possible by setting up the tunnel manually (with 'ssh -L ...'), I'd like it to be done by PHP itself.

Now, with the SSH2 extension (http://www.php.net/manual/en/ref.ssh2.php) it is possible to issue a 'ssh2_connect' and then a 'ssh2_tunnel' command.
That returns a socket resource to the destination server.
So far, all fine.

Problem:
How can I force that socket onto 'mysql_connect'?
I mean, what I have is:
$tunnel = ssh2_tunnel($connection, &#3910;.0.0.101', 12345);

But $tunnel is a PHP resource, and not in the format ':/path/to/socket' that mysql_connect expects...

Is this possible at all?

Sybase Connection
This is the first time I need to connect via PHP to a Sybase DB.
I'm working with PHP5 and Apache 2 under WinXP... no problem
connecting with Mysql...
I enabled in php.ini the correct dll: "php_sybase_ct.dll" but when I
restart Apache got this error:

PHP Startup: Unable to load dynamic library 'c:phpphp_sybase_ct.dll'
- Can't find the specified module

I read that the library needs Sybase DLL: on my PC I installed the
whole Sybase SQL Studio 8 (it works fine) but no result... the
php_sybase_ct.dll is in the same dir as the other DLLs (c:php) and
Sybase is in c:programssybase...

JDBC Connection
Can PHP connect via JDBC?

Connection Pool
Is anyone aware of a means of connection pooling (to MySQL, say) in php?

Database Connection
<?php

I have a question about 2 connection strings to a ms sql database.

# TEST DATABASE

$connecttest = MSSQL_CONNECT("TEST", "sa", "123456") or exit("Unable to
connect to MS SQL Server at 10.0.10.58");

$select = mssql_select_db ("database1",$connecttest) or exit("Unable to
select database TEST");

# PRODUCTION DATABASE

$connectprod = MSSQL_CONNECT("PROD", "sa", "654321") or exit("Unable to
connect to database at 10.0.10.59");

$select = mssql_select_db ("database2",$connectprod) or exit("Unable to
select database PROD");

$SQL = "SELECT * FROM table1";

$RESULT = mssql_query($SQL);

// What data will i find here? Is it data from the TEST or from PROD and
will it be data from database1 or from database 2?

?>

Dsn Less Connection With Access Db
Can anyone give me an example how to make an dsn less connection with an Access database and Php.

ODBC Connection
I tried to make an ODBC connection through PHP Page but every time the
error is genereted. The data from the page is stored in My sql database
but i couldn't get that using DSN connection in my .mdb file. I am
using this string to get the database in my .mdb file. If there is any
error i want that to be corrected.

<?

$email=$_POST['newsletter'];
$cn=odbc_connect("adim","","")or die("Counld not connect to server");
$sql="insert into test(email) values('$email')";
$rs=odbc_exec($cn,$sql) or die("Could not execute the s query");
if($rs==true)
{
print("Record Added Sucessfully");
}
else
{
print("Error on Page");
}

?>

Persistent Connection
For each page on my site I have to open a database connection to retrieve data. I have only one database. For this specific situation do you think is better to use a persitent connection (mysql_pconnect) instead of mysql_connect?

Connection Pooling In PHP ?
I apologize if any of my questions appear daft or
obvious ...

Does PHP (or maybe the web server - Apache in my case), support
(database) connection pooling?. It seems terribly inefficient if every
request for data wil incurr the overhead of creating a connection to the
db.

While on the subject of pooling - does any one know (when using PHP in
"server side scripting") if scripts are launched as seperate processes
or if they are spawned as threads in a thread pool of a master process?
(pref the latter since it is less "expensive" in computer resource terms)

MySql Connection
Is it necessary to close a db connection at the end of a session?? Or does it autoclose?

PHP Connection Pool
I'm doing a php application using PEAR.DB for connecting to an Oracle
Database server. Does anyone knows about a php connection pool
implementation I could use?.

PHP-SQL Connection Failure.
I had PHP installed on as CGI on a Window 2000 Server and connected to
an MSSQL 2000 on another server. Both server were upgraded to Windows
Server 2003 and problems developed that I could no longer run PHP any
more.

What I did next was to uninstall PHP and re-installed it as ISAPI, and
make necessary configurations in Windows Server 2003. PHP seems to
work fine now on my applications are having problem connection to
MSSQL. One thing to note here is that I am using the old php.ini as it
has been adapted to the application.

The problem has to do with connection failure as shown below:

Warning: mssql_pconnect(): Unable to connect to server: ServerName in
c:InetpubwwwrootApplicationDiradodbdriversad odb-mssql.inc.php on
line 327

Warning: error_log(c:/Application_temp/errors.log): failed to open
stream: Permission denied in
c:InetpubwwwrootApplicationDiradodbadodb-errorhandler.inc.php on
line 68

Fatal error: mssql error: [: Connection error to server
'ServerName,SQLUserName,PWD,Database' with user ''] in
PCONNECT(ServerName,SQLUserName,PWD,Database, '****', '****', ) in
c:InetpubwwwrootApplicationDiradodbadodb-errorhandler.inc.php on
line 75

Is there any changes I need to make in php.ini regarding ISAPI
installation.
I am working with PHP4

Smtp Connection
I am having difficulty connection to an smtp host. I am using the
following code but I don't think I fully understand what smtp host can
be used.

function setSMTPParams($host = null, $port = null, $helo = null, $auth
= null, $user = null, $pass = null)
{
if (!is_null($host)) $this->smtp_params['host'] = $host;
if (!is_null($port)) $this->smtp_params['port'] = $port;
if (!is_null($helo)) $this->smtp_params['helo'] = $helo;
if (!is_null($auth)) $this->smtp_params['auth'] = $auth;
if (!is_null($user)) $this->smtp_params['user'] = $user;
if (!is_null($pass)) $this->smtp_params['pass'] = $pass;
}

I don't fully understand that the $helo parameter is needed for.

Should I be able to access any smtp host which I own. I have two ISP
account and each have an smtp service. I use them for email. I notice
I can only use the smtp service associated with the ISP I am currently
connected to. Is that a common restriction which is the same reason I
am prevented from accessing the service from my php script?

Maybe the question I should this. What type of smtp account do I need
in order to send an email from my php script?

Connection From One Page To Another
I have a class that is my interface to mysql. I create an instance og
class an connect to db. Then i change to another page and want to use
the same instace of class. How can i send an object (the instance) to
another page ?

PHP Class Connection
I keep getting a:

mysql_fetch_array(): supplied argument is not a valid MySQL...

this is my class connection

<?php

class cDatabase {

//class variables defined in constructor
var $host;
var $user;
var $password;
var $databaseName;

//constructor - needed for connection string
function cDatabase($hostName, $userName, $passwordName,
$databaseName){
$this->host = $hostName;
$this->user = $userName;
$this->password = $passwordName;
$this->database = $databaseName;
}

//execute a query
function ExecuteNonQuery($sql){
$conn = mysql_connect($this->host, $this->user, $this->password);
mysql_select_db ($this->database);

$rs = @mysql_query($sql);
settype($rs, "null");
mysql_close($conn);
}

}

?>

and this is the page

<?php

include "dbclass.php";

$cDB = new cDatabase(host, user, password, database);

// test select query
$rs = $cDB->ExecuteNonQuery("Select event from na_events");

while ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) {
echo $row['event'];
}

// kill our objects
settype($rs, "null");
settype($cDB, "null");

?>

Connection Pooling In PHP
is that pconnect() to mysql mean connection pooling already?

Connection To Database
Running RH8 and have installed mysql, apache, php. I have pypmyadmin working fine, adding and editing databases.. but when I try to get a form (to enter data) its does not connect or just sumbits as if all was ok but nothing happend.

'Too Many Connection' Discussions
I'd read other people's posts in this area, but none has a solution to this problem. I'm hoping that someone would be able to help me with it.

I'm using mysql_pcconnect (persistent) and after like 6-7 reloads I get an error msg saying 'too many connection' or such. Now is there a way that I can explicitely close the connection at the end of the script for mysql_pcconnect so this wouldn't happen again? I'm using a web hosting service so I can't change the settings in mySQL.

SMS Sending By SSL Connection
I would like to conect to a server by a SSL Conection,
to send an SMS.
The company that offers the SMS service provided some Code for a http
connection, but not for a https connection.

Here is the code to send an SMS by http, which works great.

<?
$user = "user";
$password = "password";
$api_id = "xxxx";
$baseurl ="http://api.clickatell.com";
$text = urlencode("This is an example message");
$to = "0123456789";
// auth call
$url = "$baseurl/http/auth?user=$user&password=$password&api_id=$api_id";
// do auth call
$ret = file($url);
// split our response. return string is on first line of the data
returned
$sess = split(":",$ret[0]);
if ($sess[0] == "OK") {
$sess_id = trim($sess[1]); // remove any whitespace
$url = "$baseurl/http/sendmsg?session_id=$sess_id&to=$to&text=$text";
// do sendmsg call
$ret = file($url);
$send = split(":",$ret[0]);
if ($send[0] == "ID")
echo "success<br>message ID: ". $send[1];
else
echo "send message failed";
} else {
echo "Authentication failure: ". $ret[0];
exit();
}
?>

Connection Spamage
I have a login script, and recently someone made a script in VB that tries to login 1000s of times. This has the problem of opening 1000s of connections to my MYSQL db. Any ideas how I can block this without a script check?

Kill Connection?
how I can make php instantly close and not even send a response header so that a browser trying to connect will get error saying cannot connect to server?

Getting Same Mysql Connection With Php?
I have a database class i made however when i create 2 instances of it, it gives me the same connect resource id, is that normal?  is there a way in php to have different resource connection id but connect to the same database with the same login on the same server?

Passing Through Connection
// English is not my mother tongue, please don't mind my spellings mistakes!

Problem situation: We need to design a project at school with PHP and a PostgreSQL database with two people.

Because the lack of an individual user created for each group we need to use our own login and password to connect to the database.

This means that one of the two members of the group need to type his password plaintext into a PHP file, while the other person can read it.

My solution: I made a php file (database.php) that asks for the login and password, and uses them connecting to the database and stores them into the session-variables. When there is no sessionvariable there pops up a login form. Once succesfull logged in the code of the website generates normally.

<?php
session_start()
include("database.php");
$conn = makeConnection("database2TX31");
...
function userExists($name){
 global $conn;
...
}

function htmlOut(){
 echo "</div>";
showLogoutLink();
        echo "
</body>
</html>"; 
}
... 
?>

Now I want the people in my class to use it also. But i'm having a problem.
If someone redesigns a php file that looks like my database.php file, it 'could' store my password if I want to connect to their website.

So if my teacher could put this file on her own webspace it is ensured that the passwords are not logged into a file or something, that the code is clean. But how do I can verify that the file that is included really is located in my teachers webspace?

Sessions And DB Connection Pointers
Are there any inherant problems with storing database connection pointers as session variables?

For instance, what's the downside (if any) to using this:

$_SESSION[db] = mysql_connect (host,pass,user);

rather than:

$db = mysql_connect (host,pass,user);

?

I'm just getting tired of forgetting to include my DB pointer as a global in a function, and I would like to use a session variable for this to save me some headaches, but my initial test failed. So I don't know if this is even possible.

SQL Server... Trusted Connection? Help...
I show MS SQL support when I issue PHP info, and I have a test table with testinfo in it... But, when using a connection test routine, I get the following error:

Warning: MS SQL message: Login failed for user 'hhalstead'. Reason: Not associated with a trusted SQL Server connection. (severity 14) in D:HMWebhmmtdb.php on line 12


here is the connect code I am using:

<pre>
<?
// YOUR MSSQL 7.0 SERVER PARAMETERS
$hostname = "xxx.xxx.xxx.xxx";
$username = "hhalstead";
$password = "xxxxxxxxxx";

// YOUR MSSQL 7.0 DATABASE
$dbname = "mydb";
$tablename = "mytable" ;

// CONNECT TO THE MSSQL 7.0 DATABASE
$connection = mssql_connect($hostname,$username,$password);
mssql_select_db($dbname);
$sql_query = "select * from $tablename" ;
$query_result =mssql_query($sql_query) ;
$number_rows = mssql_num_rows($query_result) ;
$number_fields = mssql_num_fields($query_result) ;
?>
</pre>

Mysql Connection Problem
On one computer with win98 and apache 13.22+mysql+php and the dynamic server is www.xxx.dns2go.com. All running fine.

1. I tried the code( from DevShed ):

<?
$dbuser = 'name'
$dbhost = 'localhost'
$dbpass =' password'
$dbname = 'auth'
$dbtble = 'auth'
$mysql_link = mysql_connect($dbhost,$dbuser,$dbpass);
$column = mysql_list_fields($dbname,$dbtble,$mysql_link);
for($i=0; $i< mysql_num_fields($column); $i++ )
{
print mysql_field_name($column,$i )."<br>";
}
?>

This code worked fine.

2. If I replace 'localhost' with the server name, I got the error message:

Warning: Can't connect to MySQL server on 'www.xxx.dns2go.com' (10061) in d:homewebmasterpubhtm est_mysql2.php on line 13

Warning: MySQL Connection Failed: Can't connect to MySQL server on 'www.xxx.dns2go.com' (10061) in d:homewebmasterpubhtm est_mysql2.php on line 13

Warning: Supplied argument is not a valid MySQL-Link resource in d:homewebmasterpubhtm est_mysql2.php on line 15

Warning: Supplied argument is not a valid MySQL result resource in d:homewebmasterpubhtm est_mysql2.php on line 17

I tried to test from another machine. Also tried to look at the port but did not seem to work.


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