RE: php array
I am trying to use Multidimensional arrays for sending data to another page but i am not able to retrive data of paths (individual),but i am able to access all the data at a time when i use print_r function .
what i want to do :
i am trying to send the data (using array) form my video_array.php to sh.php for showing the list of videos
which is present in the folder and when user click on any video then it play that vvideo.
i am using array so that i can bulid my web page much more dynamic..
please help me ..
thanks shubham..
code :
video_array.php
<?php
//$paths = array();
$videos = array();
$videos["101"] = array(
"name" => "Engineering Mathenatics-III",
"paths" => array(
1010 => "3_sem/video/plcc/a1.mp4",
1011 => "3_sem/video/plcc/a2.mp4",
1012 => "3_sem/video/plcc/a3.mp4",
//1013 => "3_sem/video/plcc/DG-L-4.mov",
//1014 => "3_sem/video/plcc/DG-L-5.mov",
//1015 => "3_sem/video/plcc/DG-L-6.mov",
//1016 => "3_sem/video/plcc/DG-L-7.mov",
//1017 => "3_sem/video/plcc/DG-L-8.mov",
),
);
$videos["102"] = array(
"name" => "Programming Language Concepts and Constructs",
"paths" => array(
1020 => "3_sem/video/plcc/DG-L-1.mov",
1021 => "3_sem/video/plcc/DG-L-2.mov",
1022 => "3_sem/video/plcc/DG-L-3.mov",
1023 => "3_sem/video/plcc/DG-L-4.mov",
),
);
?>
sh.php
<?php
include("include/video_array.php");
include("include/list_array.php");
$subject_id = $_GET["id"];
$subject = $subjects[$subject_id];
$name = $subject["name"];
$type = $subject["type"];
$code = $subject["code"];
$t_credits = $subject["t_credits"];
$video_id = $_GET["id"];
//$path_id = $_GET["id"];
$video = $videos[$video_id];
$v_name = $video["name"];
$path = $video["paths"]
//$paths = $video[$video_id];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?php echo $name; ?></title>
<link href="css/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="main">
<header>
<h1><?php echo "$name<br />" . "Paper type: $type<br />" . "Subject code: $code<br />" . "Totle Credits: $t_credits"; ?>
</h1>
</header>
<div id="video_box">
<h2>Videos</h2>
<div id="video_tab">
<a href="#"><img src="image/video1.png"></a>
</div>
</div>
<div id="pdf">
<h2>PDF</h2>
</div>
</div>
<?php
//foreach ($videos[paths] as $path) {
//echo $path "<br />";
//}
?>
<pre>
<?php
// echo $subject_id . "\n";
// var_dump($subject);
//echo $video_id . "\n";
//var_dump($video);
?>
</pre>
</body>
<?php
?>
BOOK DESIGN & LAYOUT / WEB DEVELOPMENT
WEBSITE: www.datastyling.com (book design & layout - $95 only) www.thorhosting.co (hosting with free fully functional website) www.infoph.com (open internet directory, jobs, classifieds & news)
SKYPE: datastyling
FACEBOOK: https://www.facebook.com/bookdesignservices