Jump to content

knowNothing

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by knowNothing

  1. After a few years of PHP, I've used every editor known to man, and I can say that while all the fancy GUI editors have some interesting functionality, I rarely use them or decide on one single editor because I write/edit code from so many different platforms, that its much easier to just remote/SSH into the server and use Vi or whatever editor that box has available. I do it from my pda phone, from dreamweaver, from notepad+ftp client, from putty on my mini-usb key. It all depends on where I am, geographically, and what computers I have access to when I need to write or edit code. Be flexible and dont rely on your favorite editor. This goes for development too. I sat at a coffee shop for 4 hours once, developing a library for an extranet application, all from my Palm Treo 700. A lot of people have their one computer at work/home that they do everythign on. This is fine, but you're not very portable. What if a client needs you to change some database functionality or change some random php code, and you're in a safeway store 400 miles from home/office. And it needs to get done 5 minutes ago. I know most people dont have to deal with that kind of request in that timeframe, no matter where you are, but it just goes to show that it's nice to not have to rely on your one development platform. I think I went waay off track with this. Oh well. Peace out.
  2. I know this is a little late in terms of a reply, but eval() is your friend. I think I was looking for the ability to parse php after pulling it out of a database for too long. I knew what I wanted it to do, but didn't know what it was called, and people had no idea what I was talking about, but yea.. eval() is definitely useful.
  3. Here's what I want to do. I need to access a class member function from outside the class, and hopefully without having to instantiate the class if possible? I have an HTML form <select> and each <option> item is being pulled from an array stored in a mysql db. But I'm doing this independently of the normal purpose of the class itself, I just want to use that member function.
  4. Hey guys, I've decided that it's in my best interest to create a customer/client extranet for the purpose of securely delivering content such as project details, project status, time organization, messaging, commenting, and whatever else I decide... What I was wondering, if anyone has experience in designing applications for use on mobile devices such as PDA phones. I was reading about Mobile Web Best Practices over at http://www.w3.org/TR/2005/WD-mobile-bp-20051220/, which is fine and dandy, but has anyone had firsthand experience with development? Is it worth it in the long run to offer a mobile-only version as well as a "I have a normal computer with a normal web browser running a normal screen resolution" option? How many people would actually login from a mobile device? Am I wasting my time? knownothing
  5. I wasn't having any luck in googling this baby so maybe someone on here knows what I'm talking about. Is there a way or an existing library somewhere that can output a thumbnail of a preview of a document? Deeper, dumber explanation: I have a PDF document that contains a logo and a bunch of text below the logo, all on the first page of the PDF.  I want to be able to have a small thumbnail on a site that actually displays an accurate preview of what page 1 in that particular PDF looks like. Anyone know what I'm talking about?  If it cannot be done with PDFs, is it possible with any other filetype other than images?
  6. I was going to reply to this with something like "Ew, Nuke? that's gross", but I haven't actually seen Nuke in a while so I went to investigate, and sure enough, it was what I expected, so my first response was the correct one. (Ew, Nuke? that's gross).. .. so.. I'll look for a cleaner alternative that isn't loaded with all kinds of gross-ness. Can anyone suggest some alternatives?
  7. Can't it be done without enabling register_globals?  Just trying to keep with the whole "Lets try to make secure code" idea...
  8. [quote author=Barand link=topic=112144.msg455765#msg455765 date=1161511485] [quote author=knowNothing link=topic=112144.msg455506#msg455506 date=1161455322] Why is it a bad idea to store files directly in the database? [/quote] To display images you use an HTML img tag with a "src='filename' " attribute. This points to the location of the file on the server. If it is stored in the db you cannot do this without the extra overhead of extracting it as a dynamic image. [/quote] Ok..but.. im not storing images in the db.. im storing PDFs, Word DOCs, powerpoint presentations.. does this matter?
  9. [quote author=businessman332211 link=topic=112144.msg455474#msg455474 date=1161451307] This is the idea I used for that In the table storing file information have approved field. set it to 0 to default, when they come to view the file, or a chance to view the file, check approved, if it's 0 don't show the file.  If the person approves it, it goes to one, then the file can be shown on the website. Very simply and all, in all only takes one more field in the database, the advice was given to me by someone on these boards. [/quote] I think this does make more sense.  I shall code it accordingly and see how it goes.  Thanks for the ideas.
  10. Why is it a bad idea to store files directly in the database?
  11. In the future.... 1.  Use a more descriptive topic name. 2.  Spellcheck your entire post and make sure it makes sense. --EDIT-- [color=blue]Original post has been updated, so ignore this this reply.  thnx.[/color]
  12. I was thinking that 2 tables might be better.  This way, I could keep all unapproved data for later, further examination.  If approved, I could insert it into the public DB and keep the existing unapproved file in the temp DB and flag it as 'processed'.  This way I have a paper trail for better logging if need be. I'm just trying to plan for future unrealized functionality.  I MIGHT want a table with all the files that have requested approval, regardless of their approved or unapproved status.
  13. This question kindof extends the project described at [url=http://www.phpfreaks.com/forums/index.php/topic,111785.0.html]http://www.phpfreaks.com/forums/index.php/topic,111785.0.html[/url] but is actually a different question. I need to be able to have a teacher approve a file upload before a student can actually upload it to a database that's usable by that particular student.  But sometimes the teacher won't be able to approve (however many files from however many students) until later that night or even possibly the next day.  So obviously, the files need to be uploaded to a temporary location until approved, or at least flagged as 'unapproved' in the database.  I was thinking of the following: - Student uploads file (blob) to a mysql table (named something like temp_filespace). - Teacher gets a notification that there are files that need to be approved. - Teacher logs in and approves files - Once approved, the file (blob data) is moved to a new table that has the necessary functionality (permissions) for students to be able to download (ie. public db table, as opposed to the temporary table that has no other functionality than storing the blob temporarily) Is there a better or more efficient way of accomplishing this?  I was thinking either this way, or storing it all in a single table and just flag the blob data as either unapproved or approved, and parse it accordingly.  Would one way take more code in the long run?  I'm having trouble thinking about the differences in code length for either of these options. For my own purposes I'll do a small layout: --------------------------- MySQL Table1 (public) --------------------------- file1_approved file2_approved file3_approved --------------------------- MySQL Table2 (temporary) --------------------------- file1_unapproved file2_unapproved file3_unapproved ----------------------------OR------------------------------ --------------------- MySQL Table (public) --------------------- file1_unapproved file2_unapproved [b]file3_approved[/b] file4_unapproved
  14. its a charter school, so it doesn't get its very own domain (YET...huhuhuh) [url=http://charter.edcoe.k12.ca.us/edts/]http://charter.edcoe.k12.ca.us/edts/[/url] Let me know what your first impressions are I guess....  You wont be able to see the backend in action yet, but it includes user auth with permissions, agendas, newsletters, all with administration and stored as blobs in mysql.  Working on an online student locker system. If its a little slow loading, its not because its graphics-heavy or anything, it only because the apple server its on  is slooow.
  15. I've been doing top-down php dev for a while and I'm trying to convert everything I have into objects for well, reusability.  I'm having trouble trying to decide what the purpose of a constructor function should do.  I realize it basically needs to initialize the class with default values when instantiating it, but I'm not so sure I need to have default values specified?  Am I supposed to be able to pass vaiables into this constructor function?  I see what functionality a constructor function is supposed to have but I'm having a hell of a time trying to figure out how to apply it to my specific class. I'm writing an app for an online student locker system that takes care of the following: 1.  Student/Teacher Auth 2.  Private messaging 3.  File Upload (Each student gets his or her own filespace) 4.  Homework lists and downloads This is the basic functionality of the whole app.  I am knowledgable enough to code all this in top-down form (don't laugh^^), but I would like to start off the project by designing objects for each of these items. (To save myself 100's of hours of maintenance. If I were to write a single class to accomplish this, what might the constructor function do?  If a single class isn't the best way (which I'm starting to believe is true)  What might constructor functions do for each of these objects?  If you were quick to realize that maybe I'm going about this all wrong, please let me know the best way to start breaking these down into objects. Thanks for all your help with my previous, more specific php questions. Dan the knowNothing
  16. Lets say I've got a variable named $myvar in an included file inc.php.  If I want to use that variable in a function thats nested multiple times, must I pass it through explicity all the way down to the function that will use it?  In this case, I do not want to set it as a global.  And I'm not looking to use a class. Is this the only way to do it?  Or am I missing something that's gonna make me feel retarded?  Also, is there some kind of advanced variable scope tutorial out there?  At least more advanced than all the basic ones I keep reading? [code] <?php   include ('inc.php');     function myfunc1($myvar) {       function myfunc2($myvar) {         function myfunc3($myvar) {             echo $myvar;         }       }   } ?> [/code]
  17. [quote author=onlyican link=topic=109115.msg439632#msg439632 date=1158957010] only encrypt the password before you add it to the database or cookies or what ever [/quote] ok, nevermind, I just figured this out, just needed some extra if statements.  When editing a user, I made it so the password field comes up blank (not populated).  If i submit with nothing in the password field, the password never gets updated in the table (decided by an "if" statement).  If I manually enter in another password, another quick "if" statment decides weather to update the table with the new password or not. Thanks for your help anyway.
  18. I've got a user administration form where I can add a new user, and edit a current user's information.  When I choose to edit a user's info, I have a form that's auto-populated with the current information so I can simply make changes and hit "submit" to change the info.  When the form is populated, the password field is populated with the MD5 encryption of the user's password, so if I want to change something else, and hit "submit", it's going to re-encrypt the already-encrypted password, hence changing the password altogether.  Is there an easy way to not change the password, but make other changes, and still have the ability to change the password if needed?, or am I just missing something and being retarded..?
  19. Awsome.  It worked.  I just used: [code]<a href="<?php echo $_SERVER['PHP_SELF'] . '?delete=1&idnum=' . $idnum; ?>">delete</a>[/code] and then once the variable was passed back into the document, I referenced it using $_GET['idnum'] and $_GET['delete'] and the function performed properly (removed the correct news entry).  I have no need to use them in another document, so I wont need to use $_SESSION. Thanks for all your help guys.
  20. cool.. ok in this case, if i pass the variable back to $_SERVER['DOCUMENT_ROOT'], i can simply reference it further using $_GET['delete'] without having to decare it as a session variable?
  21. Maybe I don't even need this... here's my problem.. I'm making a news admin script and I'm trying to pass variables back into $PHP_SELF  so that I can delete and edit news posts, but when I  use something like: [code] <a href="<? echo $PHP_SELF."?delete=1&idnum=".$_SESSION['idnum']; ?>">delete</a> [/code] it seems that the values for $delete and $idnum are not being fed back into $PHP_SELF
  22. Since session_register() is deprecated and I don't have access to turn register_globals on, and don't really want to anyway... If I declare a variable using $_SESSION, will I have to eternally refer to it as $_SESSION["variable_here"] wherever I use it in the code or does using $_SESSION once, in effect, make it permanently global, and I can use $variable_here throughout the code?
  23. [quote author=Jenk link=topic=107363.msg430707#msg430707 date=1157733847] eval() [/quote] Yes, darnit, thats it.  I love you.  Thanks.
  24. Hello.  My first post... I tried searching for my answer first, and maybe I just don't know how to search very well but I'm looking for the function (if it is in fact a single function) that will allow me to parse PHP code after I've grabbed it from a mysql table.  I'm looking to store some PHP code inside a table and be able to query it out of the table and parse it whenever I want.  Not sure if I worded that correctly, as I'm pretty new to PHP in general.  I've seen it done before and at the time, I know that some extra code was required in order to do this, otherwise the code just would not get parsed...  Anyone know what I'm talking about?
×
×
  • 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.