Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. Could you be so kind as to tell me how you came across those?
  2. Fixed (I think). Could you possibly attach the file you uploaded? (Or if it does it with any file, what browser are you using?)
  3. This is a very, very common error. Calling header() modifies header information. You may not modify header information if output has already been generated. The very top of your script is a doctype declaration, which counts as output. You will have to restructure your code so that the processing occurs before any output. The other, more minor but also common error you made, after a call to header() in which you change the location, you should call exit().
  4. Fixed. Couldn't duplicate. No, but the ACL-based permission system isn't fully implemented yet. I'm actually supposed to be working on that, but a client requested me to make a change to our options system. Since the previous options management system was such a train wreck, I decided to rewrite the entire thing. I still have to go through and enforce all of the ACL permissions throughout the site.
  5. I've redone an interface in the application I maintain to be a bit friendlier and easier to use. The basic premise is that images are uploaded globally or project specific. Let's say an image is uploaded globally for an item APPL001; every project that has the item APPL001 will use that image. Then an image is uploaded for APPL001 for a specific project; from that point forward, within that project, APPL001 will display with the project-specific image. The interface should work with or without Javascript, although it's slightly more convenient to have it turned on. http://ns2271.serverpowered.net/wv/wattcommunities/ User: test Pass: testtest Follow the menu: Buyer Module -> Options
  6. There are many computer programs that are life and death, they just happen to not be written in PHP.
  7. I don't recommend picking a career based on how much money you expect to earn. Things change over time. The demand for programmers today may not be the same as by the time you graduate and get your degree, likewise with the average pay. You need to ask yourself these types of questions. Do I like to be challenged with difficult mental problems on a regular basis? Do I mind if I have to do research to determine the best way to accomplish something I don't currently know how? Do I mind sitting in front of the computer for as long as 12 or 14 hours a day? (Actual amount of time in front of a computer varies depending on the programming position). I knew quite a few people that loved non-computer fields but went into CS because they heard the demand and money were good. Well they were filtered out of the program by the more difficult Computer Science courses and switched over to business or IT, as they're closely related but not necessarily as difficult. The result, they didn't get the degree doing what they expected and they're not doing the other thing that they loved (art, music, whatever). You need to be practical. For now, if you enjoy programming, then program. If you still enjoy it a few years from now, consider making a career out of it. Just remember that you have to enjoy it. You're going to have bosses and / or clients that make you program things that you don't really want to, but if you naturally enjoy programming it makes it slightly less painful.
  8. Try this. Give each of your check inputs a name attribute of 'checks[field_name]'. For example: <form action="" method="post"> <input type="checkbox" name="checks[send_me_emails]" value="1" /> <input type="checkbox" name="checks[send_me_html_emails]" value="1" /> <input type="text" name="email" value="" size="50" /> <input type="submit" name="submit" value="Submit" /> </form> Now you'd want to have some other stuff in that form, such as labels to go along with the checks. But that's enough to submit a form. The page that processes the form: $ret = validate(); if($ret['OK']){ process(); }else{ show($ret['Errs']); } function validate(){ $valid = true; $errors = array(); if(empty($_POST)){ // Not submitted, so invalid return Array( 'OK' => false, 'Errs' => Array() ); } // Now we can check each field // check email if(!preg_match(REGEXP_EMAIL, $_POST['email'])){ $valid = false; $errors['inv_email'] = 'Your e-mail appears to be invalid.'; } // More validation continues... return Array( 'OK' => $valid, 'Errs' => $errors ); } function show($errors){ if(!empty($errors)){ // Display errors } // Display the form, refill in values from $_POST, etc. } function process(){ // Process the check controls foreach($_POST['checks'] as $key => $value){ // maybe save to database, maybe save in different structure, etc. } } Now how you save the check fields depends on what you want to do with them. Let's say you create a table with a column for each possible check in the database. Each column name corresponds to a checkbox and they have a value of 0 or 1. You may decide to use an approach where you only store checks that were actually checked. In that case a third table with two columns is better. One column to attach it to a submittal ID or something and another that is a VARCHAR for the check field name. You only need to use those approaches if you plan to run queries such as, "Which of my users checked this, that, and that other one?" If you're just saving profile information, you could just build up a big PHP array, serialize it, and save that in a single text field. But then accessing that information from anything other than PHP is difficult. You need to strike a balance between a few things. If you tie the form too closely to your database structure, a minor change in the form will require database changes and take more time and effort. If you tie the form loosely to the DB structure (as in saving a serialized array), you can change the form freely and never really worry about the DB, but that comes at the expense of not being able to ask the DB more specific questions. It's a judgement call.
  9. Absolutely. The key part of my statement is when used correctly. Replacing server side validation with Javascript validation on the client machine is a very improper use of Javascript. Using Javascript to give hints to a valid user that the server will just reject their submission before they even submit it is a great use of Javascript. There are many other great uses for it, but you really have to learn how to do it properly, part of which includes, IMO, not putting any Javascript in your HTML.
  10. Javascript is actually quite handy when used properly. I used to have the same opinion as you do now back when I really didn't know the language.
  11. This is the logic I use for form processing: if(validate()){ process(); }else{ show(); } 99.99999999% of the time you never want to save anything to the database until the process() step. So your question of how do you redisplay the form and recheck the boxes has nothing to do with the database. Have you created a form yet? Have you seen what $_POST looks like when you submit it? Those would be two good places to start.
  12. Designing this type of application can quickly become cumbersome in PHP. You'd be better off looking into Javascript and the DOM.
  13. If the font isn't installed on their system, you can't cause their browser to display it via any means of plain text. An image is your best bet.
  14. Check your MySQL version. You must be 4.1 or higher I believe.
  15. Same age as me. I used to play Pac Man on the Atari 2600 on the strawberry setting (fastest possible) and I could go for quite a while before losing. My parents tell me that when company would come over, sometimes they'd try to humor me by playing the game with me. But then I would do better than them and say, "You suck. You're an adult. You should do better." My parents still laugh when they bring it up, so I guess they've always thought it was pretty funny. (edit) I learned PHP so I could make a web site for the WoW guild I lead.
  16. lol SA. Never heard the Jaz-Z / Linkin Park album; I'm not really a fan of either so I didn't even know one existed. Also, you have the same response as most people, that it's terrible. My brother is the one that showed it to me and I think he and I like it more for the comedy factor than anything else. Everyone we know absolutely hates it, but we just laugh. (edit) And yes, there's definitely some tracks in that mix that do not sound that good. I usually let them play anyways since I only listen to it while gaming or programming and don't even notice what's going on.
  17. The code assist in eclipse drives me nuts. It opens up at the correct moments, but then it remains open even though its no longer needed. A common situation is when typing an if; even after I type the closing paren and curly bracket, the code assist window remains open. Then I have to hit escape before I can press return and if I forget I get a $a in my code. I can see in the preferences which characters you can set this feature to open on, but can you force it to close on certain characters as well?
  18. Add a unique constraint on whatever columns. Then you can insert until your heart's content but the DB will only allow a single unique entry.
  19. I listen to just about everything. My favorite genre would be classic rock and not just the generic Led Zep, Floyd, etc. Chances are if its classic rock, I'll like it. After that I have a soft spot for some of today's music, especially punk from when I grew up. That would be bands like Greenday, 311, Blink 182, NOFX, Pennywise, Suicide Machines and a bunch of others. The misfits are also cool. I have another soft spot for some metal or more hardcore music. Rage Against the Machine is almost a given in this category, but also Tool. I have a few MP3s of The Darkest Hour and it gets the blood pumping. Then there's this whole other side of me that enjoys music so bad that it's brilliant. This would be stuff like The Safety Dance. I'm not sure where the clash, talking heads, or oingo boingo fit into all that. Out of it all, I have two albums that I probably listen to the most. The first Sugar Ray album is one of them. The second is Jay Zeezer. Let me explain Jay Zeezer. It's Jay Z and Weezer, both of which I would never listen to, intermixed together as if they were a group. It's brilliant! http://www.jay-zeezer.com/
  20. Do you mean like this: echo "<td colspan='3' align='right' valign='bottom' width='70' style='padding-right:12px;'><a href='property.php?property_id=".$row[0]."'><img src='designs/house2.png' border='0'></img>"; for($i = 1; $i <= 6; $i++){ echo ${'image' . $i}; } echo "</td>"; echo "</tr>"; All you have to do is restructure the code until it does what you want. If you don't want something printed multiple times, don't stick it in a loop, put it before or after the loop.
  21. Look at the line of code in question: echo "<td colspan='3' align='right' valign='bottom' width='70' style='padding-right:12px;'><a href='property.php?property_id=".$row[0]."'><img src='designs/house2.png' border='0'></img>".$tmp."</td>"; Notice this in the code: <img src='designs/house2.png' border='0'></img> That is what is printing the house2.png. If you don't want something to be printed, remove it from the print (or echo) statement.
  22. I wouldn't worry about your friends. You're in high school. 1 year after you graduate, there is a good chance you won't be in contact with 90% of the people you knew in school. 5 years or later and you probably won't know a single one of them. Be smart and look after yourself, no one else will.
×
×
  • 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.