Jump to content

Best way to have unique links depending on variable?


iamLearning

Recommended Posts

I want to have a unique link for each posted video.  Like for instance when a user uploads a video MYSQL asigns that video a unique ID. I know how to to this, but then

 

 

How could I then take that ID and create a custom page that other users could link to to view that link?

 

possible with the structure like this

 

?page=video?id=1 

 

 


Right now this is the only bit of code I have dealing with links. 

<?php
if (empty($_GET['page'])){
	header('Location: ?page=home');
	die();
	}

$core_path = dirname(__FILE__);

$pages = scanDir("{$core_path}/pages");
unset($pages[0],$pages[1]);

foreach ($pages as &$page){
$page = substr($page, 0, strpos($page, '.'));
}

if (in_array($_GET['page'], $pages)){
	$include_file = "{$core_path}/pages/{$_GET['page']}.php";
}else{
$include_file = "{$core_path}/pages/home.php";
}

if (array_key_exists('page', $_GET)) {
$currentpage = $_GET['page'];
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.