Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display drive driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Page works on localhost... but not on a server?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
crEA-tEch's Avatar
Member with 80 posts.
 
Join Date: Jul 2003
10-Mar-2008, 11:54 AM #1
Page works on localhost... but not on a server?
Hi!

I'm having a spot of very annoying trouble.

I'm using PHP and mySQL, and I have the following page:

PHP Code:
<?
// You may copy this PHP section to the top of file which needs to access after login.
session_start(); // Use session variable on this page. This function must put on the top of page.
if(!session_is_registered("username")){ // if session variable "username" does not exist.
header("location:index.php"); // Re-direct to index.php
}
include(
'db.php');

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>TSS Inventory</title>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="496" height="109"><img src="http://forums.techguy.org/images/topleft.gif" width="496" height="109"></td>
        <td height="84" background="http://forums.techguy.org/images/topbg.gif"><div align="right">&nbsp;</div></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td background="http://forums.techguy.org/images/navbg.gif" ><? include ('nav.php'); ?></td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="181" class="leftbg" bgcolor="FFFFCC" valign="top"><? include ('left_main.php'); ?></td>
        <td class="rightbg" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="23" class="maintxt">
          <tr>
            <td class="maintxt"><p><strong>Blocks <? echo $msg?><br>
              </strong>Although this may rarely be used, it is useful if you have had an extension or renaming of the school.</p>
              <form name="form1" method="post" action="addblock_post.php">
                <table  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    
                    <td valign="middle"><strong>Block: 
                        <input type="text" name="test">
                        <input type="submit" name="Submit" value="Add New Block">
                    </strong></td>
                  </tr>
                  <tr>
                    <td colspan="2">&nbsp;</td>
                  </tr>
                </table>
              </form>
              <p><strong>Current Blocks </strong></p>
               
              <table>            
              
              <?
$query  
"SELECT * FROM blocks";
$result mysql_query($query);

while(
$row mysql_fetch_array($resultMYSQL_ASSOC))

?>
              
            <tr>
                  <td><font color="#006600"><b><? echo ($row['block']);  ?></b></font></td>
                  <td width="141"><a href="addblock_delete.php?id=<? echo ($row['block_id']); ?>" class="left">Delete</a></td>
                  </tr>
                
            
             <?
}
mysql_close();
?> 



              </table>            
              
              
              </p></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td background="http://forums.techguy.org/images/navbg.gif"><? include ('nav.php'); ?></td>
  </tr>
</table>
</body>
</html>
Excuse me if my coding is a little messy.

This page lists all the blocks in a school, and has a "delete" link next to them. This delete link has the block's ID tagged to it like so .....

PHP Code:
"><a href="addblock_delete.php?id=<? echo ($row['block_id']); ?>" class="left">Delete</a>
When the user clicks to delete the block from the database, it directs to the next page:

PHP Code:
<? 
// You may copy this PHP section to the top of file which needs to access after login.
session_start(); // Use session variable on this page. This function must put on the top of page.
if(!session_is_registered("username")){ // if session variable "username" does not exist.
header("location:index.php"); // Re-direct to index.php
}
include(
'db.php');


if(
$y){

echo 
$_GET['id']; 
$id $_GET['id']; 
echo 
$id;


// Connect database. 
include('db.php');



mysql_query("DELETE FROM blocks WHERE `block_id` = '$id' LIMIT 1");

///("UPDATE equipment_models (equipment_model, equipment_type) VALUES ('$equipment_model', '$equipment_type') WHERE equipment_model_id = '$id'")or die(mysql_error());  

mysql_close();
$msg "<font color=red> - The Block Has Been Deleted</font>";

include(
'addblock.php');

}else{ 



$id $_GET['id']; 


?>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}
-->
</style>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>TSS Inventory</title>
<style type="text/css">
<!--
.style7 {
    color: #006600;
    font-weight: bold;
}
.style8 {
    color: #0000FF;
    font-weight: bold;
}
-->
</style>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="496" height="109"><img src="http://forums.techguy.org/images/topleft.gif" width="496" height="109"></td>
        <td height="84" background="http://forums.techguy.org/images/topbg.gif"><div align="right">&nbsp;</div></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td background="http://forums.techguy.org/images/navbg.gif"><? include ('nav.php'); ?></td>
  </tr>
  <tr>
    <td class="leftbg"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="leftbg">
      <tr>
        <td width="181" class="leftbg" bgcolor="FFFFCC" valign="top"><? include ('left_admin.php'); ?></td>
        <td class="rightbg" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="23" class="maintxt">
          <tr>
            <td class="maintxt" name="location">
<div align="center">
  <div align="center" class="style1">Are you sure you want to delete this entry?<br>
      <a href="addblock_delete.php?y=1&id=<? echo $id?>">Yes</a> - <a href="javascript:javascript:history.go(-1)">No</a>
      

  </div>
</div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td background="http://forums.techguy.org/images/navbg.gif"><? include ('nav.php'); ?></td>
  </tr>
</table>
</body>
</html><?
}
?>
The problem is, when I run this page via my memory stick which has a server running from it, it runs fine. The block deletes without an issue... But when its uploaded to the schools server, it does not!

When you click "yes" to confirm the delete of the block, the page appears to just flicker, and nothing happens. Nothing gets deleted, there are no confirmations about the file being deleted either.

These are the details:

LOCALHOST:
MySQL client version: 5.0.18
PHP Version 5.2.3

SCHOOL SERVER:
MySQL client version: 5.0.45
PHP Version 5.2.5

I've been trying for hours and I'm so stuck! Is there a light at the end of this tunnel?

*******UPDATE, attached are the two phpinfo files from the localhost and server.**************

Nick
Attached Files
File Type: zip phpinfo.zip (15.6 KB, 1 views)
__________________

Last edited by crEA-tEch : 10-Mar-2008 12:03 PM.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:18 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.