1. Post #1401
    Gold Member
    Bomber9900's Avatar
    December 2008
    2,848 Posts
    WOW, how did i miss the g. I am retarded.

    Edited:

    Ahh, even with the missed lettering, it still hasn't been fixed.
    Code:
    <label for="subcategory">Subcategory</label><select name="test" id="subcategory">
    <option value="4">Axe</option>
    <option value="5">Bow</option>
    <option value="6">Disc</option>
    <option value="7">Greatsword</option>
    <option value="8">Lance</option>
    <option value="9">Scepter</option>
    <option value="10">Staff</option>
    <option value="11">Twin Swords</option>
    <option value="12">Hauberk</option>
    <option value="13">Gauntlets</option>
    <option value="14">Greaves</option>
    <option value="15">Cuirass</option>
    <option value="16">Gloves</option>
    <option value="17">Boots</option>
    <option value="18">Robes</option>
    <option value="19">Sleeves</option>
    <option value="20">Shoes</option>
    <option value="21">Necklace</option>
    <option value="22">Earing</option>
    <option value="23">Ring</option>
    <option value="24">Crystals</option>
    <option value="25">Supplies</option>
    <option value="26">Scrolls</option>
    <option value="27">Materials</option>
    <option value="28">Misc</option>
    </select>
    <label for="class_id">For Class</label><select multiple name="test1" id="class_id">
    <option value="Archer,">Archer</option>
    <option value="Berserker,">Berserker</option>
    <option value="Lancer,">Lancer</option>
    <option value="Mage,">Mage</option>
    <option value="Priest,">Priest</option>
    <option value="Slayer,">Slayer</option>
    <option value="Sorcerer,">Sorcerer</option>
    <option value="Warrior,">Warrior</option>
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  2. Post #1402
    Notebook's Avatar
    March 2011
    26 Posts
    Is there anything wrong with using <!doctype html>?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  3. Post #1403
    Upload Images
    kragmars102's Avatar
    April 2011
    731 Posts
    Is there anything wrong with using <!doctype html>?
    I use
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    Works magic for me in IE.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  4. Post #1404
    jung3o's Avatar
    October 2011
    2,096 Posts
    WOW, how did i miss the g. I am retarded.

    Edited:

    Ahh, even with the missed lettering, it still hasn't been fixed.
    Code:
    <label for="subcategory">Subcategory</label><select name="test" id="subcategory">
    <option value="4">Axe</option>
    <option value="5">Bow</option>
    <option value="6">Disc</option>
    <option value="7">Greatsword</option>
    <option value="8">Lance</option>
    <option value="9">Scepter</option>
    <option value="10">Staff</option>
    <option value="11">Twin Swords</option>
    <option value="12">Hauberk</option>
    <option value="13">Gauntlets</option>
    <option value="14">Greaves</option>
    <option value="15">Cuirass</option>
    <option value="16">Gloves</option>
    <option value="17">Boots</option>
    <option value="18">Robes</option>
    <option value="19">Sleeves</option>
    <option value="20">Shoes</option>
    <option value="21">Necklace</option>
    <option value="22">Earing</option>
    <option value="23">Ring</option>
    <option value="24">Crystals</option>
    <option value="25">Supplies</option>
    <option value="26">Scrolls</option>
    <option value="27">Materials</option>
    <option value="28">Misc</option>
    </select>
    <label for="class_id">For Class</label><select multiple name="test1" id="class_id">
    <option value="Archer,">Archer</option>
    <option value="Berserker,">Berserker</option>
    <option value="Lancer,">Lancer</option>
    <option value="Mage,">Mage</option>
    <option value="Priest,">Priest</option>
    <option value="Slayer,">Slayer</option>
    <option value="Sorcerer,">Sorcerer</option>
    <option value="Warrior,">Warrior</option>
    post ur whole code
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  5. Post #1405
    Gold Member
    Bomber9900's Avatar
    December 2008
    2,848 Posts
    pmd u
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  6. Post #1406
    Gold Member
    wizard`'s Avatar
    August 2009
    932 Posts
    because we are all going to steal your code.
    Reply With Quote Edit / Delete Windows XP Australia Show Events Funny Funny x 1 (list)

  7. Post #1407
    Gold Member
    Bomber9900's Avatar
    December 2008
    2,848 Posts
    nah not that, people usually just make fun of how shitty my coding is. I'm only 4 days into learning this so.

    Edited:

    thank you jung30, the implode tip really helped.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Friendly Friendly x 1 (list)

  8. Post #1408
    Gold Member
    TheDecryptor's Avatar
    September 2006
    4,170 Posts
    Is there anything wrong with using <!doctype html>?
    No, it's the recommended doctype to use simply because it works in so many browsers (That is, it triggers standards mode in all browsers, you don't want to use quirks mode or a transitional doctype)
    Reply With Quote Edit / Delete Mac Australia Show Events Informative Informative x 1 (list)

  9. Post #1409
    I fucking hate Lori.
    Moofy's Avatar
    April 2010
    2,448 Posts
    Simple question:
    Along with the <hr /> tag, is it possible to make a vertical one instead? I have been looking for it a long time now.
    And i really don't want to draw different lengths of a line in like paint for an example when hr is done with:
    <hr width="50%" />
    Reply With Quote Edit / Delete Linux Denmark Show Events

  10. Post #1410
    Gold Member
    wizard`'s Avatar
    August 2009
    932 Posts
    Simple question:
    Along with the <hr /> tag, is it possible to make a vertical one instead? I have been looking for it a long time now.
    And i really don't want to draw different lengths of a line in like paint for an example when hr is done with:
    <hr width="50%" />
    use a div of the verticle height you want, the background of the div the colour you want and the div width as the thickness of your line
    Reply With Quote Edit / Delete Windows XP Australia Show Events

  11. Post #1411
    Gold Member
    Snakess's Avatar
    July 2005
    3,014 Posts
    I'm just getting into JSON by looking at the fp api, I have
    Code:
    {
        "categories": [{
            "name": "Facepunch",
            "forums": [{
                "id": 6,
                "name": "General Discussion",
                "viewing": 86
            }, {
                "id": 60,
                "name": "Fast Threads",
                "viewing": 108
            }, {
                "id": 64,
                "name": "Videos And Flash Movies and That Kind Of Crap",
                "viewing": 51
            }, etc
    I can't seem to get the name of one of the forums, I thought it was just something like:

    Code:
    $jsonDec = json_decode($var);
    $newVar = $jsonDec->categories->forums['2']->name;
    What am I doing horribly wrong?

    much appreciated!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  12. Post #1412
    We're Born Under the Northern Lights
    Skorpy's Avatar
    July 2005
    1,893 Posts
    I'm just getting into JSON by looking at the fp api, I have
    Code:
    {
        "categories": [{
            "name": "Facepunch",
            "forums": [{
                "id": 6,
                "name": "General Discussion",
                "viewing": 86
            }, {
                "id": 60,
                "name": "Fast Threads",
                "viewing": 108
            }, {
                "id": 64,
                "name": "Videos And Flash Movies and That Kind Of Crap",
                "viewing": 51
            }, etc
    I can't seem to get the name of one of the forums, I thought it was just something like:

    Code:
    $jsonDec = json_decode($var);
    $newVar = $jsonDec->categories->forums['2']->name;
    What am I doing horribly wrong?

    much appreciated!
    Try
    Code:
    $jsonDec->categories[0]->forums[2]->name
    Reply With Quote Edit / Delete Linux Finland Show Events Friendly Friendly x 1 (list)

  13. Post #1413
    Notebook's Avatar
    March 2011
    26 Posts
    No, it's the recommended doctype to use simply because it works in so many browsers (That is, it triggers standards mode in all browsers, you don't want to use quirks mode or a transitional doctype)
    Much appreciated!
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  14. Post #1414
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    Code:
    <input type="number" />
    Anything similar to that but working in moz and ie as well?
    Integer only input.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  15. Post #1415
    Gold Member
    Sanya_Zol's Avatar
    August 2010
    157 Posts
    Code:
    <input type="number" />
    Anything similar to that but working in moz and ie as well?
    Integer only input.
    You need something like.. http://validval.frebsite.nl/
    Reply With Quote Edit / Delete Windows 7 Russian Federation Show Events

  16. Post #1416
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    I need just this:

    Code:
    function is_int(value){ if((parseFloat(value) == parseInt(value)) && !isNaN(value)){ return true; } else {  return false; } }
    function forceint(ele){ if(!is_int(ele.value)){ ele.value = 0; }  }
    But it fails if someone disabled javascript. So I'd rather use something like type="number". But if there is nothing like that supported in all major browsers I guess I'll have to use javascript.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  17. Post #1417
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    Code:
    <input type="number" />
    Anything similar to that but working in moz and ie as well?
    Integer only input.
    Use Javascript for now. The new HTML5 input types are still in works and you can't rely on them but they are nice to use along side javascript validation.

    Edited:

    I need just this:

    Code:
    function is_int(value){ if((parseFloat(value) == parseInt(value)) && !isNaN(value)){ return true; } else {  return false; } }
    function forceint(ele){ if(!is_int(ele.value)){ ele.value = 0; }  }
    But it fails if someone disabled javascript. So I'd rather use something like type="number". But if there is nothing like that supported in all major browsers I guess I'll have to use javascript.
    Server-side validation is a must anyway.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  18. Post #1418
    Gold Member
    hexpunK's Avatar
    August 2008
    15,344 Posts
    No, it's the recommended doctype to use simply because it works in so many browsers (That is, it triggers standards mode in all browsers, you don't want to use quirks mode or a transitional doctype)
    It's also recommended for HTML5 development right now if I recall isn't it? Is the standards mode literally the only reason it's being used right now? Because it's quite nice not having to use the long ass DocTypes that HTML/XHTML 4 uses currently.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  19. Post #1419
    Gold Member
    TheDecryptor's Avatar
    September 2006
    4,170 Posts
    Yeah, it's the official HTML5 doctype, but it was picked simply due to browser behaviour (in quirks mode/almost standards mode browsers ignore parts of the HTML/CSS specs on purpose)

    It has the benefit of being the most compatible doctype, and also being the shortest.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  20. Post #1420
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,691 Posts
    Interestingly enough my question is yet to be answered (http://stackoverflow.com/questions/9...nt-work-in-app)
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  21. Post #1421
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Interestingly enough my question is yet to be answered (http://stackoverflow.com/questions/9...nt-work-in-app)
    that makes no sense at all

    Can I see your schema.rb?
    Reply With Quote Edit / Delete Australia Show Events

  22. Post #1422
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,691 Posts
    that makes no sense at all

    Can I see your schema.rb?
    I completely agree with you, it doesn't.

    Here it is:
    Code:
    ActiveRecord::Schema.define(:version => 20120321200514) do
    
      create_table "posts", :force => true do |t|
        t.string   "title"
        t.text     "description"
        t.datetime "created_at",  :null => false
        t.datetime "updated_at",  :null => false
        t.string   "user"
        t.integer  "user_id"
        t.integer  "time"
      end
    
      create_table "users", :force => true do |t|
        t.string   "name"
        t.text     "password"
        t.text     "pin"
        t.datetime "created_at", :null => false
        t.datetime "updated_at", :null => false
        t.text     "salt"
      end
    
    end
    P.S.: Yeah, I know some fields in "posts" table are not necessary, but I'm still learning, so didn't knew about some stuff.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  23. Post #1423
    -Kesil-'s Avatar
    February 2012
    87 Posts
    Is there a way to make a form not submit to another page?
    I run this
    Code:
    <html>
    <body>
    
    <form >
    First name: <input type="text" name="FirstName" value="Mickey" /><br />
    Last name: <input type="text" name="LastName" value="Mouse" /><br />
    <input type="submit" value="Submit" />
    </form>
    
    <p>Click the "Submit" button and the input will be sent to a page on the server called "form_action.asp".</p>
    
    </body>
    </html>
    and it insists on going to another page.

    I want to be able to press enter when I'm done and have the form submit itself.
    Looks like I'm gonna need to inject some javascript... right?
    I've actually never need to do this before... introsting..
    Reply With Quote Edit / Delete Mac United States Show Events

  24. Post #1424
    Gold Member
    StinkyJoe's Avatar
    June 2006
    2,196 Posts
    Is there a way to make a form not submit to another page?
    I run this
    Code:
    <html>
    <body>
    
    <form >
    First name: <input type="text" name="FirstName" value="Mickey" /><br />
    Last name: <input type="text" name="LastName" value="Mouse" /><br />
    <input type="submit" value="Submit" />
    </form>
    
    <p>Click the "Submit" button and the input will be sent to a page on the server called "form_action.asp".</p>
    
    </body>
    </html>
    and it insists on going to another page.

    I want to be able to press enter when I'm done and have the form submit itself.
    Looks like I'm gonna need to inject some javascript... right?
    I've actually never need to do this before... introsting..

    You need to use javascript to override the default behavior - which is to submit to the current address if no action attribute is given.
    Reply With Quote Edit / Delete Linux Portugal Show Events Friendly Friendly x 1 (list)

  25. Post #1425
    insert long title here
    SEKCobra's Avatar
    January 2009
    15,135 Posts
    Is there a way to make a form not submit to another page?
    I run this
    Code:
    <html>
    <body>
    
    <form >
    First name: <input type="text" name="FirstName" value="Mickey" /><br />
    Last name: <input type="text" name="LastName" value="Mouse" /><br />
    <input type="submit" value="Submit" />
    </form>
    
    <p>Click the "Submit" button and the input will be sent to a page on the server called "form_action.asp".</p>
    
    </body>
    </html>
    and it insists on going to another page.

    I want to be able to press enter when I'm done and have the form submit itself.
    Looks like I'm gonna need to inject some javascript... right?
    I've actually never need to do this before... introsting..
    Why not use post? method="post" action=""
    Reply With Quote Edit / Delete Windows 7 Austria Show Events Friendly Friendly x 1 (list)

  26. Post #1426
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,691 Posts
    Or, if he's using php, and the form page is called "form.php", he can just change to this:
    Code:
    <form action="form.php">
    ...
    </form>
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 2Friendly Friendly x 1 (list)

  27. Post #1427
    jung3o's Avatar
    October 2011
    2,096 Posts
    hes asking about pressing enter not action page
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1 (list)

  28. Post #1428
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,691 Posts
    Oh, then yeah, easiest way would be $.post() in jQuery.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1 (list)

  29. Post #1429

    July 2007
    864 Posts
    <?php
    function NewColor() {
    	$color = "";
    
    	$array = array(
    				mt_rand(0,15),
    				mt_rand(0,15),
    				mt_rand(0,15),
    				mt_rand(0,15),
    				mt_rand(0,15),
    				mt_rand(0,15),
    			);
    
    	foreach ($array as $key => $value) {
    		switch ($value) {
    			case 10:
    				$color .= 'a';
    				break;
    			case 11:
    				$color .= 'b';
    				break;
    			case 12:
    				$color .= 'c';
    				break;
    			case 13:
    				$color .= 'd';
    				break;
    			case 14:
    				$color .= 'e';
    				break;
    			case 15:
    				$color .= 'f';
    				break;		
    			default:
    				$color .= $value; 
    				break;
    		}
    	}
    	return $color;
    }
    
    $width  = 101;
    $height =  101;
    $image = @imagecreate($width, $height) or die('Cannot initialize GD!');
    $y = 1;
    while ($y !=$height) {
    	$x = 1;
    	while ($x != $width) {
    		$rgb = NewColor();
    		$r = intval(substr($rgb, 0, 2));
    		$g = intval(substr($rgb, 2, 2));
    		$b = intval(substr($rgb, 4, 2));
    		imagesetpixel($image, $x, $y, imagecolorallocate($image, $r, $g, $b));
    		//echo("<p>".$x." - ".$y."</p>");
    		//imagesetpixel($image, $x, $y, imagecolorallocate($image, mt_rand(0,255), mt_rand(0,255), mt_rand(0,255)));
    		$x++;
    	}
    	$y++;
    }
    header('Content-Type: image/jpeg');
    imagejpeg($image);
    imagedestroy($image);
    ?>
    This produces this:

    Whereas it SHOULD be random pixels all over?
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events

  30. Post #1430
    -Kesil-'s Avatar
    February 2012
    87 Posts
    http://lesscss.org/
    ^why isn't CSS like this by default?
    Is it just because they didn't think of it?
    Reply With Quote Edit / Delete Mac United States Show Events

  31. Post #1431
    zhed+redball.jpg
    xmariusx's Avatar
    May 2010
    1,390 Posts
    I like how you can define a constant! :D
    Reply With Quote Edit / Delete Windows 7 Norway Show Events Friendly Friendly x 1 (list)

  32. Post #1432
    insert long title here
    SEKCobra's Avatar
    January 2009
    15,135 Posts
    Or, if he's using php, and the form page is called "form.php", he can just change to this:
    Code:
    <form action="form.php">
    ...
    </form>
    Or he leaves it like I put it and it works, because you know, that just refers to the current page
    Reply With Quote Edit / Delete Windows 7 Austria Show Events

  33. Post #1433
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    Chrome, Safari, Firefox
    So no IE and Opera?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  34. Post #1434
    Gold Member
    StinkyJoe's Avatar
    June 2006
    2,196 Posts
    So no IE and Opera?
    Only if you're using the client-side script, which you shouldn't use in production.
    Reply With Quote Edit / Delete Linux Portugal Show Events Agree Agree x 1 (list)

  35. Post #1435
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    Maybe I should start learning something about server stuff... I have no idea what to do to make a VPS working and host websites on it with features I can't do with shared hosting. But I don't see any way of learning it without first renting one, and it feels kinda stupid to spend money on something alien to me.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  36. Post #1436
    insert long title here
    SEKCobra's Avatar
    January 2009
    15,135 Posts
    Uhm, just set one up on your home PC?
    Reply With Quote Edit / Delete Windows 7 Austria Show Events

  37. Post #1437
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    Uhm, just set one up on your home PC?
    On my acer laptop that overheats when I start up windows media player?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Funny Funny x 1 (list)

  38. Post #1438
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    Maybe I should start learning something about server stuff... I have no idea what to do to make a VPS working and host websites on it with features I can't do with shared hosting. But I don't see any way of learning it without first renting one, and it feels kinda stupid to spend money on something alien to me.
    Install a web server and away you go. Make multiple vhost's to point your domain's to the correct directory. Obviously you have to install languages you're using.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  39. Post #1439
    Gold Member
    StinkyJoe's Avatar
    June 2006
    2,196 Posts
    Install a web server and away you go. Make multiple vhost's to point your domain's to the correct directory. Obviously you have to install languages you're using.
    I'd recommend setting up a linux installation on a virtual machine - you get to play around with a close-to-real-life environment in a controlled manner, without having to worry about screwing things up.
    Reply With Quote Edit / Delete Linux Portugal Show Events Agree Agree x 1 (list)

  40. Post #1440
    insert long title here
    SEKCobra's Avatar
    January 2009
    15,135 Posts
    On my acer laptop that overheats when I start up windows media player?
    1: WMP is definitely more of a resource hog than apache with 1 client or less
    2: It actually OVERheats when you do that? lmao
    Reply With Quote Edit / Delete Windows 7 Austria Show Events