Solved

Excel Spreadsheet not opening up without password

Posted on 2012-03-30
2
293 Views
Last Modified: 2012-04-12
I've got a page that my user can open up in Excel by copying and pasting the URL into the dialog box you get when you hit "Cmd-O" in Excel.

It's worked great until recently. Now it prompts my user for a password. There's nothing on the page that asks for that, yet Excel insists that they need to login.

What could cause that and how can I fix it?

BTW: It works fine when I do it on my computer - no problems. On her computer, it takes forever to load and then it requests a password.

Thoughts?

The code belonging to the page is below...

<?php

include("../carter.inc");
$cxn = mysqli_connect($host,$user,$password,$database)
or die ("couldn't connect to server");
$bruce="select org_name from organization where id = '$_GET[org_id]'";
$bruce_query = mysqli_query($cxn, $bruce)
or die("Couldn't execute query.");
$bruce_row=mysqli_fetch_assoc($bruce_query);
extract($bruce_row);
$the_org_name = stripslashes($org_name);
$org_id = $_GET['org_id'];
$today = date("m/d/Y");
?>


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>The Rainmaker Academy | Revenue Action Plan</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<script type="text/javascript" src="../swfobject.js"></script>
<link href="../stylesheet.css" rel="stylesheet" type="text/css" />
</head>

<body>


&nbsp;<BR>
<table width="800" cellspacing="3" cellpadding="3" border="1" align="center">
<tr>
<td colspan="2">
      <table cellspacing="0" cellpadding="0" width=100%>
      <tr>
      <td>
      <b>RAP Sheet for <?php echo $the_org_name; ?></b><BR>
      revenue for this marketing period up through <?php echo date("m/d/Y", strtotime($today)); ?>
      </td>
      </tr>
      </table>
</td>
</tr>
<tr>
<td colspan="2">
      <table border="0" width=100%>
      <tr>
      <td rowspan="2">
      Student Name
      </td>
      <td rowspan="2">
      Class Name
      </td>
      <td colspan="2" align="center">
      Actual Revenue
      </td>
      <td rowspan="2" background="images/spacer.gif" width="100" height="10">
      % of Goal
      </td>
      <td rowspan="2">
      Total Income
      </td>
      </tr>
      <tr>
      <td align="center" width="150">
      New
      </td>
      <td align="center" width="150">
      Existing
      </td>
      </tr>
      <?php
      $grand_new = 0;
      $grand_existing = 0;
      $grand_total=0;
      $michelle = "select * from students where organization = '$the_org_name' order by last_name";
      $michelle_query=mysqli_query($cxn, $michelle)
      or die("Couldn't execute query.");
      while($michelle_row=mysqli_fetch_assoc($michelle_query))
      {
      extract($michelle_row);
      $your_student_id = $id;
      ?>
      <tr>
      <td>
      <A HREF="student_activity_validate.php?id=<?php echo $your_student_id; ?>" target="_blank"><?php echo stripslashes($first_name).' '.stripslashes($last_name); ?></a>
      </td>
      <td>
      <?php
      if($class=="" OR $class==" " OR empty($class)){
      echo "&nbsp;<BR>";
      }
      else
      {
      echo stripslashes($class);
      }
      ?>
      </td>
      <td>$<?php
      $flinch="select SUM(actual_revenue) from revenue where student_id = '$your_student_id' and client_type<> 'Top 7 Client' AND client_type<>'Marketing'";
      $flinch_query=mysqli_query($cxn, $flinch)
      or die("Couldn't execute query.");
      $flinch_row = mysqli_fetch_assoc($flinch_query);
      $new_total = $flinch_row['SUM(actual_revenue)'];
      echo number_format(($new_total),0);
      $total_new_revenue = $new_total;
      $grand_new+=$total_new_revenue;
      ?>
      </td>
      <td>$<?php
      $bingo="select SUM(actual_revenue) from revenue where student_id = '$your_student_id' and client_type='Top 7 Client'";
      $bingo_query=mysqli_query($cxn, $bingo)
      or die("Couldn't execute query.");
      $bingo_row = mysqli_fetch_assoc($bingo_query);
      $current_total = $bingo_row['SUM(actual_revenue)'];
      echo number_format(($current_total),0);
      $total_existing_revenue = $current_total;
      $grand_existing +=$total_existing_revenue;
      ?>
      </td>
      <td><?php
      //estimated fees from revenue
      $esther = "select est_fee, probability FROM revenue where student_id = '$your_student_id'";
      $esther_query = mysqli_query($cxn, $esther)
      or die("Couldn't execute query.");
      $alan_goal=0;
      $alan_goal_total=0;
      while($esther_row=mysqli_fetch_assoc($esther_query))
      {
      extract($esther_row);
      $alan_goal = $est_fee*($probability/100);
      $alan_goal_total +=$alan_goal;
      }
      $alan_total = $alan_goal_total;
      $total_est_fee = $alan_total;
      $total_revenue = $total_existing_revenue + $total_new_revenue;
      $grand_total +=$total_revenue;
      //I've got to build in a way to accommdate those situations where there is no revenue, otherwise you get an error that says "division by zero"
            if(!$total_revenue==0)
            {
            $output = ($total_revenue / $total_est_fee)*100 ;
            echo number_format($output,2);
            }
            else
            {
            echo "0.00";
            }
      ?>%
      </td>
      <td>$<?php
      echo number_format($total_revenue,0);
      ?>
      </td>
      </tr>
      <?php
      }
      ?>
            <tr>
      <td colspan="6"><HR>
      </td>
      </tr>
      <tr>
      <td>
      Total New Revenue:
      </td>
      <td colspan="4">$
      <?php echo number_format($grand_new,0); ?>
      </td>
      </tr>
      <tr>
      <td>
      Total Existing Revenue:
      </td>
      <td colspan="4">$
      <?php echo number_format($grand_existing,0); ?>
      </td>
      </tr>
      <tr>
      <td>
      Grand Total:
      </td>
      <td colspan="4">$
      <?php echo number_format($grand_total,0); ?>
      </td>
      </tr>
      </table>
</td>
</tr>

</body>
</html>
0
Comment
Question by:brucegust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
armchair_scouse earned 500 total points
ID: 37788204
Does your user have the same rights as you to access the database/datbase server that you are connecting to in the line:

$cxn = mysqli_connect($host,$user,$password,$database)

Perhaps the rights have changed?  Could you create a simpler script that just tries to connect to the server and then returns the name of the server to the user, to prove that he/she can connect OK?

Just a thought.
0
 

Author Comment

by:brucegust
ID: 37788242
Rights haven't changed so that's not a problem.

What else could I do to connect to the server that constitutes a simpler approach?
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question