Jump to content


Photo

Copying error >:(


  • Please log in to reply
2 replies to this topic

#1 Drezard

Drezard
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts

Posted 19 October 2006 - 12:57 PM

Okay, Can someone please tell me whats wrong with these scripts:

(please check www.wintersword.com thats where these scripts are actually running)

Now, I finished the index.php page and then modded it a tiny bit so i could make a games.php page now the games.php page doesnt work but the index.php does. Can some one please tell me whats wrong.

Heres, index.php:
<html>

<head>

<title> Welcome To Wintersword Productions </title>

<style type="text/css">
<!--
.style1 {font-size: 24px}
.style2 {font-size: 36px}
-->
</style>
</head>

<body>
<table width="100%" border="0">
  <tr>
    <td><span class="style1"><span class="style2">W</span>inter<span class="style2">S</span>word <span class="style2">P</span>roductions</span></td>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0">
  <tr>
    <td width="14%"><p><a href="index.php">Home</a> <br>
    <a href="games.php">Games</a> <br>
    <a href="contact.php">Contact Us</a> <br>
   <a href="support.php">Support </a> <br>
	<a href="community.php">Community</a> <br>
	</td>
    <td width="86%"><?php

error_reporting(E_ALL);

	include('classes.php');									
	// classes.php contains all the classes
		$myclass = new web;

		
	$myclass->connect();	
	
	$myclass->display_information_index();

?></td>
  </tr>
</table>
<table width="100%" border="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</body>

</html>

Heres, Games.php
<<html>

<head>

<title> Welcome To Wintersword Productions </title>

<style type="text/css">
<!--
.style1 {font-size: 24px}
.style2 {font-size: 36px}
-->
</style>
</head>

<body>
<table width="100%" border="0">
  <tr>
    <td><span class="style1"><span class="style2">W</span>inter<span class="style2">S</span>word <span class="style2">P</span>roductions</span></td>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0">
  <tr>
    <td width="14%"><p><a href="index.php">Home</a> <br>
    <a href="games.php">Games</a> <br>
    <a href="contact.php">Contact Us</a> <br>
   <a href="support.php">Support </a> <br>
	<a href="community.php">Community</a> <br>
	</td>
    <td width="86%"><?php

error_reporting(E_ALL);

	include('classes.php');									
	// classes.php contains all the classes
		$myclass = new web;
		
	$myclass->connect();	
	
	$myclass->display_information_games();

?></td>
  </tr>
</table>
<table width="100%" border="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</body>

</html>

Heres Classes.php:
<?php

error_reporting(E_ALL);

class web{

   	function connect() {
			
 		$user = "censored";		
 		$pass = "censored";		
 		$host = "localhost";		
 		$db = "censored"; 
	
		$connect = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
    
    	mysql_select_db($db) or die ("Unable to select database!"); 

    }
	
	function display_information_index() {	 
				
		$query = "SELECT home FROM pages";

		$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
			
		if (mysql_num_rows($result) > 0) {
    		
			while($row = mysql_fetch_row($result)) {
        		
        		echo $row[0];
				
    		}				
			
		}
		
		else {

    		echo "No rows found!";
		}

	} 
	
	function display_information_games() {	 
				
		$query = "SELECT home FROM games";

		$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
			
		if (mysql_num_rows($result) > 0) {
    		
			while($row = mysql_fetch_row($result)) {
        		
        		echo $row[0];
				
    		}				
			
		}
		
		else {

    		echo "No rows found!";
		}

	} 
	
}
	
?>


Cheers, Please help

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 19 October 2006 - 01:45 PM

Can someone please tell me whats wrong with these scripts


You need to describe what is not working, any errors you may recieve and what your expected results are.

#3 GremlinP1R

GremlinP1R
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationSouth Africa

Posted 19 October 2006 - 02:00 PM

His error

Fatal error: Call to undefined method web::display_information_games() in /home/wintersw/public_html/games.php on line 40






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users