<?php
// mysql connection and session information goes here
// be sure to sanitize all variables before hand
$query = mysql_query("SQL GOES HERE");
$create = mysql_fetch_assoc($query);
$file = fopen($create['username'].".php",w);
// This is a heredoc of the template (very basic)
$profile = <<< PROFILE
<html>
<head>
<title>My profile</title>
</head>
<body>
<div>Id: {$create['id']}</div>
<div>Name: {$create['name']}</div>
<div>Picture: <img src="{$create['picture_url']}"</div>
</body>
</html>
PROFILE;
// this writes the profile to the actual file
if (!fwrite($file,$profile))
die ("Profile creation terminated");
fclose($file);
?>
Return to Interpreted Languages
Users browsing this forum: No registered users and 0 guests