Jump to content

different servers


Recommended Posts

I am swithching servers (from a university to www.3essential.com). Everything worked smooth ath the university, but in the transition to the other server, my pages are going crazy. three questions.

 

1. Why are they doing that?

 

2. I have a code for authorization, but it constantly keeps recalling the prompt (I know i am putting in the right info!)

 

 

<?php 

    $id = "aa";    // user id 
    $pw = "aa";    // password 
    
    // Check to see if $PHP_AUTH_USER already contains info 

    if (!isset($_SERVER['PHP_AUTH_USER'])) 
        { 

        // If empty, send header causing dialog box to appear 

        header('WWW-Authenticate: Basic realm="DBC"'); 
        header('HTTP/1.0 401 Unauthorized'); 
        exit; 
        } 
    else if (isset($_SERVER['PHP_AUTH_USER'])) 
        { 
        if (($_SERVER['PHP_AUTH_USER'] != $id) || ($_SERVER['PHP_AUTH_PW'] != $pw)) 
            { 
            header('WWW-Authenticate: Basic realm="DBC"'); 
            header('HTTP/1.0 401 Unauthorized'); 
            exit; 
            } 
        else 
            { 
            // do nothing, everything is OK -- all programs that call this will pass here 
            } 
        } 
?>

 

This is called using "require_once" in the parent page. Again, it worked smoothly at another server

 

 

2. I uploaded some information using the script below, but after i pressed the submit button once, it entered the information 200 times.

 

<?

if (!isset($_COOKIE['MAINT'])) die("Do you belong here? I do not recognize you! I want cookies! Make sure your browser accepts cookies!<br><a href='../home.php'>Away From Here!</a>");

$conn = mysql_connect("localhost", "***", "***") OR DIE (mysql_error());
@mysql_select_db ("databox", $conn) OR DIE (mysql_error());



if ($_POST) {



  $location = $_POST["location"];
  $date = $_POST["date"];
  $venue = $_POST["venue"];
  
    $sql = "INSERT INTO schedule (location, date, venue) ";
    $sql.= "VALUES (";
    $sql.= "'{$location}', '{$date}', '{$venue}')";
    @mysql_query ($sql, $conn);
    Header("Location:".$_SERVER["PHP_SELF"]);
   
  
}



// Do this process of user has click a file name to view or remove
if ($_GET) {
  
  $iid = $_GET["iid"];
  $act = $_GET["act"];
  switch ($act) {
    case rem:
      $sql = "DELETE FROM schedule WHERE id=$iid";
      @mysql_query ($sql, $conn);
      Header("Location:./sched_index.php");
exit();
      break;
   
    default:
      break;
  }
}?>
<html>

<body>
<a href='../maintaindir.php'>Return to Maintain Headquarters</a><br>
<a href='../home.php'>Return Home</a>

<FORM name="formcheck" method="post" enctype="multipart/form-data" onsubmit="return formCheck(this);">

<center><font size=6>Schedule Update</font><hr><br>
<table>
    <P>
<tr><td>
<LABEL for="name">Location (ex. Omaha, NE): </LABEL></td>
	<td><INPUT type="text" name="location" size="20"></td>
</tr>
<tr>
<td>
<LABEL for="name">Date (ex. April 26): </LABEL></td><td>
	<INPUT type="text" name="date" size="20"></td>
</tr>
<tr><td><LABEL for="name">Venue (ex. Downtown Boxing): </LABEL></td><td><INPUT type="text" name="venue" size="30"></td>
</tr>
<tr><td></td><td>

<input type="submit" value="submit"></td></tr>
</form></table>

 

 

 

I am at a loss, i don't know where to start. Should i forget about this server and try another one?

 

Link to comment
https://forums.phpfreaks.com/topic/49650-different-servers/
Share on other sites

Archived

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

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