Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. Would it have killed you to just give a brief explanation of what that code does or to at least format it? (EDIT) Better yet, what is your table structure and what are you trying to accomplish?
  2. It's just a naming convention that some people like. I personally don't see the need for it because classes should be placed in a directory appropriately named...ahem...class or classes.
  3. @neylitalo, I should have given a time frame for when I originally tried out Linux. I'd say this was maybe around 1999 or 2000. While I always liked the idea of Linux, that initial experience put me off of it completely until I had a spare PC to test it on; that didn't happen until virtualization recently became popular. Playing with it in a virtual environment has given me the ability to learn more about it and become familiar with it without worrying about thrashing my data. And I agree, a lot of progress has been made in terms of ease of use. But this might turn out to be one of those too-little-too-late things. Don't get me wrong, I'm not saying Linux will ever fade away; just that I don't know that it can topple MS in the desktop market any time soon. As for the entertainment, the key there is exclusiveness. I applaud any game maker that builds for different platforms; it is very difficult and comes with little reward. But in order to bring people over to Linux from MS I think it would have to offer something exclusive that you can't get anywhere else. At the rate the MPAA and RIAA are going though, I don't think it'll be long before DRM is built directly into the Windows and Mac OSes. At that point, I can envision more people moving over to a platform like Linux where that sort of thing would be (seemingly) more difficult to control.
  4. "I second the blah blah blah" means "I agree" Both methods are viable strategies for what you want to accomplish. It is up to you to determine the needs of your application and choose the best approach. That is why I gave you the example of what I did in my own program; in that example I used both approaches, each where it was most appropriate.
  5. IIS might be catching ground with Apache simply because the people who run business aren't tech people. They're business people and they think in terms of loss and profit. For most of them, using an open-source platform means less documentation and less support in conjunction with higher downtimes and greater losses. If you have a server with IIS, when you have problems you can call MS support. Business people need to know they can get support when they need it. If you owned a business, wouldn't it make you uncomfortable if your entire set of profits were built around technology only a couple individuals in your company understood? What happens to your company if you suddenly remove them from the picture? IIS is gaining ground because it provides comfort and ease of mind as much as anything else. Now, I don't really see what anything on the desktop side has to do with anything in this thread since it's about IIS and Apache, but it was brought up so what the Hell? I agree whole heartedly with Jesirose in that most consumers don't even know there is an alternative to Windows or Mac. Most of the ones that do would rather own Windows anyways because that's what most of their friends and family own; basically, they know they can easily share files and get support. However, I think the Linux community is in part responsible for the lack of Linux presence in the desktop market. When I first heard about Linux I was very eager to try it out. I installed it on my PC and very quickly hit a wall with getting my network card to work. I joined a couple of #linux channels in IRC hoping to get a little help and was promptly met with a lot of RTFMs and channel kicks. Basically, everyone in those channels had to work hard to get their system to work so everyone else should as well, right? In that regard, the Linux community is very much like the Mac community. The users want to be part of this special, elite club of computer users that really understands the technology and concept; this eliminates the need to constantly have to deal with people who don't understand computers. Well, in both cases, the communities got what they wanted. If Linux and Mac really wanted to dominate the market, they'd each need to offer what people want most: entertainment. Video game console manufacturers have been doing this for years: Offer titles that you can't get on the other consoles. However, since both Linux and Mac represent such a small part of the market, no for-profit company would release an entertainment product exclusively for either of them; it doesn't make any business sense.
  6. I saw a site once that generated a gradient using only HTML and CSS with no back-ground images. If you want to do this for education only and not to make it look professional, you could find such a site, generate a page, and just snap a screenshot of it. Crop it in MS Paint, save as a jpeg, and then start edumacating.
  7. I second the serialize / unserialize method. First off, to the OP, you have the right idea about the storeMe and restoreMe methods; a similar mechanism has to be used in languages like C++ where you want to write an object to disk when the object is derived and has virtual methods and all that. @Eric_Ryk, I certainly see what you're saying but that implementation depends on the task at hand. By taking that approach you will need to modify your database structure every time your object structure changes, which can be quite frequently, especially at the early stages of development. Second, you only need to store columns matching data that you plan to search over; so if you are storing properties in columns that you never use in your queries, you are just creating extra work for yourself. I recently dealt with this issue myself. I created a form that allows users to build a questionnaire with different question types: open-ended text, open-ended paragraph, multiple choice-select one, multiple choice-select many, and two types of rating scales. Different question types require different stored data to reconstruct them and make sure the answers follow the appropriate rules. I contemplating creating an overall table for the questions and their order and then another table for each question type to store this data. In the end I decided it wasn't worth the trouble and used serialize and unserialize. I do use tables with more appropriate columns to store the answers as I need to perform searches and analysis on them.
  8. Square brackets appended to a variable name signal that variable as an array. For example: <?php $var = "Hello, World!"; // Declares a normal variable $var = Array(); // Declares an empty array ?> Each "level" of square brackets indicates a new dimension of the array. If you see $var[] that is an array with a single dimension; you can conceptualize this as a stack of items (like plates). If you see $var[][], this is an array with two dimensions; you can conceptualize it as an x-y graph, grid, chart, or anything with columns and rows. Arrays can have any number of dimensions. You use an index into a dimension to access a particular value out of it. For example, let's say there is a single dimensioned array with 10 items in it. <?php // dimensions start counting at zero echo $single[0]; // prints the first item echo $single[1]; // prints second item echo $single[2]; // third item // ... echo $single[9]; // prints 10th, aka last, item ?> Using the same concept with a double dimensioned array, it is common for one index to represent columns and the other rows, although the order is not important (All that is important is that you use it consistently throughout your program). <?php // Assume the dimensions are $double[rows][columns] echo $double[0][5]; // Row 1, Column 6 echo $double[4][9]; // Row 5, column 10 // Now switch the dimensions: $double[columns][rows] echo $double[0][5]; // Row 6, column 1 echo $double[4][9]; // Row 10, column 5 ?> Creating arrays is easy: <?php $arr = Array(); $arr[] = "First"; // [] means 'append to the array this value' $arr[] = "Second"; $arr[] = "Third"; // $arr now holds 3 values, $arr[0] holds the value "First" // $arr[1] holds the value "Second" and so on // We can declare the whole thing in one go $arr = Array( "First", "Second", "Third" ); // Above, PHP is very kind and automatically creates the array and inserts // the items in that order ?> So far, all of these arrays are numerically index. This means we place integer values inside of the square brackets to grab items. You may have wondered why we bother with loops in programs; combined with arrays they are very powerful. Consider the following: <?php // The following is a trivial example, but let's pretend you have a collection of items // you have to manipulate. $var1 = "Hello"; $var2 = "I know"; $var3 = "This is stupid"; echo $var1; echo $var2; echo $var3; // Above, combining the echo statements into a single statement is trivial to do. But // what if you aren't echo'ing the values? What if you're performing complex operations // on each item. You don't really want to repeat that code do you? // use an array and a loop $arr = Array( "val1", "val2", "val3" ); foreach($arr as $value){ echo $value; } ?> Note that you can use any type of loop to loop over an array: <?php $arr = Array( "val1", "val2", "val3" ); $number_of_items_in_array = count($arr); // Will hold 3 // Using a for loop for($i = 0; $i < $number_of_items_in_array; $i++){ echo $arr[$i]; } // Using a while $i = 0; while($i++ < $number_of_items_in_array){ echo $arr[$i]; } // Using a do while $i = 0; do{ echo $arr[$i++]; }while($i < $number_of_items_in_array) ?> Up until now, all of these arrays are numerically indexed, which means we use integer values between the square brackets to get individual values. Arrays can be associatively indexed as well, which means we use strings instead of integers to get at the values. <?php $arr = Array(); $arr["Bob"] = "Smith"; $arr["Mary"] = "Jones"; echo $arr["Bob"]; echo $arr["Mary"]; ?> The last thing you need to know is foreach, which I used earlier without explaining. foreach loops over each item in an array and stores it within a variable. You can tell foreach to store the index in a variable as well. <?php foreach($array as $value){ // Each item in the array will be stored in $value } foreach($array as $index => $value){ // Each index will be stored in $index, be it numeric or associative // Each value will be stored in $value } ?> This should get you started; if you need further assistance I'd read the PHP manual.
  9. If you want to pay someone to do this for you, ask a mod to move the post into the freelance forums. If you want to attempt to write this yourself, I'd search the net for how to create HTML forms and start there.
  10. OMFG I'm crying: http://www.youtube.com/watch?v=0bK63uSTTNs&mode=related&search=
  11. Just about one of the funniest things I've ever seen. Its pretty standard fare until about 3:22 http://www.youtube.com/watch?v=7BtNN6M97q8&mode=related&search=
  12. It depends. Inside of double quotes, using curly braces just makes it more clear to the PHP parser which part of the string is the variable and which part is the string: // Assume a variable named $prefix echo "That is $prefixtacular!"; // The PHP parser would look for a variable named $prefixtacular and most likely not find it echo "That is {$prefix}tacular!"; // No confusion in the above statement The second use of curly brackets concerning variables is for declaring or using a variable with a dynamic name. // Assume a variable named $name holding the value "bob" ${$name} = "Hello"; The statement above will create a variable named $bob and assign it a value of "Hello"
  13. You just pull the data out of the database and use PHP logic to say "Approved" or "Not Approved." You seem to have a handle on what you're doing, so again, what exactly are you stuck with? Do you have a registration form? Does it insert into the database? Does it send the e-mail? Have you created any forms to list the people awaiting approval?
  14. Create a page that lists all the people not approved with a check box by their entry. The person doing the approval checks the boxes and clicks a button to approve or delete them. Exactly what are you having trouble with? Accessing data in MySQL? HTML forms?
  15. Ah there it is. I usually have a careful eye but some how I missed the parens to index the array.
  16. AFAIK this is untrue. session_start modifies header information so only needs to be called before any output is sent to the browser or before the $_SESSION variable is used. How are these functions being called?
  17. Nice layout and the site worked well. Beyond adding a refresh to the CAPTCHA, I think you should make it more legible, perhaps with a different font. I have excellent vision and even I had a hard time making them out. I didn't really try and break the site as that's not really my specialty, but an idea occurred to me that you may want to consider. I can see this site becoming very popular as a means to transmit illegal data. I have a feeling you'll be forced by legal requirements to be able to decrypt the information on your end, which sort of defeats the purpose, but not entirely.
  18. I do this too. I think the root of it is that I'm not always sure about how I want to program the next stage of something or that I don't want to do it so I delay finishing the current task.
  19. Did you try www.php-sluts.com? "I want you to 'echo' all over me!" (Sorry, couldn't resist.)
  20. Have a look here: http://dev.mysql.com/doc/refman/5.0/en/load-data.html I recommend using that to read into a temp table and then using: INSERT ... SELECT from the temp table into your final tables.
  21. onclick="window.location.href=\'http://www.x.net/x.php\' You didn't enclose the entire attribute in double quotes. You didn't need to escape the single quotes since they were inside of double quotes. Thought you should know why it wasn't working.
  22. Just because it is OOP does not make C# more powerful; that is terribly flawed logic.
  23. Give it an id="abc" and use document.getElementById() You can also try: document.formName["abc[]"]
  24. Since when can PHP not interact with C programs?
  25. You lose the colon when you perform the explode, so just manually concatenate it back on: $data = "foo:*:1023:1000::/home/foo:/bin/sh"; list($user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data); echo $user . ":"; // foo: echo $pass . ":"; // *:
×
×
  • 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.