Good day. I have a script that processes the contents of the header into a drawing. As a result, the variable picture is displayed as a picture. Who can tell me how to place another part of the code in the same script? In addition to this picture, I need to display other data, tritely - other textual information, for example echo 'hello', etc. Or maybe as an option, transfer $ picture to another php file, for example script2.php But how to do this?

$fullurl = "https://$server/ews/Exchange.asmx/s/GetUserPhoto?email=$email_to_get&size=HR648x648"; //sizes defined at https://msdn.microsoft.com/en-us/library/jj194329(v=exchg.80).aspx $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $fullurl); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM | CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, "$user:$password"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $returned = curl_exec($ch); $fp = fopen("pic.jpg", 'w'); fwrite($fp, $picture); fclose($fp); header('Content-type: image/jpeg'); echo $picture; 
  • Need to do it in another script, no? - vp_arth
  • And why all this curl? - vp_arth
  • data is taken on the link $ fullurl = "https: //$server/ews/Exchange.asmx/s/GetUserPhoto? email = $ email_to_get & size = HR648x648"; - Oleg Zolotarenko
  • corrected the script itself. Here is the entire script from the first to the last line. it processes the data and displays the image. - Oleg Zolotarenko
  • Well, this script in img[src] will connect? Why is there another text? - vp_arth

1 answer 1

Put all this code in a separate script, for example userlogo.php

In the main script:

 <?php echo "Before<br/>"; ?><img src="userlogo.php"><?php echo "After<br/>"; 
  • Wow! I'll try now .. - Oleg Zolotarenko
  • Simple as that. brilliant :) - Oleg Zolotarenko