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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:18:20+00:00 2026-06-10T18:18:20+00:00

I used barcode generation in my site. When I used it within HTML tags

  • 0

I used barcode generation in my site. When I used it within HTML tags it’s working fine.

<div class="barcode_img"><img src="<?php echo AT::getUrl(); ?>/barcode/image.php?code=code39&o=1&dpi=150&t=30&r=1&rot=0&text=TEST NAME WITH SPACE&f1=Arial.ttf&f2=10&a1=&a2=&a3=" class="barcode fr"/></div>  

I need to get that image to store it in local folder called “media/barcode/”. For that, I used the code below:

$valid_barcodename="testimage";
$barcodeurl = AT::getUrl() . "barcode/image.php?code=code39&o=1&dpi=150&t=30&r=1&rot=0&text=TEST NAME WITH SPACE&f1=Arial.ttf&f2=10&a1=&a2=&a3=";
        $barcode_img = 'media/barcode/testing_' .$valid_barcodename . '.png';
        file_put_contents($barcode_img, file_get_contents($barcodeurl));

The image stored in that folder is not empty. When I analyzed it I found, if I give the name “TEST NAME WITH SPACE” without space (TESTNAMEWITHSPACE), it works.

However if I give it with space it won’t work. What is the issue?

Note: AT::getUrl() – used for get my base url.

  • 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-10T18:18:22+00:00Added an answer on June 10, 2026 at 6:18 pm

    Spaces have special meaning in URLs, so you have to encode them:

    $text = urlencode("TEST NAME WITH SPACE")
    $barcodeurl = AT::getUrl() . "barcode/image.php?code=code39&o=1&dpi=150&t=30&r=1&rot=0&text=". $text ."&f1=Arial.ttf&f2=10&a1=&a2=&a3=";
    

    In the above code, $text now contains your text, encoded and ready to be used in your URL (you will notice the spaces have been replaced with %20 codes).

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

Sidebar

Related Questions

I'm modifying an existing app. The app used Zxing's barcode scanner through Java class
Anyone got a good handle on a barcode scanning library that can be used
I used Jquery to insert a variable to div. Please check my code. var
Used this script many times to pass 1 or 2 values to a PHP
I am working on a barcode reader app in iPhone. I am using the
I am developing an application which will be used to scan the barcode from
Hello I'm wondering why is const used at the get functions in this class?
Used http://www.ilbcfreeware.org/software.html - I only get static from the files that ilbc_test.exe creates. Does
I used a ZXing library to develop a barcode scanning application.When I used my
Our reception has a barcode scanner plugged into a Macbook Mini, which is used

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.