Jump to content

Archived

This topic is now archived and is closed to further replies.

Drezard

Copying error >:(

Recommended Posts

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:
[CODE]
<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>
[/CODE]

Heres, Games.php
[CODE]
<<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>
[/CODE]

Heres Classes.php:
[CODE]
<?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!";
}

}

}

?>
[/CODE]


Cheers, Please help

Share this post


Link to post
Share on other sites
[quote]Can someone please tell me whats wrong with these scripts[/quote]

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

Share this post


Link to post
Share on other sites
His error

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

Share this post


Link to post
Share on other sites

×

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.