title: Combined string isn't working for libCurl in C++
body: <p>Basically, my program/code I'm using now is returning a message from a PHP script. The issue I'm having is when I give it a combined string for the URL, it doesn't return anything. But when I enter it manually, it returns the correct information. Here is the code I am using below:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>std::string Login(std::string uname, std::string pass)
  {
      CURL* curl;
      CURLcode res;
      std::string readBuffer;
      std::string path = "localhost/files/login.php?username=" + uname + "&amp;password=" + pass;
      std::cout &lt;&lt; uname &lt;&lt; "  " &lt;&lt; pass;
      curl = curl_easy_init();
      if (curl) {
          curl_easy_setopt(curl, CURLOPT_URL, "localhost/files/login.php?username=123&amp;password=123");
          curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
          curl_easy_setopt(curl, CURLOPT_WRITEDATA, &amp;readBuffer);
          res = curl_easy_perform(curl);
          curl_easy_cleanup(curl);
  
          return readBuffer;
      }
      return "Failed";
  
  }
  </code></pre>
  
  <p>This way works because I enter the URL manually, but when I do this it doesn't return anything:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>std::string path = "localhost/files/login.php?username=" + uname + "&amp;password=" + pass;
  
  curl_easy_setopt(curl, CURLOPT_URL, path);
  </code></pre>
  
  <p>I'm uncertain whether I'm using the wrong variable or something else. I'm new to using PHP and libCurl and anything web related.</p>