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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:57:42+00:00 2026-05-22T22:57:42+00:00

I am trying to pass a string that already contains quotation marks from one

  • 0

I am trying to pass a string that already contains quotation marks from one php file to another via a hyperlink and the GET method.

I am retrieving thousands of lines which contain quotation marks in a while loop and saving the output to a variable as follows:

while ($trouble_row = mysql_fetch_array($trouble_result)) {
  $ticketid = $trouble_row['ticketid'];
  $ticketno = $trouble_row['ticket_no'];                        
  $created = $trouble_row['createdtime'];
  $modified = $trouble_row['modifiedtime'];
  $title = $trouble_row['title'];
  $solution = $trouble_row['solution'];
  $hoursattended = $trouble_row['cf_629'];
  $hoursbilled = $trouble_row['cf_628'];
  $csv .= "$firstname $lastname,$ticketno,$created,$modified,$hoursattended,$hoursbilled,$title,$solution\n";
  }

The variable $title sometimes contains an entry that looks like this:

The user “tom” is having problems.

The variable $csv is collecting all the results from each pass and creating a CSV formatted string that I then need to pass to a new php script, which I am trying to do using a hyperlink:

a href="export_csv.php?csv=$csv">Export to CSV</a>

Unfortunately the embedded quotation marks are recognized by the hyperlink and cut off the majority of the output. Any suggestions on how to collect the data differently, store it differently, or pass it differently would be greatly appreciated!

  • 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-22T22:57:42+00:00Added an answer on May 22, 2026 at 10:57 pm

    For parameters in links, you need to use urlencode():

    echo '<a href="export_csv.php?csv='.urlencode($csv).'">Export to CSV</a>';
    

    note however that GET requests have length limits starting in the 1-2k area (depending on browser and server).

    Alternative approaches:

    Forms

    One method that is immune to length limits is creating a <form> element for each link with method="post" and adding the values in <input type='hidden'> inputs. You would then style the submit button of the form like a link.

    <form action="export_csv.php" method="post">
     <input type="hidden" name="csv" value=".......">
     <button type="submit">Click here </button> <!-- Use CSS to style -->
    </form>
    

    Sessions

    Another very elegant way to pass the data would be

    • Generating a random key
    • Saving the CSV data in a $_SESSION variable with the random key
    • Passing the random (short) key in the URL instead of the full data

    You’d just have to take care of deleting unused random keys (and their data) frequently.

    These kinds of links couldn’t be bookmarked, of course.

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

Sidebar

Related Questions

I'm trying to pass one method to another in elisp, and then have that
I'm trying to create a string to pass to a PHP file with numerous
I'm trying to pass in a Base64 string into a C#.Net web application via
I'm trying to change a listbox in my main form from another file (nodes.cs)
I have a custom tag that I'm trying to pass a String to. It
I am trying to pass a string (or char*) from Rundll32 to a DLL
I'm having some trouble trying to pass a string from a URL to the
I'm trying to pass a string parameter in MVC3. The URL that gets generated
I'm trying to create a string from a regular expression. I noticed that in
I'm trying to pass the following String to a PreparedStatement : private static final

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.