search

Home  >  Q&A  >  body text

How to get openid after scanning the QR code image generated with PHP?

I used the PHP QR code generation library to generate a QR code picture (not generated by the WeChat interface). I want to get the WeChat user's openid after scanning the QR code. How can I use this function? to fulfill?

(I previously thought of using web page authorization to achieve this, but the prerequisite for this is that WeChat users need to follow the official account. Is it possible to directly scan the QR code to jump to the target page without the user following it? , and can you get his openid in the process?)

LRTRLLRTRL2695 days ago1989

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-06-29 10:14:20

    $postStr = file_get_contents("php://input");
    $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
    $fromUsername = $postObj->FromUserName;

    $fromUsername is openid

    reply
    0
  • Cancelreply