FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


php & html





takashiro
Code:
<?php
$id=$_GET['id'];
$swftitle = array (
   1 => "No Way to Say - 浜崎あゆみ",
   2 => "Blue Bird - 浜崎あゆみ",
   3 => "Your Color - BoA",
   4 => "Everlasting - BoA",
   5 => "スビカ- 坂本真綾"
   );
$swffile = array (
   1 => "http://www.56.com/n_v48_/c20_/3_/2_/syaorantae_/1184307980_518_/282000_/0_/15456902.swf",
   2 => "http://www.56.com/n_v164_/c22_/25_/20_/syaorantae_/1184561707_182_/248000_/0_/15548159.swf",
   3 => "http://www.56.com/n_v163_/c23_/29_/28_/syaorantae_/118690028465_/296000_/0_/16700641.swf",
   4 => "http://www.56.com/n_v164_/c23_/1_/16_/syaorantae_/118723136053_/320000_/0_/16923528.swf",
   5 => "http://www.56.com/n_v138_/c28_/4_/6_/syaorantae_/118787613750_/253000_/0_/17406740.swf"
   );
$cdate = array (
   1 => "2007-07-13 14:26:20",
   2 => "2007-07-16 12:55:07",
   3 => "2007-08-12 14:31:24",
   4 => "2007-08-16 10:29:20",
   5 => "2007-08-23 21:35:37"
   );

?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>犬夜叉 時代を越える旅 - 原创MV</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="760" height="100%" border="0" align="center" background="../bg_main.gif">
  <tr >
    <td height="57" colspan="2"><img src="title_character.gif" width="434" height="57" /></td>
  </tr>
  <tr>
    <td class="pageName">$swftitle[$id]</td>
    <td class="bodyText">发布时间:$cdate[$id]</td>
  </tr>
  <tr>
    <td colspan="2" align="center"><embed src="$swffile[$id]" type="application/x-shockwave-flash" width="552" height="452"></embed></td>
  </tr>
  <tr>
    <td colspan="2" class="subtitle">播放列表:</td>
  </tr>
  <tr>
    <td colspan="2"><table width="100%" border="0">
      <tr>
        <td width="33%"><a href="./?id=1">No Way to Say - 浜崎あゆみ</a></td>
        <td width="33%"><a href="./?id=2">Blue Bird - 浜崎あゆみ</a></td>
        <td width="33%"><a href="./?id=3">Your Color - BoA</a></td>
      </tr>
      <tr>
        <td><a href="./?id=4">Everlasting - BoA</a></td>
        <td><a href="./?id=5"> スビカ - 坂本真綾</a></td>
        <td>&nbsp; </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="760" border="0" align="center" background="../bg_main.gif">
<tr><td>時代を越える旅 <a href=../>返回主页</a> <a href=../>http://inuyasha.frih.net</a></td></tr></table>
</body>
</html>


I do not understand, why it did not change $swftitle, $swffile and $cdate into "No Way to Say - 浜崎あゆみ".........
mathiaus
You didn't tell PHP to do anything. That's just plain old HTML.
Quote:
<td class="pageName"><?php echo $swftitle[$id]; ?></td>
DjinniFire
As mathiaus said you didn't tell PHP to do anything.

In a PHP script the actual code that is run through the server and has real dynamic output is anything within

Code:
<?php

     // Here

?>


Blocks of code etc. Those tags basically say "Hey server PHP script now, so run the following ...then the ?> says STOP SERVER now it's a normal html document".

So everywhere you have $variable and want it to display the content you want you need.
Code:
<?php echo *******; ?>
replace ******** with the $variable.
Related topics
E-Cards with PHP & MySQL
HTTP AUTH with PHP and mySQL
Difference between PHP and HTML docs
PHP OOP Tutorial
creating guestbooks (form) with php & mysql
PHP and SEO
A very good PHP MySQL Tutorial
php/HTML pages question
CLOSE PLEASE
How to change extension php to html but the php script still
Simple php & mysql script
PHP & MySQL auth system
cdpuvbhfzz.com
Common IDE Platform for PHP, CSS, HTML and Specially JQuery
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.