Jump to content

connecting to external host


sethupathy

Recommended Posts

I am new to php so bear with me

 

I have made my web form but my host is external i have two files one the form.php and connect.php on submit

 

how do i make a request in my form.php to connect to my host on submit?

 

do i have to inject php in my form.php how would the scrpit look like ???

 

It could be a silly question but i would love to get this done asap.  :-\

 

Thank you

 

 

Link to comment
https://forums.phpfreaks.com/topic/54835-connecting-to-external-host/
Share on other sites

you want this right...

 

 

Website A: have form.php, connect.php

 

Website B: has sql server?

 

you need to have a connection from Website A to Website B. You can set up a connection if your using mysql server, you need to create a user on Website B, with recognizing IP/host address from Website A, make a script that will connect the Website B to Website A, then create a script that will insert the info from the form into the database...

 

I'm an old programmer, I'd sketch this for you, but I'm kind of rusty. =)

Thanks for the link

 

if i use this script in my form.php would my extarnal server user and password be visible to anyone

 

wouls it have any security flaw to the localhost?

 

<?php

 

$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');

if (!$link) {

    die('Not connected : ' . mysql_error());

}

 

// make foo the current db

$db_selected = mysql_select_db('foo', $link);

if (!$db_selected) {

    die ('Can\'t use foo : ' . mysql_error());

}

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.