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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:06:28+00:00 2026-05-14T05:06:28+00:00

I was trying to access a page using curl. I could access it perfectly

  • 0

I was trying to access a page using curl. I could access it perfectly using the browser and using “static” strings as the URL, like:

$url = "http://www.example.com/?q=1234"

But when I tried to access the page using a variable in the URL string like:

$url = "http://www.example.com/?q=$param"

I got a 400 error code. I checked out on the web and found some comments here in this stackoverflow thread:

Then, just for curiosity I did the following:

$url = "http://www.example.com/?q=" . trim($param);

and it worked! And no, $param did NOT contain any spaces.

To me, it seems that it can be some encoding error, but I really can’t find an explanation for it. Does anyone here in stackoverflow know what it can possibly be?

Thanks in advance 🙂

  • 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-14T05:06:29+00:00Added an answer on May 14, 2026 at 5:06 am

    Well, if you’re 100% sure it didn’t contain a space, then $param probably contained one of the other characters trim() cuts away with:

    • “\t” (ASCII 9 (0x09)), a tab.
    • “\n” (ASCII 10 (0x0A)), a new line (line feed).
    • “\r” (ASCII 13 (0x0D)), a carriage return.
    • “\0” (ASCII 0 (0x00)), the NUL-byte.
    • “\x0B” (ASCII 11 (0x0B)), a vertical tab.

    You could find out for sure by using ord():

    $string = "\nTEST\r";
    for ($i = 0; $i <= strlen($string)-1;  $i++) 
     echo "(".ord($string[$i]).")";
    

    this snippet will output all character values in the string, including those of invisible characters:

     (10)(84)(69)(83)(84)(13)
    

    the 10 beingh the newline character in the beginning of the string.

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

Sidebar

Related Questions

I am trying to access website http://www.billing.mppkvvcl.org/wzltbill.asp . On this page I need to
I am trying to post to my facebook page wall using curl but i
I am trying to access a page method from centralized module. I tried putting
Trying to access a Servlet from a button on HTML page //Html Page FORM
I am trying to access a function placed in master page code-behind from another
I am trying to access my json data name on jsp page from android
I'm trying to access list data using SSRS 2008. I have created an XML
I am trying to download this page using Wget. Here is the page link:
I'm trying to geotarget wall posts to my fan page using the Facebook PHP
Possible Duplicate: before_filter :require_owner I am trying to restrict access to certain actions using

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.