Jump to content

XML/PHP help


eaglelegend

Recommended Posts

Hi, I thought I would try getting the xml/xhtml correct on my site by temporary nameing the files ".xml" instead of ".php" its helped me solve a few problems so far, just the last one...

 

XML Parsing Error: no element found
Location: /index.xml
Line Number 64, Column 3:?>
--^

 

heres the index.php

<?php
include("header.xml");

print "<h1>Welcome to Eagle Legend!</h1><br />
Welcome to Eagle Legend, incase you havent noticed, the site is starting to look better every day!, I have opend the network for basically "people like me!" who like to program, but anyone can suggest things in the forums!<br /><br />
<h1>FREE 5000 Eagle Gold!</h1><br />
    Vote below and get FREE 5000 Eagle Gold, only when you are logged in, every 24 hours! Thats 35k a week! <br /><br />";

		$sql = mysql_query("SELECT * FROM `members` WHERE `username`='{$_SESSION['ELv2']}' AND `site`=\"$Z\"");
		while($row = mysql_fetch_array($sql)) {
		 	$username = $row["username"];
		}
print "<a href=\"http://www.omgspider.com/in.php?game_id=127&username=$username\" target=\"_blank\"><img src=\"http://i44.photobucket.com/albums/f21/Murzim/omgspider/vote_button.gif\" border=\"0\" title=\"Vote!\" alt=\"Vote!\"></a></h1>";
print "<h2>4 Newest Adoptions</h2>";
    
    <table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"350\">
  <tr>

    $sql = mysql_query("SELECT * FROM `pets` ORDER BY `id` DESC LIMIT 4");
    while($row = mysql_fetch_array($sql)) {
     	extract($row);
     	$x=$x+1;
     	
     			if($status <= 3) {
			 	$s = "Very Unhappy";
			}
			if($status >= 3 && $status < 6) {
			 	$s = "Unhappy";
			}
			if($status >= 6 && $status < 9) {
			 	$s = "Bored";
			}
			if($status >= 9 && $status < 12) {
			 	$s = "Happy";
			}
			if($status >= 12 && $status < 15) {
			 	$s = "Very Happy";
			}
			if($status >= 15) {
			 	$s = "Very Happy and Playful!";
			}
	  
 	print "<td width='33%' valign='top'>
 	<table border='0' cellpadding='2' cellspacing='0' width='350'>
 	 <tr>
 	  <td valign='middle' align='center'><img src='http://images.eaglelegend.com/pets/$species.png' alt='$petName the $species' title='$petName the $species' /></td>
 	  <td valign='top' class='other' width='350'>$user adopted a $species<br />
	   Name: $petName<br />
          Status: $s<br />
          Born: $date<br />
          Points: $points</td>
 	 </tr>
 	</table>
 	</td>";

	if($x%2==0) {
	 	print "</tr><tr>";
	} 

   }

   print "</table>";
   
include("footer.xml");
?>

 

Should I now change it back to .php?, does that mean it is ok now, or?...

Link to comment
Share on other sites

Hi, I thought I would try getting the xml/xhtml correct on my site by temporary nameing the files ".xml" instead of ".php" its helped me solve a few problems so far, just the last one...

 

XML Parsing Error: no element found
Location: /index.xml
Line Number 64, Column 3:?>
--^

 

heres the index.php

include("header.xml");

print "Welcome to Eagle Legend!

Welcome to Eagle Legend, incase you havent noticed, the site is starting to look better every day!, I have opend the network for basically "people like me!" who like to program, but anyone can suggest things in the forums!


FREE 5000 Eagle Gold!

     Vote below and get FREE 5000 Eagle Gold, only when you are logged in, every 24 hours! Thats 35k a week! 

";

		$sql = mysql_query("SELECT * FROM `members` WHERE `username`='{$_SESSION['ELv2']}' AND `site`=\"$Z\"");
		while($row = mysql_fetch_array($sql)) {
		 	$username = $row["username"];
		}
print "";
print "4 Newest Adoptions";
     
     </pre>
<table border='\"0\"' cellpadding='\"3\"' cellspacing='\"0\"' width='\"350\"'>
  

     $sql = mysql_query("SELECT * FROM `pets` ORDER BY `id` DESC LIMIT 4");
     while($row = mysql_fetch_array($sql)) {
      	extract($row);
      	$x=$x+1;
      	
      			if($status 				 	$s = "Very Unhappy";
			}
			if($status >= 3 && $status 				 	$s = "Unhappy";
			}
			if($status >= 6 && $status 				 	$s = "Bored";
			}
			if($status >= 9 && $status 				 	$s = "Happy";
			}
			if($status >= 12 && $status 				 	$s = "Very Happy";
			}
			if($status >= 15) {
			 	$s = "Very Happy and Playful!";
			}
	  
 	print "


 	  
 	  $user adopted a $species

	   Name: $petName

           Status: $s

           Born: $date

           Points: $points


";

	if($x%2==0) {
	 	print "";
	} 

    }

    print "</table>";<br>    <br>include("footer.xml");<br

 

Should I now change it back to .php?, does that mean it is ok now, or?...

 

You're going down the wrong path-- xhtml is about using a prescribed set of tags in a standard way, not about naming your files .xml. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.