Solved

Excel Spreadsheet not opening up without password

Posted on 2012-03-30
2
278 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
2 Comments
 
LVL 9

Accepted Solution

by:
armchair_scouse earned 500 total points
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now