Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Connecting a different computer with a cgi-script
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 .= ")";
print h1 em center ("Gebruiker $naam te $woonplaats is succelsvol toegevoegd");
# Disconnect from the database
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!
0 · ·