Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. Nice solution. I like that. I will try it out and see how it goes. Thanks.
  2. I have been getting a lot more client requests to protect files. What is the easiest way to do this. So, basically I have tried doing it outside the public directory. There are too many things that cause issues with this. I haven't been able to get a successfull implementation of this since I started working with this. So I was thinking instead about password protecting a directory that is inside public view, but still get files via PHP. Is there a way to setup a password protected directory, then retreive stuff from that directory using PHP. Or, a good way to put them outside the public folder. Everything I have tried to do to get a file to save outside of public view, has not worked. It always says uploaded but the file is never there. Also, I have verified correct permission for this as well.
  3. Yes, I had considered the Open SVN choices. I was trying to find something kind of like Codevault, just a little less buggy. Where you can create all your stuff in a file manager type interface. Not sure if anything is out there, or whether I will try to build one on my own at some point. Just wanted to see if it was out there already. I did quite a bit of looking and Codevault was all I had found.
  4. Does anyone know of, or use, an online code repository. Some kind of service for programmers to have the ability to load up files, or sets of files. For example, parts of projects so you can re-use implementations. A place to also keep small code snippets, as well as a larger collections of files for simple applications. I would rather find a place on line, than in my personal databases. Any advice is appreciated.
  5. That is a possibility. I have personally never encountered that. I have worked on a variety of webhosts (godaddy, 1and1, bluehost, and many I don't recall). I have also worked on dedicated, and virtual servers. There is a chance that some hosts will not let it send that way. However, I have not encountered this problem personally before.
  6. I normally just put the from email (the person sending) as the from address. There is no reason, not to do this. If you do not want to, then just put their email address in the message. I normally just make it the "From" address. $headers = 'From: ' . $from_email; Then just pass that as extra_headers into the mail command.
  7. Please refer to: http://www.phpasks.com/articles/introductiontoabstractclassesinphp.html This seems to answer all of your questions. 1.) If an Abstract Class cannot be instantiated, then how can there be Properties? - This is answered in detail in the reference link I provided. 2.) I guess $fields is supposed to be an array? In the situation of the code you provided, then yet. How do I know that? Because Post is always an array, even if it's empty
  8. Review this: http://www.google.com/#sclient=psy&hl=en&q=php+state+saving&aq=f&aqi=g2g-o1&aql=&oq=&gs_rfai=&pbx=1&fp=ddfbf15c2e2f4021 PHP cannot maintain data integrity between pages, without some form of state saving. Even something so simple as pre-populating or re-populating form fields requires some form of data saving/communication. Whether you send it via $_GET, $_POST, $_REQUEST (a combination of both), $_COOKIE, $_SESSION, flat file, or database. The simplest out of thees options for what you are trying to do, is simply perform what was suggested. Re-acquire the $_POST responses on submission and use those to re-populate the form appropriately.
  9. I noticed that you marked your issue as resolved. I am glad you got it worked out. If you ever need anything else, feel free to post it in the forums.
  10. Try what you mentioned. If it does not work, post back here. If you can't get the issue resolved, or still need help, then send me a personal message and I will take a look at the script for you myself.
  11. Your going to need to throw in some debugging text. After each main action, echo out the subject. Echo it right after the Subject is received, again after the regular expression work, and again right after the mail sends. Try a combination of echo's. The first step is to identify, where in your script the subject is being messed up. First verify you are receiving the subject correctly to begin with. Post your results here.
  12. I would need more information to help thoroughly but the basic steps required are below: 1. Get your data together. Whether it's from Mysql, Flat File, or Excel. Get this into a PHP array or other form of structure that can be looped through. 2. Loop through it and build a string, which will be your XML. 3. Pass it to the browsers with XML headers, which will prompt for download. Reference Material http://articles.techrepublic.com.com/5100-10878_11-5035149.html http://www.devshed.com/c/a/PHP/Building-XML-Trees-With-PHP/ http://www.ibm.com/developerworks/library/os-xmldomphp/ http://www.justskins.com/forums/php-can-php-build-28972.html http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_22675819.html http://www.google.com/#hl=en&expIds=25639,25657,25982,26637,27060,27182,27284&sugexp=ldymls&xhr=t&q=php%2C+build+XML+file+from&cp=24&qe=cGhwLCBidWlsZCBYTUwgZmlsZSBmcm9t&qesig=-FELrSd129YVn52LjbqZDg&pkc=AFgZ2tkG5XEVpN0Jl8jVCdpoP8xnRQ6mghJ5B8IurVOuIDthIy42n2cHzrtOdSWkYcKCT_w02Uo78m25UgN2XJ1B9DZI-Lh83w&pf=p&sclient=psy&aq=f&aqi=&aql=&oq=php%2C+build+XML+file+from&gs_rfai=&pbx=1&fp=ddfbf15c2e2f4021
  13. This is most likely a PHP or server internal setting issue. I would need more information regarding the code used to be able to help further. Reference Links http://www.mydigitallife.info/2007/03/15/php-scripts-open_basedir-restriction-in-effect-error/ http://www.karakas-online.de/forum/viewtopic.php?t=1586 http://www.sixapart.com/movabletype/kb/dynamic/open_basedir_re.html http://www.geeklog.net/forum/viewtopic.php?showtopic=28107 http://www.google.com/#sclient=psy&hl=en&site=&source=hp&q=open_basedir+restriction+in+effect&aq=f&aqi=&aql=&oq=&gs_rfai=&pbx=1&fp=ddfbf15c2e2f4021
  14. I would need to get more information. From what I can tell, what you want to look into are mapping tables. Mapping Table References http://www.wellho.net/solutions/mysql-many-to-many-table-mapping-pivot-tables.html
  15. Option 1: http://www.ibdhost.com/errors/ - Read that and do what it says. Option 2: Everytime there is a 404 error file, grab the server log file with PHP and scrape information on the latest missed page.
  16. According to my tests, that isn't working. If I do 2.5 (2 and a half pounds) and do 2.5 * 16 it's not calculating out correctly. That is what I had originally thought when I tried the conversion the way that was suggested (using standard math) but the values are off for some reason.
  17. What is the easiest way in PHP to convert pounds into ounces. So 2.3 pounds would = 35 ounces. Is there an easy way to do this type of conversion?
  18. On the frontend a state and profession are selected. This is used to filter which products show up. For state verbiage I need to get the verbiage associated with that product/profession/state. The verbiage would change if any of these 3 things changed (profession, state, or product). I have a general idea of how i want to do it, but pulling all this on the frontend with PHP is going to get tricky. Wanted to see if anyone had any ideas to toss around before I tried the catch all mapping table and just pulled them out on a case by case basis.
  19. I have a general questions. 1. I have a list of products. 2. I have a list of each of the 50 states. 3. I have a list of "professions". I need to setup something called "State Verbiage". However, this is going to be on a per product, per state, per profession level. So each profession is mapped up to each state and product. So product #1, in State #4, for profession #2 would have verbiage. Any combination of the three would have different verbiage. Any advice on the easiest way to set this up, would be appreciated.
  20. This is an open questions. I have always reused my code. I go into a past project and strip out some code and re-use it all the time. In what ways do you guys re-use your code? Do you just take it out of projects you had built. I know sometimes I form them into functions if I re-use them a lot. However, after getting up there in projects and have a graveyard of projects you have done, what do you do to keep track of all the code you have written to use as reference?
  21. I currently have 4 upload slots (input fields) for files. I want to be able to hide 3 of them and only show one. Once you click on the first one and choose a file, I want the second one to appear. When you pick that, I want the third one to appear. When you pick that I want the final one to appear, up to a maximum of just teh four. However, later I might be adding more file upload areas and need those to work as well. Is there an easy way to do this in Javascript?
  22. Nevermind, my date formatting was off. Should have been m/d/Y. I adjusted those in the query and it started working fine.
  23. <?php $date = date('Y-m-d'); $strtime = strtotime('today +14 days'); $strtime = date('Y-m-d', $strtime); if ($distributor != 1) { $select = "SELECT deal_data.headline AS headline FROM deal_data WHERE str_to_date(deal_data.end_date,'%Y/%m/%d') BETWEEN str_to_date('" . $date . "', '%Y/%m/%d') and str_to_date('" . $strtime . "', '%Y/%m/%d')"; }else { $select = "SELECT deal_data.headline AS headline FROM deal_data WHERE str_to_date(deal_data.end_date,'%d.%m.%Y') BETWEEN '" . $date . "' and '" . $strtime . "'"; } ?> The dates are formatted in the database as Varchar (I don't do that anymore, this is an old project) and are formatted as: "09/12/2010". Anything wrong with the above code that would make it not work and return queries?
×
×
  • 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.