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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:04:37+00:00 2026-05-24T07:04:37+00:00

Member Chris pointed out an issue for my question where passing strings via exec()

  • 0

Member Chris pointed out an issue for my question where passing strings via exec() need special treatment to avoid spaces.

<?php
{
$ID = $_POST["ID"];
$RICHTEXT = $_POST["RICHTEXT"];
exec ("/usr/local/bin/php /home/admin/folder1/TESTS/process_it.php $ID $RICHTEXT >/dev/null &");
}
?>

Assuming $RICHTEXT is a page of html, how can $RICHTEXT be encoded to a single string that will work with exec()?

I have tried to replace all the white spaces with &nbsp; and it fails. I have also applied htmlentities and it fails. Any ideas?

  • 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-24T07:04:37+00:00Added an answer on May 24, 2026 at 7:04 am

    You probably want to use escapeshellarg()

    Something like:

    exec (sprintf("/usr/local/bin/php /home/admin/folder1/TESTS/process_it.php %s %s >/dev/null &", escapeshellarg($ID), escapeshellarg($RICHTEXT)));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A team member has run into an issue with an old in-house system where
I'm writing a member-based web application, and I need to be able to redirect
Does constant static member variables of a class or a struct in C++ need
I am a member of all the roles (Browser, Content Manager, My Reports, Publisher,
Using any member of the Windows Server family, I can set up an active
Where do the type/member/parameter descriptions that you see in the Intellisense bubble come from?
I have seen member functions programed both inside of the class they belong to
All the member variables and member functions in my class ClassA are static. If
I'm a member of ACM, and I have limited access to both Books 24x7
FieldInfo has an IsStatic member, but PropertyInfo doesn't. I assume I'm just overlooking what

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.