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 1020979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:14:28+00:00 2026-05-16T11:14:28+00:00

I ran into an interesting issue today when I was working on an application

  • 0

I ran into an interesting issue today when I was working on an application I’m developing. Hopefully someone knows why this is happening / how to adjust my work flow for it!

Background:
I’m writing an application that helps students at universities get in touch with each other. The basic workflow is as follows:

  1. User registers for the service
  2. The application uses CURL to poll the university directory for their name
  3. Store their contact info in a database table

My test site is the Rutgers University directory (http://www.acs.rutgers.edu/directory)
I can access the service fine through my browser (Posts to http://www.acs.rutgers.edu/pls/pdb_p/Pdb_Display.search_results), but if I try to post the same information via CURL, I get a 404 error.

Note: I get the same error if I open that url directly from a browser and don’t use their form to submit the data.

Code:
Here is the code they use on the directory site:

<fieldset>
<legend>Search For People</legend>
<div style="width:50%;margin-left:auto;margin-right:auto;">
<form method="post" action="http://www.acs.rutgers.edu/pls/pdb_p/Pdb_Display.search_results" name="thisform" onkeyup="highlight()" onclick="highlight()">
    <p>
        <label for="p_name_last">Last Name:&nbsp;&nbsp;[Required]</label><br>
        <input tabindex="1" accesskey="L" class="required" type="text" id="p_name_last" name="p_name_last" size="25" maxlength="23">
    </p> 
    <p>
        <label for="p_name_first">First Name:&nbsp;&nbsp;[or initial]</label><br> 
        <input tabindex="2" accesskey="f" type="text" id="p_name_first" name="p_name_first" size="25" maxlength="23"> 
    </p>
    <input tabindex="3" type="submit" value="Search">&nbsp;&nbsp;
</form>
</div>

And here is the code I am using to CURL the service:

<?php
$p_name_last = "doe";
$p_name_first = "";
$curlPost = 'p_name_last='  . urlencode($p_name_last) . '&p_name_first=' . urlencode($p_name_first) . '&SUBMIT=Search';
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 'http://www.acs.rutgers.edu/pls/pdb_p/Pdb_Display.search_results');
curl_setopt($ch, CURLOPT_HEADER, 1); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost); 
if( ! $result = curl_exec($ch)) 
{ 
    trigger_error(curl_error($ch)); 
} 
curl_close($ch); 
echo "<pre>";
print_r($result); 
?>

Any thoughts or suggestions would be greatly appreciated!

Thanks,
Mike

  • 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-16T11:14:28+00:00Added an answer on May 16, 2026 at 11:14 am

    Web servers can choose what response to send after processing the request. That’ll be why you are seeing the 404 – there’s a resource there but it’s responding in a unintuitive manner.

    Anyway, I can post with curl to this page and get a response;

    curl http://www.acs.rutgers.edu/pls/pdb_p/Pdb_Display.search_results --data-urlencode p_name_last=test --data-urlencode p_name_first=test

    If I post with your SUBMIT=… param I get a 404. Try it with just the two name parameters.


    Update: in fact, you can send just the last name parameter so long as the first name parameter is present – the first name parameter can be empty.

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

Sidebar

Related Questions

No related questions found

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.