Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Assuming that you are browsing a file/page/script with a ".PHP" extension, you could try turning on php error reporting (which you have partially commented out in your example: error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); Add that after your php tag.
  2. So I am doing a script to read some emails coming into an address that I have piped to it. Done this before and had success. Problem now is strip_tags. Trying to remove some spurious html codes in the email the easy way or so I thought. What's happening is this A line that contains an email address such as this: From: <user@domain.com> is being stripped out to this: From: <user@domain.com> I thought that strip_tags would just strip out the < and > chars but it is not. Any ideas?
  3. On a more serious note: No - it doesn't.
  4. Since one doesn't 'do' a join in PHP, perhaps you should ask in an SQL forum instead of a PHP one?
  5. Read your code very carefully and you will see the problem is two double quotes in succession.
  6. Lard - a very nice response from you. Obviously a well-rounded and well-educated individual. Loved your post. Jacques1 - you could learn a lot from Lard in how to be nice to people. Sure you are a first class nerd and can converse well in PHP and lots of other highly technical fields, but you sorely lack common decency. Even your retorts lack respect. So what if you are correct? You have given me my share of abuse and toyed with me for hours. I take it because you eventually will provide some real help. Too bad we have to put up with your nonsense to get it. And now I suggest a moderator close this topic. We are definitely off course here, but I felt a need to let our newbie OP know that he is not alone here after facing the wrath of jacques1
  7. Since your script didn't work for you I'm guessing it was not truly a PHP file. Sounds to me like you haven't solved the problem but are moving on. Good luck on your journey.
  8. A session usually ends when the browser closes. Maintaining a db connection is a similar thing, although it usually goes away at the end of a script when you send something to the user to see. Consequently, you should develop a good few lines of code to make your db connection and then include that module in each of your scripts that require db access. Something like this: function MakeDBConnection($dbname) { ( your php code to connect and select the database name) return $db_handle; } Be sure to use mysqlI or PDO and not the soon-to-gone MySQL_* functions. And if using pdo use it properly. There's probably a good sticky post here that gives you some correct info on using pdo, highly recommended.
  9. Did you buy your first car before you learned how to drive?
  10. When the users upload their files, you should control the filename it is stored under. Assign the uid as a prefix to every file stored and then when you are looking for docs you just go a glob() with the id as the start of the filename mask. Of course another solution would be to have a db that stores the user's files and identifies the document by date, user id, saved doc name, description... etc. A query for docs by uid would give you the list of filenames. Again you would want them to all be unique filenames so you should be assigning them
  11. Is this some kind of school project that you come here with no code to show at all and only want someone to write you a solution?
  12. What the h... is this video supposed to do with your problem????! OK - just tell us. What is the name of this script file?
  13. "The only example you could find on the internet"? Example of what?
  14. You're trying to write a script (using out dated code1) that will ban users based on their IP?
  15. Focusing on your last point - Can't you look for the occurrence of a new company which indicates that you need to close out the last one before continuing with the just fetched row?
  16. Error reporting: error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); Place at top of your php
  17. Reading the manual like all good php programmers should do I see that there is an install option that must be enabled. Read up on it and see if that is your problem PS - your code worked just fine for me.
  18. How do you create entries in this table? How do you get rid of entries when user is not logged in? How do you know they didn't just close their browser and appear to be still online? This was a topic a couple of weeks ago on some forum and there are a lot of issues with trying to keep track of who is online and who is not. Did you figure out a way to do just that? Love to see your code!
  19. I"ll throw my $.02 in and say perhaps the url you specified is not being opened since it is not technically a 'file'. You could check your get results and see?
  20. HTH!! Although - I'm not sure it's working correctly since I see a single tr / td start tag inside the loop and then a tr / tr end tag after the loop. Where are the other row and element tags created? Makes for some hard reading - especially when you come back next month and want to remember how it works. Does the listBranch function called from the loop finish the started td element and row element? Does the listbranchcontact function create its own row element completely? Might be better to include that in each of the functions so the reader can make better sense.
  21. fetch_assoc returns an array of ONE row. This is how you process query results - grab a row and process it, then loop thru and thru until all rows are handled. Other things - you don't want to start a table inside the while loop, do you? An html table for each row of the results? Also - you don't want to set lastbranch to 'xxx' inside the loop either.
  22. You had the right idea to start with -just bad coding. When you get your query results simply use them to process your data instead of moving them to a local array as you did and then loop thru that. while ($row = $qrslts->fetch()) { (process each row) } No need for the branch_array at all - you already have an array of sorts from the query (actually it's called a 'resource') that you can loop thru with the fetch call. Now - if you are not already doing a fetch before all of your loops then my initial guess was incorrect. At this point Mac_gyver may have given you your answer in that your own code is not processing that first row. Change your code to do just ONE loop using fetch() and let's see the new code.
×
×
  • 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.