www.webdeveloper.com
Results 1 to 4 of 4

Thread: linking localhost files

  1. #1
    Join Date
    Apr 2013
    Posts
    39

    linking localhost files

    Hi fellas, I have 3 working php files in my "htdocs" folder,
    and an html file.
    My
    HTML Code:
     link.html file : <table  width="180" border=0>
    <tr>
    <td><a href="file1.php" target="Main">file1</a><br></td>
    <tr>
    <td><a href="file2.php" target="Main">file2</a><br></td>
    <tr>
    <td><a href="file3.php" target="Main">file3</a><br></td>
    </tr></table>
    clicking a link does not execute the php files?

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,923
    Are you opening the HTML file in your browser via a "localhost" URL, or via the File menu. (The latter probably won't work.)
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Sep 2013
    Posts
    221
    I have run the above code.The link opens the new page in different tab and not reloading the same page itself. If target="Main" is removed then the same page is loaded. Save the by file1.php extension. May be this one help you out.

  4. #4
    Join Date
    Apr 2013
    Posts
    39
    Thought I'd keep this from getting verbose but here it is.
    I've had this same problem for months.
    I haven't been learning PHP for long so this slowed my prograss.
    The #1 code links to the files, #2 is one file (apdue.php) I
    want to use & #3 is the result. I first keyed in "localhost/invoice/apdue.php"
    & got the result I want (ecept this)
    Parse error: syntax error, unexpected 'm'
    (T_STRING) in C:\xampp\htdocs\invoice\apdue.php on line 8
    <html><body bgcolor="#ccffff"><p>
    <table bgcolor=red width="180" border=0>
    <tr>
    <td><b>Data entry/adjust</b></td<br>
    </tr></table>
    <table bgcolor=pink width="180" border=0>
    <tr>
    <td ><a href="rateselect.html" target="Main">Establish Tax Rate</a><br></td>
    <tr>
    <td><a href=latestordno.php" target="Main">New Order#</small></a><br></td>
    <tr>
    <td><a href="latestinvno.php" target="Main">New Invoice#/acct#</a><br></td>
    <tr>
    <td><a href="invoicebase.html" target="Main">Print invoice bases</a><br></td>
    <tr>
    <td><a href="invoiceinsert.php" target="Main">Data Input</a><br></td>
    <tr>
    <td><a href="invoice/invupdate.php" target="Main">Adjustments</a><br></td>
    </tr></table>
    <table bgcolor=red width="180" border=0>
    <tr>
    <td><b>Reports</b></td<br>
    </tr></table>
    <table bgcolor=pink width="180" border=0>
    <tr>
    <td><a href="apdue.php" target="Main">Payables Due</a><br></td>
    <tr>
    <td><a href="appaid.php" target="Main">Payables Paid</a><br></td>
    <tr>
    <td><a href="ardue.php" target="Main">Receivables Due</a><br></td>
    <tr>
    <td><a href="arpaid.php" target="Main">Receivables Paid</a><br></td>
    </tr></table>
    <table bgcolor=red width="180" border=0>
    <tr>
    <td><small><b>Billing</b></small></td<br>
    </tr></table>
    <table bgcolor=pink width="180" border=0>
    <tr>
    <td><a href="payment.php" target="Main">Payments</a><br></td>
    <tr>
    <td><a href="billing.php" target="Main">Billing</a><br></td>
    <tr>
    <td><a href="envelopes.php" target="Main">Print Envelopes</a><br></td>
    <tr>
    <!--<td><a href="checkrecon.php" target="Main">Check reconciliation</a><br></td>-->
    </tr></table><p>
    <table bgcolor=red width="180" border=0>
    <tr>
    <td><b>Point of Sale</b></td<<br>
    </tr></table>
    <table bgcolor=pink width="180" border=0>
    <tr>
    <td><a href="posinsert.php target="Main">Inventory Input</a><br></td>
    <tr>
    <td><a href="posupdate.php" target="Main">Inventory Adjustments</a><br></td>
    <tr>
    <td><a href="sale.php" target="Main">Point of Sale</a><br></td>
    <tr>
    <td><a href="posinvlist.php" target="Main">Order Sheet</a><br></td>
    <tr>
    <td><a href="genreceipt.php" target="Main">Receipt</a></td>
    </tr></table>
    </center></body</html>
    <?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' and pd = ' '
    $result=mysql_query($query);
    $num=mysql_numrows($result);
    // echo date("m/d/Y") . "<br />";
    echo "<font size=+2><b> Accounts Payable Report<br /><br />";
    echo "<table cellspacing=1 cellpadding=0 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();
    ?>

    "; echo " Accounts Payable Report

    "; echo ""; while($row = mysql_fetch_array($result)) { $totcharges = $totcharges + $row['charges']; $totdue = $totdue + $row['amtdue']; $totpaid = $totpaid + $row['paidamt']; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
    due days
    acct# customer description date late charges paid due
    ==================================================================================================== ===============
    " . $row['acctno'] . " " . $row['bname'] . " " . $row['descr'] . " " . $row['duedate'] . " " . $row['dayslate'] . " " . $row['charges'] . " " . $row['paidamt'] . " " . $row['amtdue'] . "
    ==================================================================================================== =================
    Gtotals " . sprintf("%.2f",$totcharges) . " " . sprintf("%.2f",$totpaid) . " " . sprintf("%.2f",$totdue) . "
    "; mysql_close(); ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles