Saved Bookmarks
| 1. |
Solve : need advice re php access? |
|
Answer» Hi guys, help me with my little coding problem. please.<BR>I key in "localhost/invoice/apdue.php" and get desired 9/28/13 Accounts payable Report but when trying to open apdue.php via the below (invoicenav.html), that should open the apdue.php:, Code: [Select]<html><body bgcolor="#ccffff"><p> <table bgcolor=pink width="180" border=0> <tr> <td><a href="http://localhost/apdue.php">Payables Due</a><br></td> <tr> <td><a href="http://localhost/appaid.php">Payables Paid</a><br></td> <tr> <td><a href="http://localhost/ardue.php">Receivables Due</a><br></td> <tr> <td><a href="http://localhost/arpaid.php">Receivables paid</a><br></td> </tr></table> </center></body</html> I get the below: Quote Object not found!Below is the aforementioned apdue.php: [/quote] Code: [Select]<?php error_reporting(0); mysql_connect('localhost','root',''); mysql_select_db('oodb') or DIE("Unable to select database"); $query=" SELECT * FROM oocust WHERE payrec = 'P' && pd = ' '"; $result=mysql_query($query); $num=mysql_numrows($result); echo date('m/d/y'); echo "<font size=+2><b> Accounts payable Report</font></b></b><br />"; echo "<table cellspacing=1 cellpadding=1 border=0> <tr> <th colspan=3></th> <th>due</th> <th>days</th> <th></th> <th></th> <tr> <th>acct#</th> <th>customer</th> <th>description</th> <th>date</th> <th>late</th> <th align=right>charges</th> <th align=right>paid</th> <th align=right>due</th> <tr> <TH colspan=9>===================================================================</TH>; </tr>"; while($row = mysql_fetch_array($result)) { $totcharges = $totcharges + $row['charges']; $totdue = $totdue + $row['amtdue']; $totpaid = $totpaid + $row['paidamt']; echo "<tr>"; echo "<td>" . $row['acctno'] . "</td>"; echo "<td>" . $row['bname'] . "</td>"; echo "<td>" . $row['descr'] . "</td>"; echo "<td>" . $row['duedate'] . "</td>"; echo "<td align=right>" . $row['dayslate'] . "</td>"; echo "<td align=right>" . $row['charges'] . "</td>"; echo "<td align=right>" . $row['paidamt'] . "</td>"; echo "<td align=right>" . $row['amtdue'] . "</td>"; } echo "<tr>"; echo "<th colspan=9>=====================================================================</TH>"; echo "<tr>"; echo "<td>Gtotals</td>"; echo "<td colspan=4></td>"; echo "<td align=right>" . sprintf("%.2f",$totcharges) . "</td>"; echo "<td align=right>" . sprintf("%.2f",$totpaid) . "</td>"; echo "<td align=right>" . sprintf("%.2f",$totdue) . "</td>"; echo "</tr>"; echo "</table>"; mysql_close(); ?> Pardon my questions. Have you had much experience running PHP locally? Why is not the whole thing done in PHP? Did you already test this code elsewhere? Do you have other PHP programs that run OK? Which PHP do you have? You're going to kick yourself over this! You said: Quote I key in "localhost/invoice/apdue.php" But the link in 'invoicenav.html' goes to: Quote http://localhost/apdue.php You're missing the '/invoice/' in the link to apdue.php |
|