Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 292745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:12:30+00:00 2026-05-12T06:12:30+00:00

I’ll keep this nice and short. I’m trying to post a value to a

  • 0

I’ll keep this nice and short.

I’m trying to post a value to a remote form.

This code is working perfectly:

$url = "http://eirestudio.net/blog/"; // URL to POST FORM.

$post_fields = "s=test"; 

$ch = curl_init(); // Initialize a CURL session.
curl_setopt($ch, CURLOPT_URL, $url); // Pass URL as parameter.
curl_setopt($ch, CURLOPT_POST, 1); // use this option to Post a form
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields); // Pass form Fields.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Return Page contents.
$result = curl_exec($ch); // grab URL and pass it to the variable.
curl_close($ch); // close curl resource, and free up system resources.
echo $result; // Print page contents.

But when I test it out on another domain it fails:

$url = "http://jobbank.fas.ie/servlet/Watis?SESS=50306_1&TEMPLATE=WWW_JS_VAC_TEXTSEARCH.HTM&BACK=TEMPLATE%3DWWW_JS_VAC.HTM"; // URL to POST FORM.

$post_fields = "TEXTSEARCH.JOBNAME=$search"; //

$ch = curl_init(); // Initialize a CURL session.
curl_setopt($ch, CURLOPT_URL, $url); // Pass URL as parameter.
curl_setopt($ch, CURLOPT_POST, 1); // use this option to Post a form
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields); // Pass form Fields.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Return Page contents.
$result = curl_exec($ch); // grab URL and pass it to the variable.
curl_close($ch); // close curl resource, and free up system resources.
echo $result; // Print page contents.

Can you spot anything wrong with the second piece of code?

UPDATE: Here is an example: http://www.keithdonegan.com/labs/

UPDATE 2: Live HTTP Headers

http://www.keithdonegan.com/labs/process.php

POST /labs/process.php HTTP/1.1
Host: www.keithdonegan.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.keithdonegan.com/labs/
Cookie: __utma=168444603.2571244565690463700.1247813169.1247813169.1247813169.1; __utmb=168444603.1.10.1247813169; __utmc=168444603; __utmz=168444603.1247813169.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
Content-Type: application/x-www-form-urlencoded
Content-Length: 24
search=web&submit=Search
HTTP/1.x 200 OK
Date: Fri, 17 Jul 2009 07:02:17 GMT
Server: Apache/2.0.52 (Red Hat) PHP/4.4.7 FrontPage/5.0.2.2635
X-Powered-By: PHP/5.2.5
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
----------------------------------------------------------
http://www.keithdonegan.com/watis1.css

GET /watis1.css HTTP/1.1
Host: www.keithdonegan.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)
Accept: text/css,*/*;q=0.1
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.keithdonegan.com/labs/process.php
Cookie: __utma=168444603.2571244565690463700.1247813169.1247813169.1247813169.1; __utmb=168444603.1.10.1247813169; __utmc=168444603; __utmz=168444603.1247813169.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
If-Modified-Since: Fri, 17 Jul 2009 06:46:20 GMT

HTTP/1.x 404 Not Found
Date: Fri, 17 Jul 2009 07:02:17 GMT
Server: Apache/2.0.52 (Red Hat) PHP/4.4.7 FrontPage/5.0.2.2635
X-Powered-By: PHP/5.2.5
X-Pingback: http://www.keithdonegan.com/xmlrpc.php
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Last-Modified: Fri, 17 Jul 2009 07:02:17 GMT
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
----------------------------------------------------------
http://www.keithdonegan.com/pictures1/ndplogo.gif

GET /pictures1/ndplogo.gif HTTP/1.1
Host: www.keithdonegan.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.keithdonegan.com/labs/process.php
Cookie: __utma=168444603.2571244565690463700.1247813169.1247813169.1247813169.1; __utmb=168444603.1.10.1247813169; __utmc=168444603; __utmz=168444603.1247813169.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

HTTP/1.x 404 Not Found
Date: Fri, 17 Jul 2009 07:02:17 GMT
Server: Apache/2.0.52 (Red Hat) PHP/4.4.7 FrontPage/5.0.2.2635
X-Powered-By: PHP/5.2.5
X-Pingback: http://www.keithdonegan.com/xmlrpc.php
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Last-Modified: Fri, 17 Jul 2009 07:02:17 GMT
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
----------------------------------------------------------
http://www.keithdonegan.com/pictures1/eurologo.gif

GET /pictures1/eurologo.gif HTTP/1.1
Host: www.keithdonegan.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.keithdonegan.com/labs/process.php
Cookie: __utma=168444603.2571244565690463700.1247813169.1247813169.1247813169.1; __utmb=168444603.1.10.1247813169; __utmc=168444603; __utmz=168444603.1247813169.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

HTTP/1.x 404 Not Found
Date: Fri, 17 Jul 2009 07:02:17 GMT
Server: Apache/2.0.52 (Red Hat) PHP/4.4.7 FrontPage/5.0.2.2635
X-Powered-By: PHP/5.2.5
X-Pingback: http://www.keithdonegan.com/xmlrpc.php
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Last-Modified: Fri, 17 Jul 2009 07:02:18 GMT
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
----------------------------------------------------------
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:12:31+00:00Added an answer on May 12, 2026 at 6:12 am

    started another answer because of new knowledge. I was bored and decided to investigate. Your postvars have to contain ALL the input fields, where you’ve only got TEXTSEARCH.JOBNAME. The site must require them all or default back to the template page.

    so:

    $search = 'plumber';
    $post_fields = "TEXTSEARCH.JOBNAME=$search";
    
    $post_fields .="&REQUEST.WWW_JS_VAC_TEXTSEARCH=Search";
    $post_fields .="&TEXTSEARCH.DESCRIPTION= &TEXTSEARCH.LOCATION=";
    

    if you fill it out like that, then you’ll get a response that includes something like “your search got x results” or whatever

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 178k
  • Answers 178k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes - you'd need to trigger the WPF program remotely,… May 12, 2026 at 3:44 pm
  • Editorial Team
    Editorial Team added an answer Yes, major numbers select the driver and minor numbers select… May 12, 2026 at 3:44 pm
  • Editorial Team
    Editorial Team added an answer Just wanted to update - our final decision was to… May 12, 2026 at 3:44 pm

Related Questions

Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.