I'm Running xampp on windows 7 64 bit Proffessionial, I've searched google and everywhere, I just keep finding wanna be form builders that are super lame... I'm trying to host this form for our intranet, ( internal network ).
My question is what do I need to replace in here to get it so it works with local host...
I have and Idea but i think it won't work...
Do i replace this "www.domainname.com" local host? or http://localhost/folder ?
I'm also confused on this part: " fputs($connection, "POST /target_url.php HTTP/1.1\r\n");"
What do i do for the target_url.php?
<?php
//create array of data to be posted
$post_data['firstName'] = 'Name';
$post_data['action'] = 'Register';
//traverse array and prepare data for posting (key1=value1)
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);
//we also need to add a question mark at the beginning of the string
$post_string = '?' . $post_string;
//we are going to need the length of the data string
$data_length = strlen($post_string);
//let's open the connection
$connection = fsockopen('www.domainname.com', 80);
//sending the data
fputs($connection, "POST /target_url.php HTTP/1.1\r\n");
fputs($connection, "Host: www.domainname.com \r\n");
fputs($connection,
"Content-Type: application/x-www-form-urlencoded\r\n");
fputs($connection, "Content-Length: $data_length\r\n");
fputs($connection, "Connection: close\r\n\r\n");
fputs($connection, $post_string);
//closing the connection
fclose($connection);
?>
I'm making a form in dreamwaver, but i need the user to be able to fill out the form, hit submit, then the data gets submitted to the database, and an admin can look up the results, through another page or the database its self.