Jump to content
php.lv forumi

Video skripts


dulais

Recommended Posts

Ok tik tālu tiku, bet nu ir atkal viena problēma kā skripts var saprast kurš id ir izvēlēts??

 

video.php uztaisīju šādu:

 

<?
error_reporting(E_ALL);
ini_set("display_errors", 1); 

$con = mysql_connect("localhost","","");
if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }

mysql_select_db("", $con);

$result = mysql_query("SELECT * FROM video");

while($row = mysql_fetch_array($result))
 {

}

mysql_close($con);
echo'</tr></table>';

?>
<div id="vf">
<div id="videoframe">
<b><?$nosaukums;?></b>
<div id="vidurl"><a href="videos.php?video=<?$video_id;?>" title="">
<img src="http://i.ytimg.com/vi/<?$embed;?>/default.jpg" width="80" height="80" border="0">
</a></div>
<div id="vidtit2"><a href="videos.php?video=<?$video_id;?>" title="<?$nosaukums;?>"></a></div> 
Pievienoja: <b><?$autors;?></b><br>
<a href="videos.php?video=<?$video_id;?>">Apskatīt</a><br />
</div>
</div>

 

videos.php

 

<?

error_reporting(E_ALL);
ini_set("display_errors", 1); 

$con = mysql_connect("localhost","","");
if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }

mysql_select_db("", $con);

$result = mysql_query("SELECT * FROM video");

while($row = mysql_fetch_array($result))
 {

}

echo <<< HTML
<tr>
<td>
<center>
<b>$nosaukums</b><br>
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/$embed&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/$video_id&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br><br>
Adrese: <input type=text style="width: 290px;" readonly value="http://revenge.lv/videos.php?video=$video_id" /><br>
Pievienoja: <b>$autors</b><br>
</center>
</td>
</tr>
HTML;


echo'</tr></table>';
?>

 

datubāze izskatās šāda

 

v2lzgily09lymnbni97i.jpg

Edited by dulais
Link to comment
Share on other sites

tagad tjipa padod caur linku id un skaties konkrēto video.

 

$video_id = mysql_real_escape_string($_GET['video_id']);

$result = mysql_query("SELECT * FROM video WHERE video_id = '$video_id'");

 

while($row = mysql_fetch_array($result)){
echo "Video id:" . $row['video_id'];
echo "Embded:" . $row['embed'];
echo "autors:" . $row['autors'];
//utt...
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...