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

  • SEARCH
  • Home
  • 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 501807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:13:39+00:00 2026-05-13T06:13:39+00:00

Here is my problem. I have a ticket-tracking system that is not very ‘user

  • 0

Here is my problem. I have a ticket-tracking system that is not very ‘user friendly’ but I have a desire for my users to submit ‘tickets’ to the system without having them to see it.

I got as far as just using a custom HTTP Form and posting to the ticket tracking system. One problem is the ‘success/completion’ page has a tendency to confuse people. So I figured… well since I cant change the ticket system to use a different ‘success’ page. I will just handle the HTTP Post exchange with CURL and report a custom success or problem page. Heres some abstracted code.

File: tickethelper.php

<?php
extract($_POST);
$url = 'TICKETSYSTEMURL';
$fields = array(
        'fullname'=>urlencode($fullname),
        /*many more fields*/
        );

foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');
$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
curl_setopt($ch, CURLOPT_MAXREDIRS, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$contents = curl_exec($ch); 
curl_close($ch);
if((strlen(strstr($contents,'Your ticket has been submitted')))>0){
        header("Location: http://THANKYOU");
}
        else{
                header("Location: http://OOPS");
        }

?>

However, what I realized is that I am missing my file upload. Most of the CURL examples I have seen are to do with uploading local files to a remote HTTP POST page.

How do I handle receiving a file from my users HTTP form, process this in the ‘tickethelper’ and POST that to the ‘TICKETSYSTEMURL’ ?

-Israel

  • 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-13T06:13:39+00:00Added an answer on May 13, 2026 at 6:13 am

    Well, I can’t say I’ve done this myself, but according to the PHP documentation regarding CURL and File Handling (PHP.net)

    CURLOPT_INFILE | The file that the transfer should be read from when uploading.

    value should be a stream resource (using fopen(), for example) for the following values of the option parameter:

    You should be able to call fopen() on the file that has been uploaded (refer to documentation regarding Handling File Uploads) I’m not sure, but you may need to call move_uploaded_file() to a controlled directory on the server before calling fopen()

    For example:

    $ch = curl_init();
    
    $file = fopen($_FILES['file-field-name']['tmp_name'], 'r');
    
    // OTHER CURL CONFIGURATION
    curl_setopt($ch, CURLOPT_INFILE, $file);
    
    curl_exec($ch);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the situation: I have a web-based ticket application, multiple users. One problem that
Here is the problem: I have two columns in a table that, for each
Here's my problem: I have an unmanaged dll that I made.I'm calling one of
I have exactly the same problem as described here: http://bugs.jqueryui.com/ticket/7930 . The problem is
I have problem adding arraylist to list view, will explain about my problem here..
First, sorry for my bad english, I'm French. Here the problem : I have
Here's the problem: I have a data-bound list of items, basically a way for
Here is my problem : I have a list of messages which I can
Here is my problem: I have an array of model class(Let's say, 'addressModel' with
Here's my problem: I have do create a menu/list of actions (which would be

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.