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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:35:59+00:00 2026-06-17T16:35:59+00:00

Possible Duplicate: Executing linux commands with PHP I have a PHP file that creates

  • 0

Possible Duplicate:
Executing linux commands with PHP

I have a PHP file that creates an .xfdf file I am wondering if PHP has a way of executing a command like you would type into the terminal window? I have to run the following command when after the .xfdf file is created to generate the .pdf file

pdftk /var/www/pdf/TimeCard.pdf fill_form /var/www/pdf/results/Brandon_01_23_13.xfdf output /var/www/pdf/results/testNew.pdf flatten

The command would need to be able to accept a PHP variable so its customized for the user. Is there an easy way to do this?

  • 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-06-17T16:35:59+00:00Added an answer on June 17, 2026 at 4:35 pm

    Yes, you can use exec(), pcntl_exec(), system().

    $command = 'pdftk /var/www/pdf/TimeCard.pdf fill_form /var/www/pdf/results/Brandon_01_23_13.xfdf output /var/www/pdf/results/testNew.pdf flatten';
    exec($command);
    

    Be very careful when using these commands, they are very useful/powerful, but because of this a hacker could potentially gain access to your whole server through it (depending on permissions, but it’s more than enough to compromise your site).

    If you need to send user uploaded file names/text, check them to the blood (for example check if the file path is in the proper place, and not ../../../something.pdf, check MIME types and extensions).

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

Sidebar

Related Questions

Possible Duplicate: Problem executing bash file I have created a bash file script and
Possible Duplicate: Including PHP functions from another file I'm building code that use function
Possible Duplicate: Executing a shell script inside a jar file. How to extract? I
Possible Duplicate: How to call one batch file after another I have a batch
Possible Duplicate: Executing <script> elements inserted with .innerHTML I have a problem, when generating
Possible Duplicate: Inline tag not executing in an asp.net master page I have the
Possible Duplicate: How may I reference the script tag that loaded the currently-executing script?
Possible Duplicate: Getting the name of the current executing method Is there a way
Possible Duplicate: Run a PHP CLI script from a webpage I have a problem
Possible Duplicate: Location of parenthesis for auto-executing anonymous JavaScript functions? I'm curious now that

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.