通过 PHP 中的用户 <a> 标签将一个页面链接到另一个页面


Link one page to another by user <a> tag in PHP

这是我在一页中的海报代码

 <a href="#"><img href="#"></a>

现在我想将其链接到另一个页面,假设我点击 href="mydomain.com/1"它将重定向到另一个页面并播放该唯一文件。该页面的代码是

 if($playlistitem<=18)
  { 
echo '<ul>';
echo '<li class="xtitle">'.$post->title.'</li>';
echo '<li class="xdesc">'.$post->description.'</li>';
$dc=$post->children('http://search.yahoo.com/mrss/');
echo '<li class="xthumb">'.$dc->thumbnail->attributes()->url.'</li>';
echo '<li class="xpreview">'.$dc->thumbnail->attributes()->url.'</li>';

echo '<li class="xsources_mp4">'.$dc->content->attributes()->url.'</li>';
$dc->content->attributes()->url=preg_replace('/.mp4/','.webm',$dc->content->attributes()->url);
 echo '<li class="xsources_webm">'.$dc->content->attributes()->url.'</li>';
 echo '</ul>';
$playlistitem++;

 }

谁是乌普图特

<ul>
  <li class="xtitle">Breathing</li>
   <li class="xdesc">Roman Kogler (Thomas Schubert) is 19 years old and</li>
  <li class="xpreview">http://spoti.com/images/media/14496l.jpg</li>
    <li class="xsources_mp4">http://uk.clip- 1.filmtrailer.com9235_33612_a_5.mp4?log_var=179|341100232-1|-</li>
   <li class="xsources_webm">http://uk.clip-1.filmtrailer.com/9235_33612_a_5.webm?log_var=179|341100232-1|-</li></ul>

如果要将数据传递到另一个页面,可以以GET方式附加到URL。

例如:

<a href="www.mydomain.com/show.php?img=myimage.jpg">Get Details</a>

在这里,我们将值myimage.jpg传递给show.php页面。

因此,在show.php页面中,您可以使用 $_GET .例如:

<?php
$img_name = $_GET['img']; //will get the value "myimage.jpg"
//... use this data to do whatever you need
?>