Jump to content

HalfNote5

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by HalfNote5

  1. Oh hell; I should be using php2/test_api13_withpost.php My bad; it works fine, and I'm apparently either low on sleep, have been working on this too long, or have suddenly gone stupid. My apologies.
  2. include('myfile.php'); Technically <?php include("php2/test_api8_withpost.php"); ?> because the "index.php" file is mostly HTML
  3. I have a framework .php file (for right now we'll call it "index.php") Within index.PHP, it includes another PHP (which we'll call PagePanel.php) to show all of the items in a list (or a portion thereof, as dictated by a search parameter, which we'll call "SearchString"). I would like to be able to do a post form submit of "SearchString" to index.php and when index.php loads the included PagePanel.php, it also passes "SearchString" to PagePanel.php's $_POST array. Any easy way to do this? I've been googling it, but I'm evidently not phrasing it correctly.
  4. You are my new best friend.
  5. Question: Would there be a problem storing it temporarily on a server while it is sent? Also, does your E-mail use PGP/keys or is it sent unencrypted? Given you're familiar with HIPAA, I'm assuming that you've already covered that, but you could leave the file in some encrypted format on the server and send the recipients a link to download it which expires (along with the document itself) after, say, a 48 hour period. Being that the link is in the E-mail, you'd prolly wanna use PGP on the mail, too.
  6. Inside a foreach/as loop, in a nested if loop I have this little nugget: else { $currentRec = current($r); echo "Rec to Kill: $currentRec"; //Testing purposes only - Killing the right thing? unset($r[$currentRec]); } It's not working as I'd expect it to (which would be to kill the current record of my 2d array). Of course, I'm a PHP novice, (more used to working with dbase/foxpro) so there's something in transitioning to PHP's logic that I'm most definitely missing. A nudge in the right direction would be lovely. Thanks!
  7. Actually, you were right the first time. Explode is precisely what I need.
  8. Which still begs the question; which PHP function/command should I be using to separate my keywords from my search box into a small array (I'll go check out strpos so I'm not completely ignorant of it in the meantime), and also if a nested foreach/as loop is the correct/prefereable way to go about it.
  9. Yes, precisely. But I should point out that "database" is a misleading term, if I'm strictly supposed to be using PHP parlance. Technically it's a DBF file which is converted into an array. It's NOT a SQL DB. EDIT: I figure since the array already exists, as it's read from the DBF file, then deleting NON-matches might be easier
  10. Wait! I've got it! Since $r is an array of its own, I could simply create an array of keywords (dunno how yet), do a nested foreach/as where it DELETES the row in the array (dunno how yet) if none of the keywords show up. Then $r would behave normally, if I did all this BEFORE running $r thrugh the above script.
  11. Here's the basic code that shows EVERYTHING in the database (see below). I wouldn't mind using the keywords to dump each individual MATCHING record into its own separate array (which I would then feed to this thing instead of the current $v/$di array) )so that the whole $incrementpass bit where it creates a new table row after every three records still functions correctly. It occurs to me; could I take the 16th line down, which is: foreach ($r as $c=>$v)) and do something like (pardon my syntax, I dunno if this is right) foreach (($r as $c=>$v) where (strpos($string, $v) !== false)) but Instead of $string, I'm guessing I'd have to deal with MULTIPLE $strings in the form of an array? And that's where it gets confusing. In VFP I would dump the keywords to a temp table, trip through it each time it iterated, and dump the results to their own array or temp table, then use that to produce the end result. I wouldn't mind doing that here, I just don't quite know how. _______________________________________________________________ $di = dbase_open("php2/test/dwtest.dbf",0); echo "<table width=\"75%\" border=\"1\" align=\"center\">"; echo "<tr>"; $incrementpass = 9; for ($i=1;$i<dbase_numrecords($di);$i++) { $incrementpass = $i; if (fmod($incrementpass,3) == 1 and $incrementpass >=2) { echo "<tr>"; } ; $r = dbase_get_record_with_names($di,$i+1); echo "<td> <div align=\"center\">"; foreach ($r as $c=>$v) { if ($c == "ITEMNO") { echo "Item Number: $v : " ; } else if ($c == "NAME") { echo "$v : <br> " ; } else if ($c == "PICURL") { $v = rtrim($v) ; echo "<img SRC=\"/betapics/$v\" " ; } else if ($c == "LOCALBUY") { $v = rtrim($v) ; echo "<A HREF=\"$v\" target=\"_blank\">" ; } else if ($c == "ALTTEXT") { echo "alt=\"$v Keywords: " ; } else if ($c == "KEYWORDS") { echo "$v \" " ; } else if ($c == "TITLETEXT") { echo "title=\"$v \"> </A> " ; } else if ($c == "DESC") { echo "$v <br> " ; } else if ($c == "CPBUY") { $v = rtrim($v) ; echo "<A HREF=\"$v\" target=\"_blank\"><IMG SRC=\"/betapics/cpbutn.png\" alt=\"CafePressLink\"></A> : " ; } else if ($c == "RBBUY") { $v = rtrim($v) ; echo "<A HREF=\"$v\" target=\"_blank\"><IMG SRC=\"/betapics/rbbutn.png\" alt=\"RedBubbleLink\"></A> : " ; } else if ($c == "ZAZZBUY") { $v = rtrim($v) ; echo "<A HREF=\"$v\" target=\"_blank\"><IMG SRC=\"/betapics/zazzbutn.png\" alt=\"ZazzleLink\"></A>" ; } else if ($c == "BIGPICURL") { echo "<br> <A HREF=\"$v\">Click Here for Large Picture </A> " ; }; ##echo "<br><br><br>$incrementpass<br><br> $c NAME?=$v CONTENT? WHERE-EDNTD_WENT"; } echo "</div></td>"; if (fmod($i,3)==0 and $i!=0) { echo "</tr>"; } } echo "</table>"; echo "<br>lineitem<br>"; dbase_close($di); EDIT: Yes, I know it's a tad sloppy. ; )
  12. Okay, so I don't use PHP a lot, being a FoxPro programmer. That said, I've got a dbf file I need to access from a web page (done, actually, thanks to the magnificent Erwin Kooi and his PHP Dbase solution.) However, the question I have is purely PHP related. If I have a "Search" box on my website, and the user enters multiple keywords, how can I program it to where, as it trips through the array (resulting from the dbf file), it compares EACH INDIVIDUAL WORD in the string to the "KEYWORDS" element in the array so that it can decide whether or not to print that line. I wouldn't even mind feeding the results into their own temporary array so that arranging the results sould be done easier. I have no idea, however, where to begin as I'm pretty new to PHP. Knowing EXACTLY how to do this sort of thing in another programming language doesn't really help in a DIFFERENT language. ; ) I'd really appreciate a nudge in the right direction. Thanks! -DW
×
×
  • 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.