BR
asked on
how to create a header variable in PHP ?
Dear Experts,
I use PHP 7.2
I create variable as $headers to put inside the autorization information.
I connect a server which use Auth2 when ever I need it. When I got the Authorization code I insert it into database so that I can use it without calling it every time I need it. The authoraization code lives 30 minutes.
I select it from my database assign the password $myvariable so that I can use it efficiently.
However, it doesn't work inside the header variable. When I write the authorization code instead of $myvariable it works.
could you help me out? thank you
//it doesn't work like this. When I remove $myvariable and put the same information instead, it works.
$headers = ['Content-Type: application/json','Authori zation: Autotype' . $myvariable. " ' "];
I use PHP 7.2
I create variable as $headers to put inside the autorization information.
I connect a server which use Auth2 when ever I need it. When I got the Authorization code I insert it into database so that I can use it without calling it every time I need it. The authoraization code lives 30 minutes.
I select it from my database assign the password $myvariable so that I can use it efficiently.
However, it doesn't work inside the header variable. When I write the authorization code instead of $myvariable it works.
could you help me out? thank you
//it doesn't work like this. When I remove $myvariable and put the same information instead, it works.
$headers = ['Content-Type: application/json','Authori
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are always welcome.
ASKER
You are great, I learned a lot from you, you solve all the problems and you are also a great teacher.
thank you so much