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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:18:17+00:00 2026-05-23T11:18:17+00:00

PHP: $var = Sum Random’z Strings with quotemarks $send = base64_encode($var) Then it sends

  • 0

PHP:

$var = "Sum Random'z String"s with quotemarks"
$send = base64_encode($var)

Then it sends the base64 encoded string to server.

Server part (Python) tryes to decode the base64-encoded content and write it into file:

f = open("/root/data.yml","w")
f.write(base64.b64decode(sys.argv[1]))
f.close()

sys.argv[1] is $send

However, when i open data.yml in nano or cat, i get this:

Sum Random\'z String\"s with quotemarks

I dont want \ there.
Is there a way so the \ character will not appear there, when i open it in nano or cat? What shall i change?
EDIT:
$var is taken from textarea where there are no \

  • 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-23T11:18:18+00:00Added an answer on May 23, 2026 at 11:18 am

    You don’t need to escape both the single and double quote. You only need to escape what you’re quoting the string with (i.e. ")

    $var = "Sum Random'z String\"s with quotemarks";
    

    This may not be your only problem. But it is part of the problem.

    UPDATE

    Per your update of $var being set with data from a form textarea, you need to look at stripslashes()

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

Sidebar

Related Questions

I need to send newsletters. I have already a PHP script that sends mass
So I call this PHP script from the command line: /usr/bin/php /var/www/bims/index.php projects/output and
<?php class Box { var $contents; function Box($contents) { $this-&gt;contents = $contents; } function
In this code: <?php class Foo { var $value; function foo($value) { $this->setValue($value); }
Lets say I have this code: <?php class hello { var $greeting = hello;
My flash code: var request=new URLRequest('http://localhost/test.php'); request.method = URLRequestMethod.POST; var data = new URLVariables();
$.getJSON('ajax_popup.php', function(data) { var popupDiv = decodeURIComponent(data.data); $('body').append( popupDiv ); }); This piece of
I can access a PHP var with Javascript like this: <?php $fruit = apple;
I have three PHP arrays that I've encoded with json... extra PHP code has
So, I set up a cronjob to run the following command: php /var/www/path/to/cron/do-stuff.php The

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.