Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. I received one of my favorite compliments back in college while working on a group project where I was doing the blunt of the programming. The three of us were looking at the monitor, I was typing and explaining what I was doing and one of my partners said, "Wow, I want to program like you when I grow up!" I hope that when I grow up I learn to design like you jcombs, you truly have a knack for it.
  2. roopurt18

    IPOD

    I don't have the time to look into it, but you might find an answer here: http://www.google.com/search?hl=en&q=vista+how+to+install+ocx&btnG=Search The short of it as I remember from the last OCX file I dealt with in...oh 1998, was you had to install it using that "regsrv32.exe".
  3. I knew lots of people that loaded up on Honors and AP courses that just ended up retaking them in college. Made me glad that I never invested a whole lot of time in them.
  4. http://www.php.net/session_set_save_handler Did you start here and read all of the comments? Also, why are you wanting to store it in the DB? You want data to persist across user visits to the site?
  5. We'll need to see more code, both above and below the offending line. If you're going to do: <?php $string = "<form id=\"reg\" action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\" name=\"regform\" >"; ?> You might as well go all the way and eliminate the dot operator: <?php $string = "<form id=\"reg\" action=\"{$_SERVER['PHP_SELF']}\" method=\"post\" name=\"regform\" >"; ?>
  6. You have an unneeded backslash after PHP_SELF.
  7. You leave the action attribute set as $_SERVER['PHP_SELF']; the script that outputs the form is the same script that processes it. As the final step in form processing you can redirect to another page, or even the same script again, to prevent the problem of a duplicate form submittal when a user refreshes the page.
  8. Can't say I saw that one cmg; I agree that is taking things too far. I'd be curious to know if the school intentionally did that or if it was a student prank. And looking into it, here is the answer: http://www.montebello.k12.ca.us/ Apparently it was done by protesting students from neighboring schools; I'd be willing to wager the majority of which were citizens.
  9. Some of this might differ from state to state. I'm fairly positive that in CA you have to be recognized as legal to have a drivers license and that insurance companies are not allowed to insure non-licensed drivers. So what are these people to do? They're not unlike you or me, they desire to live legally. Believe me, if they could get a license and insurance I'm sure it would take a load of stress off their shoulders. This is just one of those sticky issues that we'll likely never have a good solution for.
  10. We've always had immigration problems, the first of which is our country wants all of the benefits of immigrants but none of the consequences. I'm coming from a reference point of living in S. California and being surrounded by illegal immigrants and had having the experience of working with them; I worked one summer as a janitor and spent a solid amount of time in the restaurant industry. First off, I think the majority of the U.S. has the wrong opinion of these illegal aliens. These people are a major boost to our economy. I don't know a single person that doesn't go into a supermarket and complain about the price of fruit or into a restaurant and complain about how much a dinner costs. Let's get Americans with higher salary expectations who also want benefits and vacations to take those jobs and see how much prices go up. Not to mention most Americans don't even want those jobs. Spend 8 hours bent halfway over in the hot sun picking strawberries? No thank you! I can't speak for the rest of the country, but in S. California, the two choices for menial labor are immigrants or teenagers. I've seen how well teenagers do; I couldn't possibly tell you how many times I've gone into Juice Stop and hear this from the back: "You take him." "No it's your turn." "I got the last one though!" I don't give a rat's ass whose turn it is, gtfo here and make my smoothie. You have to keep in mind that most of the immigrants have a desperate need to work and earn money to send back home, thus they are highly motivated. If an illegal doesn't show up to work, they're either sick or found a higher paying job. There's none of this "I wanted to go to a party so I called in sick at the last minute"-crap from them. I'd prefer working beside a reliable illegal than a flaky citizen any day of the week. I hear a lot of nonsense about the extra "tax on society" illegal immigrants bring with them, and it's just that. The extra tax I'm talking about is more crime, since people who disregard the law about entering a country are liable to disregard the rest of the laws as well, right? Quite honestly this is the most flawed logic I've ever heard. Most of the illegal aliens I knew wouldn't hesitate to get a driver's license or pay for auto insurance if there wasn't an associated risk of being deported. These people know they're on very thin ice so they try to call as little attention to themselves as possible,, which means following as many other laws as they can. The real cause behind the type of crime we worry about them bringing is caused by economic status, not their illegal status. There is no difference between an illegal alien and a U.S. citizen, both of low economic status, when it comes to likelihood of committing a crime. Now, anyone who says illegal aliens' children place an extra burden on our public education system would have a valid point. But our education system is so far beyond FUBAR I hardly think this is worth debating. I think the majority of the U.S. population is under the impression that if we eliminated these people from crossing the border a good portion of our problems would just disappear. I just don't agree with that scenario.
  11. <?php function createSel(){ $html = "<select>"; for($i = 1; $i <= 1000; $i++){ $html .= "<option value=\"{$i}\">{$i}</option>"; } $html .= "</select>"; return $html; } ?>
  12. <?php function createSel(){ $html = "<select>" . "<option>1</option>" . "<option>2</option>" . "</select>"; return $html; } function ShowForm(){ global $form_errors; $html = ""; // Start off empty if(is_array($form_errors) && count($form_errors)){ // Form had errors, so we are redisplaying $html .= "The follow errors were encountered:<ul><li>" . implode("</li><li>", $form_errors) . "</li></ul>"; } // Now build the form $html .= "Field 1" . "Field 2" . createSel(); // <-------- Add the selection return $html; } ?>
  13. Yes and no, which is to say I want to hire more developers so we can enhance the product faster but the company can't even afford what it has already. Bollocks!
  14. $59K for me. For reference, I live in the U.S. and work 9AM - 4PM. I'll be at $67K as soon as I'm put on full-time, which our company can't quite afford just yet. Also, I receive a quarterly bonus based on the growth of our product, which is not as nice as a flat-out raise but money is money so I'll take it.
  15. I'm what you'd call a good test taker so while there are a few exceptions, for the large part I barely study and pass every test I barely care about and ace those that I consider important. Anyways, the AP tests aren't as bad as you think. My high school science career looked like this: Freshman: Biology © - Normal entry-level class for freshman Sophomore: Integrated Science (A) - For dumb juniors or sophomores not quite smart enough to take Chemistry Honors Junior: Physics AP (A/B, I forget) - For all the juniors that took chem. honors their soph. year. Short story: My integrated science teacher, at the end of the year, said to me, "You're smart...what are you doing in this class?" I told him I didn't like bio and that I was good at math. So he recommended me for physics my junior year. I eventually found out that he was the physics AP teacher so I badgered him constantly until he said I could take that class. Outside CS, physics is my favorite subject. I did well in the class but I didn't take the AP test. The reason is because I was an average student, I don't work hard. I saw all these people with above 4.0s going nuts over the test, most of which I knew wouldn't pass, so I figured I didn't have a chance and never bothered. Now, towards the end of the year, the teacher started recommending us for our senior science class. His name was Mr. Johnson. There was another Mr. Johnston that taught the chem honors and the following year he'd be offering chem AP; both of these teachers were highly liked by their students. So naturally I wanted to take chem AP. My physics teacher recommended me for the course based on my performance in phys. AP, not knowing I'd never had any form of chemistry in my life. Now as luck would have it, they hired a new teacher over summer who ended up teaching chem AP, Mrs. Neip (or something like that). So my senior year of science sucked arse. I knew nothing about chemistry, did poorly on every homework assignment, failed almost every test, and barely squeaked out of the class with a C-. However, I was determined to take the test and show all the 4.0 students I was better than them and their HW and busy work scores didn't equate to balls. So in the end: Senior: Chemistry AP (C-, but a 4 on the AP exam) The long story short is all those kids freaking out in my physics AP class about the test were the type of personality that blows everything out of proportion; I'm not. As a last aside, Mr. Johnson is the coolest teacher I've ever known. I spent a total of 7 semesters in his classroom. Four of them for classes, three of them as a TA grading papers and oddly, my first semester aiding for him was my second semester of physics AP as well. Here are two brief conversations he and I had during my senior year: J: How is<pause>Mrs. Neip? M: Ugh...terrible. J: Well<pause>did you bring her a shrubbery? J: So<pause>how is<pause>chemistry? M: It sucks. I don't know anything. I can't balance an equation, I don't even know the damned periodic table. J: Didn't you learn that<pause>in honors chemistry? M: I've never had chemistry before! I had integrated with you. J: <blank look>
  16. Forms usually have three required functions: ShowForm() - Show the initial form to the user, also used to re-display a form that has errors. ValidateForm() - Validate the form input, returns true if valid form, false if invalid form ProcessForm() - Does the form processing and then displays final output or performs redirection Lastly, I like to include a Show() function for the form that wraps up the logic. <?php function Show(){ $html = ""; // Called by the client, shows the form if(ValidateForm()){ // Form is valid, so we process $html = ProcessForm(); }else{ // Form is invalid, so we show it $html = ShowForm(); } return $html; } ?> ShowForm <?php function ShowForm(){ global $form_errors; $html = ""; // Start off empty if(is_array($form_errors) && count($form_errors)){ // Form had errors, so we are redisplaying $html .= "The follow errors were encountered:<ul><li>" . implode("</li><li>", $form_errors) . "</li></ul>"; } // Now build the form $html .= "Field 1" . "Field 2"; return $html; } ?> ValidateForm <?php function ValidateForm(){ global $form_errors; $has_errors = false; $form_errors = Array(); // If the form has not been submitted, it is obviously invalid if(count($_POST) == 0){ return false; // This will cause ShowForm() to be called from our Show() function } // A form has been submitted, so we can validate each field. // Check valid username $regexp = '/^[a-zA-Z0-9]+$/'; // Usernames are alphanumeric if(!preg_match($regexp, $_POST["username"])){ $has_errors = true; $form_errors[] = "Valid user names are alphanumeric."; } // Check for a password if(strlen(trim($_POST['pass'])) == 0){ $has_errors = true; $form_errors[] = "You must specify a password."; } // Check that both password fields match if(strcmp($_POST['pass'], $_POST['pass_confirm'])){ $has_errors = true; $form_errors[] = "Your password fields do not match."; } // And so on... return !$has_errors; // Negative logic } ?> ProcessForm <?php function ProcessForm(){ $html = ""; // start empty // We must sanitize our form input. I prefer to put everything into a $Clean array, which signals // to me that it has been explicitly cleaned. It also leaves the variables as $raw to use them // elsewhere $Clean = Array(); $Clean['Username'] = mysql_real_escape_string($_POST['username']); $Clean['Password'] = mysql_real_escape_string($_POST['pass']); // Build our query, I opt not to use sprintf $sql = "INSERT INTO users (username, pass) VALUES (" . "{$Clean['Username']}, {$Clean['Password']} " . ")"; $q = mysql_query($sql); if( query_was_valid ){ header("Location: " . REDIRECT_SUCCESS_URL); exit(); }else{ $html = "There was an error processing your request."; } return $html; } ?> If your entire form is contained in my_form.php, it can be used like this: <?php require_once("my_form.php"); echo Show(); ?> This should give you some good ideas on how to work / deal with forms. I've simplified it a bit and there are some clever enhancements you can make, such as turning it into a class.
  17. You will often find that form validation is easier when using a white-list approach, or building your validation around the choices that are allowed (rather than trying to think of everything that is not allowed). <?php // Flag form as having errors: $has_errors = false; // Let's say we want $_POST['fld'] to only contain alphanumeric $regexp = '/^[a-zA-Z0-9]+$/'; // Matches one or more alphanumeric characters if(!preg_match($regexp, $_POST['fld'])){ echo "Error: Field has invalid data!"; $has_errors = true; } // Do the same for some other fields // ... // Now we can process the input if($has_errors){ // Re-display the form with error messages }else{ // No errors, we can process echo "Processing!"; } ?>
  18. You can typically use CSS or a custom template with most pre-written code, although I admit my experience in this area is limited.
  19. Simpsons? Damn it, I googled it after-the-fact. Of course, I'm wrong.
  20. I'm answering this strictly in terms of web development. Instances where you want to improve the client interface, such as DHTML or AJAX programming. The simple example is a form submission; normally the entire form needs to be submitted to the server, processed, and then the server will either accept or reject the form based on it's validity. Using a client-side scripting language you can validate the form before it's ever sent, thus telling the user to fix errors before they ever reach the server. Instances where you have to have tight control over the data. Continuing the form example from above, while you can use a client-side language to validate the form before it's been submitted, you can not rely on that as your only form validation. You still need to validate the form on the server in case the client has Javascript disabled. Instances where you want your web page to become a web application, i.e. highly interactive and stream lined in terms of usability.
  21. I'm still at my first job and pulling in $32.50 USD / hour currently. I could realistically work somewhere else and earn $40-50 / hour as cmgmyr says he does, but I like working here. The position was advertised as entry-level, but I'm the sole developer of our application and that means I get to do a lot. When it comes to our product, I am the end-all be-all; I do all of the design, implementing, maintenance, research, testing, server setup, etc. and I only have to drive about 10 min from my house to do it. That beats the Hell out of working in a larger company, earning more, but having to document hundreds of lines of other peoples' code in a true entry-level position. I'll (supposedly) have a B.S. in computer science and a minor in physics after this semester as well, but only time will tell on that one.
  22. You might try developing your application using one of the available PHP frameworks that supports plug-ins. Then you can use existing plug-ins that offer the functionality you desire as well as develop any plug-ins of your own to fill in the gaps. What you're looking to do is not that complicated but to start a project like that from scratch and try to follow all of the existing "best practices" for (X)HTML, Javascript, CSS, PHP, MySQL in addition to making it extensible and easy to maintain is daunting if you have a short time frame. Otherwise, the specific components it sounds like you need to develop are: User Panel - One super admin can create / modify / remove other users and their privileges Project Manager - Here is where someone will create and manage projects, which would be a TV series in your case. I recommend just categorizing them as a project because all you really want to do is attach documents to something. File Server - You want to do more than just provide a link to download or view a document that has been uploaded. You want to pass it through a mechanism that checks the user's privileges before serving it as well as track who viewed it and when. Blog / Comment system - So that people can leave comments.
×
×
  • 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.