Okay folks, lets beat this dead horse a little harder, because i'm not getting it...
I am attempting to post to the following website:
http://www.eslteachersboard.com/cgi-bin/esljobs/index.pl?form=0
Which, for those of you who don't want to view the page source, it has the following form:
<FORM ENCTYPE="multipart/form-data" METHOD=POST ACTION="http://www.eslteachersboard.com/cgi-bin/esljobs/index.pl?post" NAME="message" TARGET="_self">
<INPUT TYPE=TEXT NAME="name" SIZE=40 MAXLENGTH=100>
<INPUT TYPE=TEXT NAME="email" SIZE=40 MAXLENGTH=100>
<INPUT ....> // A FEW MORE OF THESE TYPE
//ONE OF THE FOLLOWING TYPE
<TEXTAREA COLS=80 ROWS=20 NAME="body" WRAP=VIRTUAL></TEXTAREA>
//A COUPLE OF THE FOLLOWING
<INPUT TYPE=SUBMIT NAME="Preview" VALUE="Preview your Job Offer">
<INPUT TYPE=SUBMIT NAME="Post" VALUE="Post your Job Offer">
//AND THATS ALL!
</FORM>
What I am attempting to do, is to post to this form/website with data from my website.
I am trying to do this with the following code:
<?php
...
$query="SELECT * FROM mark WHERE jobid = $jobid";
$result=mysql_query($query);
printf("Job Preview:");
echo "<br>--------------------------------<br>";
$id=mysql_result($result,$i,"jobid");
$name=mysql_result($result,$i,"company");
$email=mysql_result($result,$i,"email");
$location=mysql_result($result, $i, location");
$desc=mysql_result($result,$i,"description");
$url=mysql_result($result,$i, "url");
echo "<br>$id<br>$name<br>$email<br>$location<br>$desc<br>$url<br>";
/* Post data to website */
$ch = curl_init();
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_URL, "http://www.eslteachersboard.com/cgi-bin/esljobs/index.pl?post");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "name=$name&email=$email&subject=$location&body=$desc&url=$url");
curl_exec ($ch);
curl_close ($ch);
echo"<br> Completed CURL <br><br>";
...
?>
This code works on 'test' websites i have set up with the ENCTYPE=application/x-www-form-urlencoded with no problems.
When i try to post the EXACT same to the ESL Job Board mentioned at the top of this discussion, and i allow the CURL code to follow the result, I see that NONE OF THE VARIALBES are being passed and the POST obviously fails (due to the error message i get - "you didn't fill in the name, email, etc...")
I know this question has been asked a billion times on phpbuilder, but i haven't seen the formal answer i am looking for.
Additional information:
1. I am not attempting to upload a file, only variables
2. The form type=multipart/form-data and this is unchangable by me
3. I am running off of the following (steadfast networks) virtual servers
Apache: 1.3.34
Perl: 5.8.0
PHP: 4.4.1
MySQL: 4.0.26
PostgreSQL: 7.4.11
I would appricated any help in solving this problem, as this is the last step to get my website/php working!! THANKS IN ADVANCE,