Moodle: Pass username to php page for redirect to student folder

Many schools allow students full control over a network folder so that they can create resources such as websites for display to parents etc.
It is useful to be able to create links to these resources so that students, staff and parents can access thenm without having to remember the specific URL.

Within a moodle course
  • Add a recource:  Link to a file or website
  • Location: URL of php file
  • Display Advanced:   variable name:  user;   Choose parameter: user - id
redirect-to-eportfolio.php

<?php
$passed_from_url = $_GET['user'];

$destination_string ="https://www.school..com/students/"+$passed_from_url+"/default.htm"
header( $destination_string ) ; 
?>

No comments: