/    Sign up×
Community /Pin to ProfileBookmark

form to access db via unix machine (and windows?)

I have a form that must sit on a unix server for security reasons. I have a windows server I can use as well but not as secure. As an end result I want the values from the form to be put into an access database and emailed. I know php and asp.
Does anyone have any idea how I can possibly post the fields to a php form that maybe can redirect to an asp script on a windows server and still keep the security? One important thing to keep in mind is one of the fields can be very long. (pages in length). I don’t want the user to be able to track or know about the windows server?

Please advise?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@crh3675Apr 14.2004 — Do a silent POST using cURL to the Windows server.

http://us4.php.net/curl
Copy linkTweet thisAlerts:
@estheraauthorApr 14.2004 — Is there anyway to do this where I don't have to install anything on the server? Any other ways?
Copy linkTweet thisAlerts:
@crh3675Apr 15.2004 — <i>
</i>&lt;?php
$host = "www.nerds.net"; // do not include HTTP
$file="/index.php";
$port = 80;

//#######################
// Setup your POST variables here where
// "field" is your field name and of course,
// "value" is your field value
//#######################

$formdata = array (
"field1" =&gt; "value",
"field2" =&gt; "value2",
"field3" =&gt; "value3",
"field4" =&gt; "value4"
);

foreach($formdata AS $key =&gt; $val){
$poststring.=$poststring!="" ? "&amp;":"";
$poststring .= urlencode($key) . "=" . urlencode($val) ;
}

$fp = fsockopen($host, $port, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)&lt;br /&gt;n";
} else {
$out = "POST $file HTTP/1.1rn";
$out.= "Host: $hostrn";
$out.= "Content-type: application/x-www-form-urlencodedrn";
$out.= "Content-length: ".strlen($poststring)."rn";
$out.= "Connection: Closernrn";
$out.=$poststring."rnrn";

fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}



?&gt;
×

Success!

Help @esthera spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...