Answers for "php syntax at sign"

PHP
1

what does $ sign mean in php

<?php

$name = "World";
echo "Hello, $name";

# $ i.e. "sigil" is used to distinguish a string variable from rest of the string.
Posted by: Guest on September-25-2020
0

single sign on php script

<?php
$MySecretKey = 'Nobody Will Ever Guess This!!';

// Generate signature from authentication info + secret key
$sig = hash(
    'sha256',
     $user->id . $user->email,
     $MySecretKey
);

// Make sure we're redirecting somewhere safe
$source = parse_url($_GET['source']);
if(in_array($source->host, $list_of_safe_hosts))
  $target = 'http://'.$source->host.$source->path;

// Send the authenticated user back to the originating site
header('Location: '.$target.'?'.
    'user_id='.$user->id.
    '&user_email='.urlencode($user->email).
    '&sig='.$sig);
?>
Posted by: Guest on November-17-2020

Browse Popular Code Answers by Language