Delphi communication application

Hello experts!
Please help me.

I have a website (hosting soft : ruby,php,perl).
I need to create a application that communicates with site. Sure, site may have a script or file.

Program must send requests to server.
For example : When the remote PC is up, and application running, it will send a request and server will understand that the host is up.
Can someone suggest me what kind of script or CMS or ruby app i need to install on site?
Please help.
helyonprime96Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

babbloCommented:
Hello helyonprime96, you can send the information simply making a POST over a php file located at the server, or you can send a JSON, etc.

On client side (Delphi APP), try using Indy HTTP client to send the POST.

On server side (PHP) simply "catch" the information inside $_POST variable.

Tell me if you need something else.




0
jimyXCommented:
I have come through a similar requirement. You may have a look at this PAQ by Mahdi78 which shows a communication between Delphi and php:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/Q_25734113.html
0
helyonprime96Author Commented:
babblo:
hello and thanks for you suggestion.

i think so. can you help me to make a php file that listen posts from application.
application will post something like this : www.site.com/engine.php?status=up&host=.....

and i want that another file imports the stats from engine.php (for example)
help me,please
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

babbloCommented:
Please tell me where you want to save the received information. (DB? File?...)
0
helyonprime96Author Commented:
yes.
i have mysql db.
sorry for delay.
please help me with this php file.thanks
0
babbloCommented:
Use the basic code below, just take care of sanitize $_GET['XXX'] variables before the insert.

Hope this help.
<?php
if (!empty($_GET)){
	$sql = 'INSERT INTO table_name (`status`, `host`) VALUES ("'.$_GET['status'].'", "'.$_GET['host'].'")';
	mysql_query($sql);
}
?>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
helyonprime96Author Commented:
ok. thanks
but i want to see results in a separated php file.
and tell me what is the link to post.
thanks
0
babbloCommented:
Ok..

In your Delphi App, do a GET request to this: (the code I sended)

http://www.yourdomain.com/log.php?host=XXXX&status=YY

Where:

XXXX = A string variable with the host name
YY = A string variable with the status (UP / DOWN)

Then, to see the "log", create a new file with this code:




<?php
$sql = 'SELECT * FROM table_name';
$res = mysql_query($sql);
if ($row = mysql_fetch_assoc($res)){
  do{
    echo 'Host: '.$row['host'].' <br/>';
    echo 'Status: '.$row['status'].' <br/><br/>';
  }while($row = mysql_fetch_assoc($res));
}else{
  echo 'Nothing yet...';
}

?>

Then, go to www.yourdomain.com/thefile.php and you are ready :)

Open in new window

0
babbloCommented:
Btw, if you need want more professional or with a better look, please tell me and I can send you a quote for the complete job.

Have a nice day!
0
helyonprime96Author Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.