Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. So are we to assume you have a single table (Users?). If so, your initial queries all need to be "SELECT DISTINCT" or your're going to get a row for every job, rather than the distinct list of jobs, for example. If you had a relational design, with separate tables for jobs, users, skills and AO's, this would not be as horribly inefficient as it no doubt will be, where on each display of the page, you will tablescan the Users table at least 4x. I also don't see the correlation between a single job and a single skill. Doesn't a single job require more than one skill? I don't know what an "AO" refers to, but the same question remains. Structurally, your bottom section needs a condition, so that you only query when you have a city and job to set in $_POST. Which also begs the question... why do you display other drop downs, yet you don't use them in your query? Try and apply DRY and at very least, write a function to render a drop down. The code for those dropdown lists is always the same -- what varies is simply the select name. One way to handle this would be: function makeSelect($name, $sql) { $out = ''; $result = mysql_query($sql) or die(mysql_error()); if ($result) { $out .= "<select name='$name'>"; while($row = mysql_fetch_row($result) { //output individual select $out .= "\r\n<option value='{$row[0]}'>{$row[0]}</option>"; } $out .= "\r\n</select>"; } return $out; }
  2. Good advice from Kevin. I'll one up him, and just advise you to use PDO with the mysql driver. With session_start() you do it once at the logical top of your script. You should not have code that does: session_start().... some code if (true) session_start() as your current code does. You really want to generalize your login check into a class or function so you can simply do: if (!loggedIn()) { header('Location: login.php'); exit; }
  3. Excellent. There are plenty of organizations that need a website built for them -- or you could just create a hobby site. The best advice I can give you, is that you create a project for yourself that will require you to create a website.
  4. When you state that it is saved as a unix timestamp, does that mean that it is an integer value? Also, what SQL database are you using?
  5. I will definitely get in on this. However if my city is really janky, it will be because my kids are controlling the building process.
  6. As Pikachu posted quite explicitly, they are not the same things. <?= $_GET['order_number'] ?> is not equivalent to <?php $_GET['order_number'] ?> It is actually equivalent to: <?php echo $_GET['order_number']; Understanding the difference is pretty important. Due to the fact that short open tags conflicts with inline xml, php short open tags . They are "safe" so long as your server doesn't have scripts that start with blocks like this: <?xml version="1.0"?> Needless to say, this would confuse the php parser into thinking that it needed to parse the code, when really you meant to output an xml document. However, as of php version 5.4, the = syntax will always work.
  7. First off that code is wrong. You need to call session_start() at the top of any script where you want to use sessions. You don't check whether $_SESSION isset first. Clearing the cache is not the concern. Sessions are linked by cookies, using PHP's default behavior. What will that code do to stop my bot that doesn't accept your cookie anyways?
  8. I'm kind of with Jess here. Why is it in your interest to try and force potential customers to use a particular email address? There are lots of reasons why someone might want to use web email, and I know plenty of small companies, contractors and people who use these sites. I've worked with people who use aol as an example. So you basically don't want their business because they didn't use "someco.com". Seems short sighted to me. With that said, your algorithm depends on explode, and exact matches. One obvious problem is that if I enter me@Gmail.com, i'm getting through your domain list. Ditto, if I put in a subdomain like me@y.something.com. I'd suggest at very least you do: $_POST['email'] = strtolower(trim($_POST['email']));
  9. khanwars is an html/javascript(jquery etc) game that uses php on the backend. It's not clear whether they use mysql or not, but probably not a bad bet that they are using some open source database technology. There are certainly many different options these days for browser based games, from plugins like flash, unity or java, to newer html5/javascript engines. There are books on game development for nearly all these platforms, not to mention tutorials and howtos to get you started. You're best off deciding on your platform first, then drilling down into the specifics of developing a particular type of game.
  10. Hi Stacanovist, It is possible that you got scammed into making an application for someone. We really don't have enough information, but I will say that it is highly unusual for someone to ask for a complete application of any level of complexity. Some of the other replies touched upon better ways to market yourself. It sounds like you have some solid capabilities and built a decent functional application. However, some of the techniques you used, not to mention the overall approach you took is antiquated and could be interpreted as amateurish. For example, you seem to have utilized a good deal of the mvc pattern, but yet don't have a front controller or controllers at all, even though you seem to understand the idea and purpose of controllers. A bigger question I would have is -- considering the options, why wouldn't you use a micro framework? Why write a bunch of code that reinvents wheels? Was this part of the exercise? If it was, that would probably be a sign that this is a scam artist or someone you'd want to steer clear of. I can't think of a single justifiable reason anyone would ask a prospective employee to implement a small application, and require them to write it from scratch. The good news is, that you are clearly experienced enough to create useful applications, and you should be able to find a market for your talent and ability. I'd recommend that you channel your energy into gaining experience with the state of the art php frameworks. Not only will this challenge you, and move you towards the state of the art, it will give you valuable skills that are in demand, and will help you avoid getting sucked into situations like the one you just experienced. Last but not least, if you want to post a zip of the code I'd be glad to take a look at it for you and give you an evaluation. Good luck, and don't let this get you down. Lots of people have made a mistake like this at one time or another. I'm sure you'll learn from it, and you'll be that much more savvy the next time.
  11. One piece of pro - advice I can give you... do not include the php end tag in your files -- especially ones that include functions and classes, and are included in other files, as in the situation you described. One reason for this... if you have a file like this: <?php function somefunc() { } ?> . Just an extra line of whitespace after the end tag, will be enough to trick php into thinking you intended to drop out of a php block and into an html block. You also need to be careful you don't have whitespace before a starting php block, as this will also be seen as html, that should be sent as output. If you leave off the end tag, you eliminate the problem with inadvertant whitespace in includes causing output.
  12. You get this error when output has already been sent prior to the session_start call. There are a number of ways this can happen, either through design, or just having some extra lines at the top or bottom of an include file. Without looking at your code it's impossible to help more than this, but that should be enough for you to start looking for the problem.
  13. Not to split hairs, but RoR is not equivalent to PHP or vice versa. RoR is a web development framework for Ruby. An equivalent comparison would be between RoR and one of the more sophististicated PHP frameworks like Symfony2 or ZF2. Both Symfony2 and ZF2 compare quite favorably at this point to RoR in my not so humble opinion. With that said, I agree with the prior opinions about broadening your horizons.
  14. This community is designed to help people develop websites. We don't find people scripts. There's plenty of other sites, not to mention google for that.
  15. To the script that you are posting to, what it is going to do is accept the $_POST data. I'm unclear on what you're trying to do and why, but I don't see any value in serializing a form and trying to send that to your serverside script. The serverside script should get the post values and then return back what you need to in terms of updating the client DOM with jquery.
  16. You are returning html, so you need to return a valid anchor tag: <a href="...">
  17. The only issue I see is that you need more monitors. At least 3 or 4 more.
  18. As suggested, we have a place for this type of thing. Sounds like an interesting project.
  19. You can pass whatever you want as a parameter to a function. That includes objects, arrays, or what have you.
  20. Great job, and major kudos to Philip who lead the charge on this entire project.
  21. I think what he's saying is that the 3 items should be part of a single drop down menu, but instead they are displaying horizontally in IE9.
×
×
  • 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.