Jump to content

jeffrydell

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jeffrydell's Achievements

Member

Member (2/5)

0

Reputation

  1. The goal is to produce a script which will monitor specified URL's and display a list of links to updated pages. I've been trying to use file() and in_array(), but when I search for specified text, in_array() always returns FALSE. Same thing if I use file_get_contents() and strstr(). This is getting a bit silly as it should be fairly straight forward to search for a specified string within a variable or an array ... but it isn't working. Any thoughts on how I might check web pages (some are dynamic) to see if they have been updated? Thanks in advance for any help you can come up with! Jeff
  2. Thorpe, Thanks for the idea. I'm on a windows server now ... not quite sure how to do those things ... BUT the website will be moving in the next year or so and probably end up on an Apache server for better functionality with all those wonderful .php apps (like Wordpress / Joomla / etc.). At that point I'd probably have to start over - not a good prospect. Other options?
  3. I collect data through my online application for multiple clients. Each client uses their data in one of several PC apps based off Excel, Access, or Filemaker Pro. I'm trying to figure out the most 'fool proof' way for the client to get their data from my db on to their local hard drive (specifically in their db). Up to now I've written a php script which, when given an identifying ID, will query my db and output client-specific info to an .xml file which can then be downloaded. My script then presents the user with a link to that .xml file for downloading. A friend of mine developed a VB script that opens the .xml file from the user's hard drive and maps all the .xml file data in to the appropriate tables & fields in the Access db. This works, but there's too much user interaction (too many opportunities for screw-ups / questions). So I'm looking for a 'better way'. Is it possible for that VB-based program to query my DB directly (with an identifier of some sort so they don't get EVERYBODY's data? OR is there a way to have that VB script start a php script and my script can STREAM the data to their hard drive? Any thoughts or suggestions on where I could learn about 'best practice' for moving data from MySQL to a local PC for use by another app would be greatly appreciated!
  4. Thanks - I ended up using a class that not only retrieves the file (not blob in a table), but it also 'thumbnails' anything wider than 600px down to 600px. Very handy. I appreciate the answer. Jeff
  5. I'm putting together an online test application which can incorporate images in both the questions and the answers. I have to make choice of storing the images in a directory on the server and storing a link in one of the table fields, or storing the images as blobs within an image table in the db. Since the images are small (nothing over 50 - 75k), I figured stashing them in an image table with mime type and a unique name would be the best plan. Upload & store in the db are no problem ... but I'm having a bit of trouble when it comes to rendering these images on the screen after I retrieve them. Before I get yelled at for posting in the wrong place, please read on - this is NOT a coding question! I have been able to retrieve a single image from the db, sent the header info & it came up no problem. I'm not, however, doing very well with displaying multiple images or a combination of text & images. Echo commands after the image don't put anything up on the screen. Before I wail on this too much longer, is it really wise to store images as Blobs in a table when dozens of them will need to be retrieved for any one test, or should I just store paths and let html tags do all the work when it comes time to throw a test up on the screen?
  6. You hit it - It was set to only accept cookies from the original site, not from the 'third party' site. Thanks!
  7. Any guidance on how to make Safari pass session variables? I have a set of php scripts which pass data between themselves. The scripts are accessed through an iframe in pages on other people's websites. These scripts work just fine with every browser EXCEPT Safari (on either Mac OR Windows). Anyone have experience with this? I've Googled without success. Thanks!
  8. Plain & simple (to avoid any confusion), $dt2snd is a string. The string is formatted as 2007-08-25. If I explicitly include a fixed value in a MySQL INSERT statement, the value goes in to the record just fine, but when I reference a variable which is a string formatted exactly the same way, I get 0000-00-00 in the record. The question is, do I need to do anything to a string which is formatted according to the MySQL date 'format' in order to be able to put that variable's value into the record being inserted?
  9. I have a date in a variable - supposedly formatted properly for MySQL's date field type. (YYYY-MM-DD). When I attempt to insert a new record in a table, the date doesn't store properly. $sql = "INSERT INTO `dogs` (`owner_id`, `callname`, `breed`, `sex`, `birthdate`, `height`, `accessid`, `accesstype`) VALUES ($oid, '$nm', '$brd', '$sex', '$dt2snd', '$ht', $aid, '$atyp')"; ... always ends up with the birthdate field reading '0000-00-00', whether I put quotes on the $dt2snd or not. Any suggestions on what to do or where to 'read up'?
  10. Looking for a general (and hopefully unbiased) opinion from y'all... I have been using phpMailer for the past 6 months or so and have been quite happy with it in the simple uses that I've implemented. I'm looking for help on something a little more advanced now and it seems like there has been almost no activity with the project for quite some time. Is phpMailer - in your estimation - worth continuing with, or should I be looking to use a class that is being more actively supported? Thanks freaks! (You know I mean that in the best way possible.)
  11. Thanks - removing the quotes did it. I don't know how many times I've set up that type of scenario and never put those quotes in before ... guess it goes with being human. Here's a similar issue ... the array element $Dog['dog_id'] is null - I know, I tested for that: if ($Dog['dog_id'] !== "") { $sql = mysql_query("SELECT * FROM `dogs` WHERE `dog_id` = " . $Dog['dog_id']) or die(mysql_error()); $row = mysql_fetch_array($sql); // Line 838 $Dog['breed'] = $row['breed']; $Dog['sex'] = $row['sex']; $Dog['birthdate'] = dateconvert($row['birthdate'], 2); } ... as you can see, I already tried the "or die()" method of troubleshooting and got: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 (MySQL's usual 'ever so helpful' error messaging.) Prior to that, the error message from php was: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\...\script.php on line 838 ... which indicates to me that the IF() evaluated true, even though it SHOULD have been false because of !==""; Anyone????
  12. Not quite sure how I'm getting THIS warning message: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in E:\...\script.php on line 796 From THIS code: $sql = @mysql_query("SELECT `owner_id` FROM `owners` WHERE `email` = '" . $Owner['email'] . "' AND `zipcode` = '" . $Owner['zipcode'] . "'"); if (mysql_num_rows($sql) > 0) { $row = mysql_fetch_assoc('$sql'); $Owner['owner_id'] = $row['owner_id']; } In order to 'get in' the IF, doesn't there have to be at least one row matching the query string? And if there IS one row, how can I get a message saying it's not a valid resource? Thanks for whatever help you can offer!
  13. Thanks lemmin - it worked fine in a 'shorty script'.
  14. roopurt18, First ... "I don't mean to be rude, but it sounds like..." A long time ago I learned that everything preceding the word "but" is a lie. Now, as for WHY I didn't just use session_destroy() (which, by the way, I looked it up on the php manual website) the manual states: session_destroy() destroys all of the data associated with the current session. It does not unset any of the global variables associated with the session, or unset the session cookie. That second part is the rub ... I didn't know if there was a better way which would unset the global variables associated with the session and unset the session cookie as well. Yes, it's a fairly complicated project I'm working on. I'm also 'self-taught' (with a little assistance & guidance from helpful people ... some of which use this forum) and I'm learning a lot along the way. I'm sure with your rather extensive knowledge of php you understand that there is a lot to learn and MOST people don't know it 'all' as soon as they start writing code. The single hardest part of learning a language and everything that comes with something like php is finding the correct term for what you need. Without knowing the correct terminology, it's rather difficult to know if you've "looked up" all the possible information relating to what you're doing. Such was the case here. If 'our' questions are annoying or simplistic to you - I suggest that you might consider going out and getting more freelance work so you can show off your "brilliance" for pay ... perhaps creating something worthwhile in the process ... rather than 'dumping' on those of us who are honestly trying to learn and want to use this community for what it was intended. Oh, and by the way - I DID mean to be rude. Have a nice day.
×
×
  • 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.