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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:10:56+00:00 2026-06-05T13:10:56+00:00

I am trying to write to a pdf file on php server. I have

  • 0

I am trying to write to a pdf file on php server. I have sent variables to the server, create the pdf document, then have my phone download the document to view on device. The variables seem not to write on the php file. I have my code below

 public void postData() {
    try {
    Calculate calc = new Calculate();

    HttpClient mClient = new DefaultHttpClient();

    StringBuilder sb=new StringBuilder("myurl.com/pdf.php");

    HttpPost mpost = new HttpPost(sb.toString());

            String value = "1234";

    List nameValuepairs = new ArrayList(1);

    nameValuepairs.add(new BasicNameValuePair("id",value));



    mpost.setEntity(new UrlEncodedFormEntity(nameValuepairs));


    } catch (UnsupportedEncodingException e) {
    Log.w(" error ", e.toString());
    } catch (Exception e) {
    Log.w(" error ", e.toString());
    }
}

And my php code to write the variable “value” onto the pdf document:

//code to reverse the string
if($_POST[] != null) {
$reversed = strrev($_POST["value"]);

$this->SetFont('Arial','u',50);

$this->Text(52,68,$reversed);

}

I am just trying to write the variable in a random spot, but the if statement is always null and I do not know why. Thanks. Sorry if it is a little sloppy.

  • 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-05T13:10:57+00:00Added an answer on June 5, 2026 at 1:10 pm

    Instead of:

    if($_POST[] != null) {
    

    Try:

    if ( isset( $_POST[ 'value' ] ) && ! empty( $_POST[ 'value' ] ) ) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to download multiple PDF files as one zip file and then
I am trying to grab a file .pdf from a server. There is a
I'm trying to download a PDF file in Struts Action class. Problem is that
I've been trying to write a small file server. I got it to the
Trying to download file with apache httpclient library and have a problem with resulting
I'm trying to save a dynamic pdf file generated from a web server using
I am trying to create a pdf file with iTextSharp. My attempt writes the
I have a problem when trying to see a .pdf file (generated with PDFKit)
I'm trying to write metadata to a pdf file using the following python code:
Trying to write a couple of functions that will encrypt or decrypt a file

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.