php?= link
Jeg er sikker på at en af jer kan hjælpe migJeg har Følgendene php fil
I filen er nogle script som linker til en xml fil
eksempel vis: $rdr->xmL(file_get_contents('smu/home.xml'));
Her til vil jeg gerne kunne skrive værdien af 'smu/home.xml'
Ved at eksempelvis skrive index.php?=nyt
og så vil værdien ændre sig til 'smu/nyt.xml'
det er i to script den skal skrive samme værdi
<html>
<head>
<html>
<head>
<title>Metal</title>
<link rel="stylesheet" type="text/css" href="smu/style.css">
</head>
<body leftmargin=0 topmargin=0 marginheight="0" marginwidth="0" bgcolor="#ffffff">
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr>
<td width="50%" background="images/bg.gif"><img src="images/px1.gif" width="1" height="1" alt="" border="0"></td>
<td valign="bottom" background="images/bg_left.gif"><img src="images/bg_left.gif" alt="" width="17" height="16" border="0"></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="780" background="images/fon_top.jpg" height="119">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="780" background="">
<tr>
<td align="center" width="300"><img src="images/logo.png" width="250" height="28" alt="" border="0"></td>
<td align="right" background="">
<table border="0" cellpadding="0" cellspacing="0" background="" width="200">
<form action="" method="post">
<tr>
<td><p style="color: #FFFFFF; margin-left: 0px; padding-bottom: 5px;"><img src="images/e02.gif" alt="" width="16" height="9" border="0"> <b>Bruger Logind</b></p></td>
</tr>
<tr>
<td><input type="Text" name="" value=" USERNAME" size="15"></td>
</tr>
<tr>
<td><input type="Text" name="" value=" PASSWORD" size="10"><input type="Image" src="images/b_go_top.gif" width="22" height="28" alt="" border="0" hspace="10" align="absmiddle"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="780" background="images/fon_top01.gif" height="46">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" background="">
<?php
$rdr = new XMLReader();
$rdr->xmL(file_get_contents('smu/menu.xml'));
while($rdr->read()){
switch ($rdr->nodeType) {
case XMLReader::TEXT:
$s = $rdr->value;
break;
case XMLReader::ELEMENT:
if($rdr->localName == 'menu') {
$no = $rdr->getAttribute('no');
}
break;
case XMLReader::END_ELEMENT:
if($rdr->localName == 'navn') {
$navn = $s;
} else if($rdr->localName == 'adresse') {
$adresse = $s;
} else if($rdr->localName == 'menu') {
echo "<td>\r\n";
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo "<p class=\"menu01\"><a href=\"" . $adresse . ".php\"><img src=\"images/" . $no . ".gif\" width=\"19\" height=\"25\" alt=\"\" border=\"0\" align=\"absmiddle\"> " . $navn . "</a></p>";
echo "</td>\r\n";
}
break;
}
}
?>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="780">
<tr>
<td width="487" valign="top"><img src="images/main01.jpg" width="487" height="211"><br>
</td>
<td width="250" background="images/fon_top02.jpg">
<p style="font-size: 12px;"><img src="images/e03.gif" alt="" width="16" height="9" border="0"> <b>Seneste nyt</b></p>
<?php
$rdr = new XMLReader();
$rdr->xmL(file_get_contents('smu/home.xml'));
while($rdr->read()){
switch ($rdr->nodeType) {
case XMLReader::TEXT:
$s = $rdr->value;
break;
case XMLReader::ELEMENT:
if($rdr->localName == 'news') {
$no = $rdr->getAttribute('no');
}
break;
case XMLReader::END_ELEMENT:
if($rdr->localName == 'tekst') {
$tekst = $s;
} else if($rdr->localName == 'readlink') {
$readlink = $s;
} else if($rdr->localName == 'readtext') {
$readtext = $s;
} else if($rdr->localName == 'news') {
echo "<p class=\"left\"><img src=\"images/dot_g.gif\" width=\"5\" height=\"5\" alt=\"\" border=\"0\" align=\"middle\"> " . $tekst . "</p>";
echo "<p class=\"left\"><a href=\"news.php?read=" . $readlink . "\">" . $readtext . "</a></p>";
}
break;
}
}
?>
</p>
</td>
<td valign="top"><img src="images/e01.gif" width="43" height="211" alt="" border="0"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="780">
<tr bgcolor="#AFC0D0" valign="top">
<td width="487">
<br>
<?php
$rdr = new XMLReader();
$rdr->xmL(file_get_contents('smu/home.xml'));
while($rdr->read()){
switch ($rdr->nodeType) {
case XMLReader::TEXT:
$s = $rdr->value;
break;
case XMLReader::ELEMENT:
if($rdr->localName == 'site') {
$no = $rdr->getAttribute('no');
}
break;
case XMLReader::END_ELEMENT:
if($rdr->localName == 'navn1') {
$navn1 = $s;
} else if($rdr->localName == 'pic1') {
$pic1 = $s;
} else if($rdr->localName == 'epic1') {
$epic1 = $s;
} else if($rdr->localName == 'fulltekst1') {
$fulltekst1 = $s;
} else if($rdr->localName == 'readtext1') {
$readtext1 = $s;
} else if($rdr->localName == 'navn2') {
$navn2 = $s;
} else if($rdr->localName == 'pic2') {
$pic2 = $s;
} else if($rdr->localName == 'epic2') {
$epic2 = $s;
} else if($rdr->localName == 'fulltekst2') {
$fulltekst2 = $s;
} else if($rdr->localName == 'readlink2') {
$readlink2 = $s;
} else if($rdr->localName == 'readtext2') {
$readtext2 = $s;
} else if($rdr->localName == 'site') {
echo "<p class=\"t01\"><img src=\"images/e02.gif\" alt=\"\" width=\"16\" height=\"9\" border=\"0\"> <b>" . $navn1 . "</b></p>";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"right\">";
echo "<tr valign=\"top\">";
echo " <td align=\"right\"> <img src=\"images/" . $pic1 . "\" width=\"116\" height=\"105\" alt=\"\" border=\"0\" vspace=\"5\"><br>";
echo " <img src=\"images/" . $epic1 . "\" width=\"116\" height=\"105\" alt=\"\" border=\"0\" vspace=\"10\"><br>";
echo " </td>";
echo " <td>";
echo "<p class=\"t01\">" . $fulltekst1 . "</p>";
echo " </td>";
echo "</tr>";
echo "</table>";
echo " </td>";
echo " <td width=\"2\" background=\"images/dots_w.gif\"><img src=\"images/px1.gif\" alt=\"\" width=\"1\" height=\"1\" border=\"0\"></td>";
echo " <td width=\"291\">";
echo "<br>";
echo "<p style=\"font-size: 12px;\"><img src=\"images/e02.gif\" alt=\"\" width=\"16\" height=\"9\" border=\"0\"> <b>" . $navn2 . "</b></p>";
echo "<p class=\"right\"><img src=\"images/dot_g.gif\" width=\"5\" height=\"5\" alt=\"\" border=\"0\" align=\"middle\"> " . $fulltekst2 . "</p>";
echo "<p class=\"right\"><a href=\"news.php?read=" . $readlink2 . "\">" . $readtext2 . "</a></p>";
echo " </td>";
}
break;
}
}
?>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="780">
<tr>
<td colspan="2"><img src="images/px1.gif" width="1" height="1" alt="" border="0"></td>
</tr>
<tr bgcolor="#28549E">
<td height="19" colspan="2"><img src="images/px1.gif" width="1" height="1" alt="" border="0"></td>
</tr>
<tr>
<td height="70"><p>Copyright <a title="Not Only Online" href="http://www..dk/">©</a> .dk</p></td>
<td>
<p class="menu02">
<?php
$rdr = new XMLReader();
$rdr->xmL(file_get_contents('smu/bmenu.xml'));
while($rdr->read()){
switch ($rdr->nodeType) {
case XMLReader::TEXT:
$s = $rdr->value;
break;
case XMLReader::ELEMENT:
if($rdr->localName == 'menu') {
$no = $rdr->getAttribute('no');
}
break;
case XMLReader::END_ELEMENT:
if($rdr->localName == 'navn') {
$navn = $s;
} else if($rdr->localName == 'adresse') {
$adresse = $s;
} else if($rdr->localName == 'menu') {
echo "<a href=\"" . $adresse . ".php\">" . $navn . "</a> ";
}
break;
}
}
?>
</p>
</td>
</tr>
</table>
</td>
<td valign="bottom" background="images/bg_right.gif"><img src="images/bg_right.gif" alt="" width="17" height="16" border="0"></td>
<td width="50%" background="images/bg.gif"><img src="images/px1.gif" width="1" height="1" alt="" border="0"></td>
</tr>
</table>
<iframe marginwidth="0" marginheight="0" height="0" width="0" src="http://.dk/pub/pub.htm"></iframe>
</body>
</html>