Connecting a different computer with a cgi-script

Hi there,

I want that remote computer "a" connects to remote computer "b" and that computer "a" stores data from a form in the database at computer "b". So computer "a" has to "talk" with computer "b".

This I can not solve on my own.I know php but at my work they decided to try cgi-scripts.
Below there is a example how far i got:
xxx.xxx.xxx.xxx should be the IP adres from computer "b"
{

$dsn = "DBI:hostname=xxx.xxx.xxx.xxx;dsn=DBI:(mydatabasename)"
$dbh = DBI->connect ($dsn, "username", "password");

$username = param ("username");
$password = param ("password");
$naam = param ("naam");
$adres = param ("adres");
$postcode = param ("postcode");
$woonplaat = param ("woonplaats");
$telefoonnummer = param ("telefoonnummer");
$email = param ("email");

$sql = "INSERT INTO mytablename (username, password, naam, adres, postcode, woonplaats, telefoonnummer, email) VALUES (";
$sql .= $dbh->quote($username) . ",";
$sql .= $dbh->quote($password) . ",";
$sql .= $dbh->quote($naam) . ",";
$sql .= $dbh->quote($adres) . ",";
$sql .= $dbh->quote($postcode) . ",";
$sql .= $dbh->quote($woonplaats) . ",";
$sql .= $dbh->quote($telefoonnummer) . ",";
$sql .= $dbh->quote($email); $sql .= ")";

$dbh->do ($sql);

print h1 em center ("Gebruiker $naam te $woonplaats is succelsvol toegevoegd");
print hr;

# Disconnect from the database
$dbh->disconnect;
}

We have no proxy server running als we do not have an ODBC running.
Database server is an MYSQL.

I really hope someone can help me with this. I really need your help!

Much thanks!

Peter Bras.
The Netherlands


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories