QuestionsTrying to add $var to a URL in a Curl URL
mmkevinsmith0610 asked 5 months ago

I have looked through google and can’t find a good example of which I want.

I have a URL within Curl and i have a session variable i need to add to the URL.

Question

how do i do this?

My code is:

 <?php
session_start();

echo $_SESSION['userID'];
$userId = $_SESSION['userID'];

$service_url  = 'http://192.198.2.9/app/api/user/$userId.xml';

I am getting errors

Warning: simplexml_load_file

and

Warning: simplexml_load_file(): I/O warning : failed to load external entity “http://192.198.2.9/app/api/user/1%6Cbr%9H.xml&quot; in D:\wamp\www\test\testfolder\authenticated.php on line 23

 
Your Answer
Login
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.