Jump to content

Moron

Members
  • Posts

    369
  • Joined

  • Last visited

Everything posted by Moron

  1. As the title says.... we have an old SCO OpenServer box with a database that contains archived info. We can't shut it down for this reason. I found an old database export from years ago in .DBF format, which I can easily convert to an Excel spreadsheet. But the problem is that it's the newest export we have and it's from 2006. I need one that covers through 2013 after they stopped inputting data. Is there a way to either: 1. Run another export? 2. Connect to it via ODBC (I have the root credentials)? If I can somehow get this database into Windows in whatever format, we can shut this box down. Another "option" is to virtualize it, but that's complicated and it sounds like putting lipstick on a pig to me. All help is appreciated.
  2. Yes, I'm using a relative path. If I use the full path (http://server/folder/subfolder, etc.....), it crashes.
  3. No, From Windows Explorer, they open in Notepad. From the browser, they open in a browser window. You can hover the mouse over each file listed and look at the bottom bar of the browser, and it will be pointing to a different file name. That's why they aren't matching.
  4. Aha! For some crazy reason, it will display one file name, but point to a different one! So where's the bug?
  5. Now there's a weird problem. I navigate to the folder in Windows Explorer and click a file, it has tons of information. I click it from this PHP page and it has just a couple of lines. It's obviously a different file, but the names match exactly. This is total Twilight Zone. Ideas?
  6. Ah. You're absolutely right I ot momentarily confused by the file names. Thanks a ton! .
  7. Thanks. That's closer, but it's sorting by file name (descending) and I need it to sort by file modified date (also descending, newest on top).
  8. In other words, my code does exactly what I want except for the sorting.
  9. Sorry to be so dense, but I don't write PHP every day. How do I integrate this into my existing code?
  10. I'm displaying the contents of a folder, with each file clickable. I can't seem to get it to sort by file date, with the most current on top (descending). What am I missing here? <?php echo "<h1>File Listing</h1>"; $content_array = array(); $path = "../FOLDER/Subfolder/"; $dh = opendir($path); $handle=opendir($dirname); $i=0; while (($file = readdir($dh)) !== false) { if ($file != "." && $file != "..") { $content_array[$i][0] = $file; $content_array[$i][1] = date ("Y m d", filemtime($dirname."/".$file)); $i++; } foreach($content_array as $res) $sortAux[] = $res[1]; array_multisort($sortAux, SORT_DESC, $content_array); echo "<a href='$path/$file' target=\"\_blank>$file</a><br />"; } closedir($dh); ?>
  11. Just wanted to let you know that I'm still here. I had a family emergency earlier in the week and finally got to revisit this yesterday. There are two php.ini files on this server (2008 R2, IIS 7.0); one in C:\Windows and one in C:\Program Files (x86)\PHP\v5.3\php.ini. I made your recommended changes to BOTH because I'm still confused between "Configuration File (php.ini) Path," which points to C:\Windows, and "Loaded Configuration File," which points to C:\Program Files (x86)\PHP\v5.3\php.ini. As in, which is the "real" one? Anyway, after making your recommended changes to BOTH php.ini files, I not only stopped and restarted the website through Internet Services Manager, I also stopped and restarted the World Wide Web Publishing Service. Still, phpinfo() shows exactly ZERO changes; error_reporting is still set to "22527" and display_errors is still set to "Off," pretty as you please. So until I can figure out what this boneheaded crap is, I can't implement your suggestions. And quite frankly, this is making me feel like a total idiot.
  12. Also, the Results page is back to showing me the full page code if I View Source. Help.....
  13. Okay, I have an update and it gets weirder by the minute. I replaced the "<?" tags with "<?php." All fine and good. Except......I can't do this on the very first tag. If I use the short tag, I get this: I know the data is there (and plenty of it), yet it shows me nothing. If I use the long tag, only on this first tag at the top, I get a blank page.
  14. Thanks, everyone, and sorry about my delayed response. What a day. Okay, from the top..... I went back and removed all of the suppressors (@) from the code. PFM, you are correct. I did exactly that, searched and replaced "<?" with "<?php." I'll go back in and fix that. For some reason, it no longer displays the php code when I right-click and View Source. I don;t know what "fixed" that. And again, I appreciate everyone's suggestions.
  15. Thanks, but.......it still comes up totally blank.
  16. EDIT: I think I misunderstood you. Sorry about that. On the same file that shows me nothing, I can echo things and they display properly.
  17. Nope. It's all long tags. Here's the code: <?php $msconnect=sqlsrv_connect('SERVERNAME','username','password') or die ("Could not connect to database: ".sqlsrv_get_last_message());; $msdb=sqlsrv_select_db("TableName",$msconnect) or die ("Could not connect to table: ".sqlsrv_get_last_message());; ?> <?php if($_POST['THOUSE'] || $_POST['TNSEW'] || $_POST['TSTNAM']) { $where = " WHERE (THOUSE LIKE '%{$_POST['THOUSE']}%' AND TNSEW LIKE '%{$_POST['TNSEW']}%' AND TSTNAM LIKE '%{$_POST['TSTNAM']}%')"; $order = " ORDER BY THOUSE, TNSEW, TSTNAM"; } elseif ($_POST['TRECTN']) { if (!$_POST['TTAXYRa']) { $_POST['TTAXYRa'] = date("Y"); } $where = " WHERE (TRECTN = '{$_POST['TRECTN']}' AND TTAXYR = '{$_POST['TTAXYRa']}')"; $order = " ORDER BY TRECTN"; } elseif($_POST['TNAME1']) { $where = " WHERE (TNAME1 LIKE '%{$_POST['TNAME1']}%')"; $order = " ORDER BY TNAME1, TNAME2"; } elseif($_POST['TMAPN'] || $_POST['TMAPA'] || $_POST['TPARCL'] || $_POST['TGROUP'] || $_POST['TPICOD'] || $_POST['TSPCIN']) { $where = " WHERE (TMAPN LIKE '%{$_POST['TMAPN']}%' AND TMAPA LIKE '%{$_POST['TMAPA']}%' AND TPARCL LIKE '%{$_POST['TPARCL']}%' AND TGROUP LIKE '%{$_POST['TGROUP']}%' AND TPICOD LIKE '%{$_POST['TPICOD']}%' AND TSPCIN LIKE '%{$_POST['TSPCIN']}%')"; $order = " ORDER BY TMAPN,TMAPA,TPARCL"; } else { header("location: TestSearch.php"); } if ($_POST['TTAXYR'] && !$_POST['TTAXYRa']) { $where .= " AND (TTAXYR = ".date("Y").")"; } $order .= ", TTAXYR DESC"; $query = "SELECT TRECTN,TTAXYR, TNAME1, TSTADR, TTXAMT, TTXBAL, THOUSE, TNSEW, TSTNAM FROM viewTAXINFO_FULL $where $order"; $result = @sqlsrv_query($query); if (@sqlsrv_num_rows($result) == 1) { $row = @sqlsrv_fetch_assoc($result); header("location: TestView.php?TRECTN={$row['TRECTN']}&TTAXYR={$row['TTAXYR']}"); exit; } ?> <html> <head> <title>CITY OF OAK RIDGE PROPERTY TAX SEARCH RESULTS</title> <style> <!-- /* Font Definitions */ @font-face {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} h1 {margin:0in; margin-bottom:.0001pt; page-break-after:avoid; font-size:12.0pt; font-family:"Times New Roman";} p.MsoBodyText, li.MsoBodyText, div.MsoBodyText {margin:0in; margin-bottom:.0001pt; font-size:10.0pt; font-family:Verdana; color:black;} p.bodytext, li.bodytext, div.bodytext {margin-right:0in; margin-left:0in; font-size:10.0pt; font-family:Verdana; color:black;} @page Section1 {size:8.5in 11.0in; margin:.2in .2in .2in .2in;} div.Section1 {page:Section1;} table { font-family: Arial, Helvetica, sans-serif; font-size: 11px; } --> </style> <link rel=Original-File href=TestSearch.php> <style type="text/css"> <!-- .style1 { color: #FFFFFF; font-weight: bold; } --> </style> </head> <center> <body lang=EN-US topmargin="5" leftmargin="3"> <div class=Section1> <table width="480" border="0" cellspacing="1" cellpadding="1"> <tr> <td width="230" bgcolor="#006633"><span class="style1"><center>Owner</center></span></td> <td width="190" bgcolor="#006633"><span class="style1"><center>Address</center></span></td> <td width="10" bgcolor="#006633"><span class="style1"><center>Tax Year </center></span></td> <td width="25" bgcolor="#006633"><span class="style1"><center>Tax Amount</center></span></td> <td width="25" bgcolor="#006633"><span class="style1"><center>Balance </center></span></td> <td width="25" bgcolor="#006633"><span class="style1"><center>Receipt </center></span></td> </tr> <?php if (@sqlsrv_num_rows($result) > 0) { ?> <?php while($row = @sqlsrv_fetch_assoc($result)) { ?> <tr> <td bgcolor="#E2E2E2"><a href="TestView.php?TRECTN=<?php= $row['TRECTN']; ?>&TTAXYR=<?php= $row['TTAXYR']; ?>"> <?php= $row['TNAME1']; ?> </a> </td> <td bgcolor="#E2E2E2"> <?php= $row['THOUSE']; ?> <?php= $row['TNSEW']; ?> <?php= $row['TSTNAM']; ?></td> <td bgcolor="#E2E2E2"> <div align="center"> <?php= $row['TTAXYR']; ?></div></td> <td align="right" bgcolor="#E2E2E2">$<?php= number_format($row['TTXAMT'],2); ?></td> <td align="right" bgcolor="#E2E2E2">$<?php= number_format($row['TTXBAL'],2); ?></td> <td align="right" bgcolor="#E2E2E2"><?php= ($row['TRECTN']); ?></td> </tr> <?php } ?> <?php } else { ?> <tr><td colspan="5">Search yielded no results.</td></tr> <?php } ?> </table> </center> </body> </html> And again, this same code (modified here to remove private info) runs against the same SQL server just fine from another web server. I'm stumped.
  18. But if I go: <? php echo "Testing"; ?> ...it will echo it fine. The browser doesn't display the PHP code; it's only when I View Source. We also have other things running in PHP on this server.
  19. I did this, and WOW. View Source shows me the entire PHP page, including the connection statement with user name and password. So what does this mean?
  20. Yes. Authentication is done with SQL Server accounts, and the same account hits this server from the old web sever just fine.
  21. I did, and it made the "-mssql" and "-sqldrv" go away, so I'm thinking that they successfully loaded.
  22. Thanks. I made both changes, saved the file, then stopped and restarted the website in IIS. Same result.
  23. It pulls no data. I have a "die" statement and it shows nothing. The exact same file ran from the old web server pulls data galore.
  24. We're moving to a new web server and we recently migrated to a new MS SQL server, as well. All PHP functions on the old web server were switched to point to the new SQL server and all was well. But..... Now I''m trying to move my PHP functions to the new web server and it won't connect to the database. PHP works fine because I can echo "Testing" or whatever. I've downloaded the SQL Server PHP drivers from Microsoft, changed the connection string from MSSQL to SQLSRV, updated the PHP.ini file, and taken several other steps. It still can't see the database. Ideas? Oh, yeah. And both the new web server and MS SQL server are Server 2008 R2.
×
×
  • 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.