Jump to content

Copying error >:(


Drezard

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