Reputation:
How do I pass the value from the variable $name1 (Let's say its bobsmith) to replace janedoe
<?php
$name1 = $_GET["name"];
$curl = curl_init();
$user = "user1";
$password = "pass1";
curl_setopt_array($curl, array(
CURLOPT_URL =>'https://betawebservices.whatever.com/login/service/v4/SchemaData/INDIVIDUAL-
ACTIVITIES-University/USERNAME:janedoe/',
I was hoping that I could say
<?php
$name1 = $_GET["name"];
$curl = curl_init();
$user = "user1";
$password = "pass1";
curl_setopt_array($curl, array(
CURLOPT_URL=>'https://betawebservices.whatever.com/login/service/v4/SchemaData/INDIVIDUAL- ACTIVITIES-University/USERNAME:$name1/',
...but that doesnt work. Thanks
Upvotes: 0
Views: 38
Reputation: 673
This will work..
CURLOPT_URL=>'https://betawebservices.whatever.com/login/service/v4/SchemaData/INDIVIDUAL- ACTIVITIES-University/USERNAME:'.$name1.'/'
Upvotes: 0
Reputation: 399
That should work fine if you place the contents of CURLOPT_URL in double quotes instead of single quotes.
Upvotes: 1