Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. if you know only 1 result will be returned then <?php $query = "SELECT orderID FROM orders WHERE 'sessionID' = '$sessionid'"; $getorderID = mysql_query($query, $connection); $row = mysql_fetch_array($getorderID); $orderID = $row['orderID']; ?> Personally I prefer to use mysql_fetch_assoc() but thats just me (try using the OOP mysqli too - its much nicer)...
  2. do you mean link:www.phpfreaks.com ?
  3. looks like these values are not even being passed - with all the $_POST in there it would seem you have neglected to correctly insert the values into the action attribute of the submittng form... - May I suggest you stick to one form of datatransfer and simply put these values in hidden fields within that form???? post back your form html as well as the code if you have investigated this aspect and are still having problems... PS http://www.pastebin.com can be really helpful in these situations....
  4. hmmm it sounds like your code is constructed in such a manner as to not lend it self to being maintainable with much confidence... I suggest you post the all the code when making requests like this - otherwise the solution offered will fix the portion of code you show but break the portion of code you don't!!! anyhoo lets try and help you a little here... This problem... <?php if ($lastat != $icao_orig) { $sub = 5; $money = $user_array['money']; $newmoney = $money - $sub; mysql_query("UPDATE users SET money = '$newmoney' WHERE username = '$username'"); } ?> the reason that moeny is being set to -5 in the database is becasue $newmoney is being calcualted and the result is -5. Check to see that $user_array has been built properly and contains teh correct info... you can simply up date the record like so... <?php mysql_query("UPDATE users SET money = money - 5 WHERE username = '$username'"); ?> understand that these values may be used elsewhere but doing that kind of update 'protects' you from erroneous code affecting the correct values in the database... one other point here if $lastat is a string then use the strcmp() function - its a little more efficient... next bit... <?php $pay = $flthrs2 * 40; $money = $user_array['money']; $newacct = $money + $pay; mysql_query("UPDATE users SET money = '$newacct' WHERE username = '$username'"); If ($lastat != $icao_orig) { $sub = 5; $money = $user_array['money']; $newmoney = $money - $sub; mysql_query("UPDATE users SET money = '$newmoney' WHERE username = '$username'"); } ?> having two updates like this is a big (and unneccessary) hit on the database... try something like this instead... <?php $newacct = $user_array['money'] + ($flthrs2 * 40); If (strcmp($lastat,$icao_orig) != 0) { $newacct -= 5; } mysql_query("UPDATE users SET money = '$newacct' WHERE username = '$username'"); ?> much less code, much more manageable and only one query regardless of whether you are taking 5 off their cold hard
  5. min-height doesn't work in IE6 - just give that element a height in your ie6 only style sheet - it will increase the height of the element if its content requires (provided you have not done anything with overflow on the container).
  6. soon as you said tables I lost interest... sowwie
  7. try... <?php $string = "abcdefghijklmnopqrstuvwxyz0123456789"; $str = NULL; for($i=0;$i<6;$i++){ $pos = rand(0,36); $str .= $string{$pos}; //Line 24 } ?>
  8. <?php if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } $max = 5; $num = $page * $max - $max; .... ?> change that to... <?php if(empty($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } $max = 5; $num = (--$page) * $max; .... ?>
  9. you could re-build and not use frames (ideal situation) failing that google 'javascript prevent break out of frames' and see what comes up...
  10. start with some good semantic markup.
  11. @Maq using ems allows you scale text too... @rajitha just try it - you won't learn a thing until you attempt things your self. you could always google 'elastic layout' and see what happens...
  12. create an elastic layout (all em based) base your design on 1024 wide and use some javascript to detect resolution and increase the base em value accordingly.
  13. standards compliant markup and style. fix for ie
  14. why don't you learn about table-less layouts? despite what you may think they are fairly easy to get to grips with... I have said it before and will do so again... 'spending 2-3 days learning table-less (or css) layouts will be the most beneficial time you'll ever spend in web development'.
  15. does this widening get corrected on final render? ie is it just the browser displaying things until its worked out what dimensions to give elements? if not and you want certain elements to have a fixed width, give them a fixed width. the only time when this would possibly fall over is when the content does not permit wrapping. eg an image that is wider than the specified width of textual content with no breaking spaces in it or if you have inadvertently placed white-space: no-wrap on an element that affects this portion of layout.
  16. there is only ever one page - there are no pages within a page (unless you use iframes and or - god forbid - frames and consider them separate entities). get your self a good book - here is a good primer: http://www.amazon.co.uk/gp/product/1590596897/ref=sib_rdr_dp get something up there and have it peer reviewed - you'll pick up good habits much quicker...
  17. give your body tag a width value (either fixed or relative) and give it margin: x auto; where x is the top ad bottom margin you wish to apply.
  18. get used to maintaining your presentational layer in CSS files... putting a border attribute on an image is not the best way to keep your site clean and maintainable.
  19. You mean something like this... http://www.cssplay.co.uk/layouts/background not my cup of tea but if it floats your boat.
  20. NEVER entrust anything that controls user input that is used on the client side - ALWAYS validate server side (thats not to say you can't enhance the process - esp ajax - with javascript).
  21. Or sucker fish which is css based (needs a little hacking for ie6 - but hey it'll be dead soon)
  22. Mate - your very own site has me running your way... FAIL
  23. OR even better you could do this properly by not adding any extra html markup just to attain a PRESENTATIONAL goal. there is the rather lovely and simple method to get browser to make an element recognize it has content that takes up space by simply giving that parent container overflow: hidden; this does have a couple of minor bugs but youi can play with different values of overflow (I have never used anything but hidden to get the result I wanted). If you have problems you can use this method which is a little heavier on the code but is reliable... http://www.positioniseverything.net/easyclearing.html
  24. Is it really such hardship to just put this in when you develop your project? The logo for the site is something that I would assume is identical on every page - so just select the image and type it in your css. In order to set this kind of thing dynamically as you have asked - you'd need some server side code to look in a directory and pick he file for you and then update the css file by putting the path to that image in - something pretty pointless IMO.
×
×
  • 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.