Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. Google is your friend: http://www.google.com/search?hl=en&q=php+database&btnG=Google+Search
  2. I may be blind, but I didn't see any variable names with a dot in them.
  3. Well, even if you keep the images in a DB you still need to decide how you'll store them on your file system. Each method (categorizing by user name / id or just dumping into a single directory) has its advantages and disadvantages.
  4. This is just a wild guess and might not do it, but in your ajax callback functions, replace: if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") with: if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
  5. I think redbull has seen some of the same mpgs and avis I have. As far as piggybacking, irregardless of what the piggybacker is doing, I don't really think it's wrong.  It's the responsibility of the network owner to set their stuff up correctly and just about every router contains instructions to do so. I think one of the major downfalls of society is the lack of accountability.  If you leave your network open to the public and someone else uses it for illegal purposes, whether you like the idea or not, you're an accomplice.  Now if someone had taken steps to protect their network and someone broke into it, you're a victim and innocent bystander.
  6. Yes. I wanted to use my pogo stick cat (http://www.ibswebview.com/test/ps/rita_pogostick.jpg) but it was just too small so I opted for a stupid picture of myself instead.
  7. These are typically one and the same. It just means you're sharing the host with other users and your PHP and Apache, for the most part, are configured just like everyone else's. While you might be able to customize your PHP or Apache installation, you can't do it by accessing the httpd.conf or php.ini that controls the entire server because then your changes would affect everyone else. If you need greater control over your server, you need a VPS (we use serverpowered VPS for work) or dedicated server.
  8. I have a feeling you shouldn't have taken this class.
  9. roopurt18

    arby's

    Arby's horsey sauce is a shadow of what it once was.
  10. I think he meant "The simple solution..." After reading his post I immediately googled for "Simple Solution" and came up with all sorts of cleaning products.
  11. Just curious, how many developers worked on your reporting tool and how long did it take to write?
  12. Has anybody here had experience with custom reporting on a large scale? Our web product is an extension of a server system that, as one of its primary functions, generates many reports. We do custom reporting in our server system; however we have the problem that these custom reports require a lot of programming work. Everything in our server reports is so hard-coded that even a simple request to change a font-size could require several hours of work, which is ridiculous. Our reports will need to be invoked from the web interface, pull data from our MySQL database, and preferably dump output as a PDF file. In addition, we need to accommodate client requests such as "Can we take the current sales report and change the < insert_random_field_or_item >?" Basically, all of our clients want slight modifications to existing reports, and as a consequence of poor design the reports in our other system look like this: if(client == THIS_CLIENT) DO THIS else if(client == SOME_OTHER_CLIENT) DO THIS INSTEAD else if( ) ... else DO DEFAULT REPORT This is something we probably won't be addressing for a couple more months, but I see us as having two options. Either we use an existing product or I develop one for us. I'm much more in favor of using an existing product as it would be time-consuming for me to do this all myself. I'm not trying to place the burden of designing the reports on our clients, we can train our own employees to use software to create the reports for our clients and expose the reports to them. Once we get closer to addressing this issue I'll be doing some research into existing products, I'm posting this because someone here might be able to give me a head start in the best solution. Cheers!
  13. Exactly. I figured I'd go ahead and try it and as soon as I started to try and access one elsewhere I realized it wasn't going to happen. You can only access a class var through an instance in PHP4, which means I would have had to create an instance of the object to be accessed globally. So I guess the answer to my question is it leads to bad programming practice, at least in PHP4. I had other concerns, if it had even worked, about the "constants" not really being constants. And as far as typing is concerned, there's really not much difference between the two: $var = Module::CONST_VALUE; // Using mechanisms in PHP5 $var = MODULE_CONST_VALUE; // Using define() I just prefer the OOP aspect of the first method more, which I'm sure you agree with. Ultimately it was just a quick idea I had, figured I'd post before trying it out, and it ultimately turned into a scenario where it would have been better to remain silent and thought a fool than post and remove all doubt.
  14. Never mind. It's syntactically incorrect, at least as far as PHP4 is concerned.
  15. There is a high likelihood that data not belonging in the PDF is being sent as well as the PDF information. Whether its your code sending this data or the class is hard to determine from our standpoint. You might try inserting this line from the snippet I pasted somewhere near the top of your script: while (@ob_end_clean());
  16. Would you call it bad practice to expose "constants" through a "namespace" using the class keyword? <?php class Module { var $CONST1 = 1, $CONST2 = 2, $CONST3 = 3; } // Elsewhere in the code switch($val){ case $Module::CONST1: break; case $Module::CONST2: break; case $Module::CONST3: break; } ?> I can think of a few reasons not to do it, but the usage just appears more object oriented.
  17. I notice you left off three of the headers, which could make a difference. Other than that I suppose it looks pretty solid.
  18. This is a code snippet I used to dump a PDF file created with PDFLib. Do not just blindly copy and paste this expecting it to work. Take note of the headers and try to apply them to your situation. function DirectOut(){ while (@ob_end_clean()); $p = $this->PDF['PDF']; $buf = PDF_get_buffer($p); $len = strlen($buf); header("Content-disposition: attachment; filename=Catalog.pdf"); header("Cache-Control: cache, must-revalidate"); header("Content-type: application/pdf"); header("Content-Length: $len"); header("Pragma: public"); header("Expires: 0"); print $buf; exit(); }
  19. If you've only got a handle on the basics, start specializing. The difficult part of programming is not learning a language but creating and implementing a design. I have a simple assignment for you! Create a linked list in PHP and then create an RPN calculator using your linked list. This is a fairly straight forward task in a language like C / C++ and very easily accomplished in PHP. It won't be incredibly useful, but it will give you practice implementing something you had to design first. Or you can just jump right in an try to create the next big site.
  20. Cascading Style Sheets (CSS) are your friend.
  21. If that is the case I think you should go with one of the established frameworks like cakePHP or codeIgniter (sp?). That will place the majority of development time on building the actual site rather than mucking with low-level details. It will also give someone new a head start on development because they'll have documentation and resources available to them.
  22. Nevermind. I rewrote the event handler to just use the target / srcElement property of oEvent and scrapped the anonymous function.
  23. So I'm using an anonymous function as an event handler and trying to save a value within that function to pass to the real event handler. The loop in page_onload adds an onclick event to every checkbox button with an id beginning with vis_. The final event handler is receiving, as it's field argument, the last input on the page, which is an input field with no id of type button. In other words, alert(field.id); in visible_onclick is giving me the id of the save button and not the id of a checkbox. function page_onload(){ // We need to attach an onclick event handler to each checkbox representing // the visible property var inputs = document.getElementsByTagName("input"); if(inputs.length && inputs.length > 0){ for(var i = 0; i < inputs.length; i++){ var input = inputs[i]; if(input.type != "checkbox" || input.id.substr(0,4) != "vis_"){ continue; } // Create the event handler Events.addEvent(input, "click", function(oEvent){ var ctrl = input; visible_onclick(oEvent, ctrl); return; }); } } return; } /** * visible_onclick * Called when a visible-type checkbox is clicked * oEvent - The event object * field - The associated field */ function visible_onclick(oEvent, field){ var id = "req_" + field.id.substr(4); var required = document.getElementById(id); alert(oEvent); alert(field.id); if(!field.checked){ // Not visible, so can't be required either if(required){ required.checked = false; required.disabled = true; } }else{ // Visible so we have to enable the required checkbox if(required){ required.disabled = false; } } return; } I r confused!
×
×
  • 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.