1. Post #1121
    ReThinkVPS
    wilki's Avatar
    July 2011
    190 Posts
    I have inserted some HTML code into a MySQL database using PDO. It inserts but seems to add \ to it like this.
    Code:
    <option value=\"None\">None</option>
    				<option value=\"ActionScript\">ActionScript</option>
    				<option value=\"ASP\">ASP</option>
    				<option value=\"Bash\">Bash</option>
    				<option value=\"C\">C</option>
    				<option value=\"C#\">C#</option>
    				<option value=\"C++\">C++</option>
    				<option value=\"CSS\">CSS</option>
    				<option value=\"HTML\">HTML</option>
    				<option value=\"Java\">Java</option>
    				<option value=\"JS\">JavaScript</option>
    				<option value=\"jQuery\">jQuery</option>
    				<option value=\"Lua\">Lua</option>
    				<option value=\"MySQL\">MySQL</option>
    				<option value=\"ObjC\">Objective C</option>
    				<option value=\"Pascal\">Pascal</option>
    				<option value=\"Perl\">Perl</option>
    				<option value=\"PHP\">PHP</option>
    				<option value=\"Python\">Python</option>
    				<option value=\"Rails\">Rails</option>
    				<option value=\"Ruby\">Ruby</option>
    				<option value=\"SQL\">SQL</option>
    				<option value=\"VBNET\">VB.NET</option>
    I aren't double escaping or anything so why is it putting in the \ in my code.

    This is how I am inserting the code.
    Code:
    $sql = "INSERT INTO `samwilki_cmash`.`posts` (`id`, `date`, `username`, `title`, `content`, `tag`) VALUES (NULL, CURRENT_TIMESTAMP, :username ,  :title, :content, :tag)";
    $q = $con->prepare($sql);
    $q->execute( array('username' => $username, 'title' => $title, 'content' => $content, 'tag' => $tag) );
    Can anyone help?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  2. Post #1122
    you don't need absolute positioning, if you do, you're doing it wrong
    If you use it right it makes certain things a lot easier to do. The trick is to keep your absolutely positioned elements inside something with position relative so they are only absolutely positioned within their parent and not the whole page.
    Reply With Quote Edit / Delete Mac United States Show Events

  3. Post #1123
    Richy19's Avatar
    May 2010
    5,411 Posts
    Im trying to use JQuery UI to have a date picker on an input in a form bbut I cant get it to work.
    I have the following.

    Code:
    <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" />	
    <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
    <script type="text/javascript">
    	$('#datepicker').datepicker({
    						inline: false,
    						changeMonth: true,
    						changeYear: true,
    						dateFormat: "yy-mm-dd"
    					});
    </script>	
    
    
    ..........
    
    <form method="post" action="#" enctype="multipart/form-data">
    	<p>
    		<label>Date: </label><input name="date" id="datepicker" /><br />
    		<label>Content: </label><br />
    		<textarea name="content" rows="2" cols="50"></textarea><br />
    		<label for="file">Filename: </label><input type="file" name="file" id="file" /> <br />
    		<input name="submit" type="submit" value="Submit" />
    	</p>
    </form>
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Dumb Dumb x 1 (list)

  4. Post #1124
    rookwood101's Avatar
    September 2011
    256 Posts
    Im trying to use JQuery UI to have a date picker on an input in a form bbut I cant get it to work.
    I have the following.

    Code:
    <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" />	
    <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
    <script type="text/javascript">
    	$('#datepicker').datepicker({
    						inline: false,
    						changeMonth: true,
    						changeYear: true,
    						dateFormat: "yy-mm-dd"
    					});
    </script>	
    
    
    ..........
    
    <form method="post" action="#" enctype="multipart/form-data">
    	<p>
    		<label>Date: </label><input name="date" id="datepicker" /><br />
    		<label>Content: </label><br />
    		<textarea name="content" rows="2" cols="50"></textarea><br />
    		<label for="file">Filename: </label><input type="file" name="file" id="file" /> <br />
    		<input name="submit" type="submit" value="Submit" />
    	</p>
    </form>
    I think you need to set the input type to text.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  5. Post #1125
    Gold Member
    antid2's Avatar
    August 2008
    640 Posts
    trying to learn rails with the rails zombies course..can someone tell me what i'm doing wrong here?

    Reply With Quote Edit / Delete Mac United States Show Events

  6. Post #1126
    Meow :3
    Ac!dL3ak's Avatar
    July 2005
    6,087 Posts
    trying to learn rails with the rails zombies course..can someone tell me what i'm doing wrong here?

    i'm not entirely sure you have a class named Tweet, check my work on that
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  7. Post #1127
    Gold Member
    antid2's Avatar
    August 2008
    640 Posts
    i'm not entirely sure you have a class named Tweet, check my work on that
    these courses are supposed to automatically create the classes etc, where you can just use them to learn. So i'm not sure what i'm doing wrong here

    edit:

    if anyone is interested, i figured it out.
    Code:
    <% zombies = Zombie.all %>
    
    <ul>
      <% zombies.each do |zombie| %>
        <li>
          <%= zombie.name %>
          <% if zombie.tweets.count > 1%>
          <em> SMART ZOMBIE </em>
          <% end %>
        </li>
      <% end %>
    </ul>
    Reply With Quote Edit / Delete Mac United States Show Events Winner Winner x 1 (list)

  8. Post #1128
    jung3o's Avatar
    October 2011
    2,165 Posts
    trying to learn rails with the rails zombies course..can someone tell me what i'm doing wrong here?

    I think it's zombie.tweet.size > 1
    or
    zombie.tweets.size > 1
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  9. Post #1129
    Richy19's Avatar
    May 2010
    5,411 Posts
    Im trying to fill the top bit of this element but I cant get it to fill all the width, also the top and bottom padding doesnt work but the side does.


    This is the HTML
    
    <div class="event">
            			<span class="date">On the: 12 Mar, 2012</span><br />
            			<div class="content">Hi<span class="hide">6</span></div>
            		</div>
    

    And the CSS:
    @charset "UTF-8";
    
    .event{
    border: 1px solid blue;
    margin: 2em;
    border-radius: 15px;
    width: 600px;
    
    }
    
    .event .hide{
    visibility:hidden;
    }
    
    .event .date{
    border-radius: 15px 15px 0px 0px;
    padding: 5px 15px;
    background-color: #DDD;
    width: 100%;
    position: relative;
    }
    
    .event .content{
    border-top: 1px solid blue;
    }
    
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Dumb Dumb x 1 (list)

  10. Post #1130
    Gold Member
    hexpunK's Avatar
    August 2008
    15,653 Posts
    Is there any reason for the date element to be <span>? <div> will stretch to fit perfectly fine. The padding does seem to be working too. You just have to adjust as the padding doesn't constrain to any size limits you put on the elements for some reason.

    Edited:

    Code:
    <div class="event">
    	<div class="date">On the: 12 Mar, 2012</div>
    	<div class="content">Hi<span class="hide">6</span></div>
    </div>
    Code:
    .event{
    	border: 1px solid blue;
    	margin: 2em;
    	border-radius: 15px;
    	width: 600px;
    }
    
    .event .hide{
    	visibility:hidden;
    }
    
    .event .date{
    	border-radius: 15px 15px 0px 0px;
    	padding: 5px 15px;
    	background-color: #DDD;
    	position: relative;
    }
    
    .event .content{
    	border-top: 1px solid blue;
    }
    Seems to give the result you were trying to get in Firefox.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  11. Post #1131
    Richy19's Avatar
    May 2010
    5,411 Posts
    Is there any reason for the date element to be <span>? <div> will stretch to fit perfectly fine. The padding does seem to be working too. You just have to adjust as the padding doesn't constrain to any size limits you put on the elements for some reason.
    Yea I made the date element a div and it magically worked fine :D
    this is the result http://facepunch.com/threads/1152034...1#post35115273
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Dumb Dumb x 1 (list)

  12. Post #1132
    Gold Member
    hexpunK's Avatar
    August 2008
    15,653 Posts
    Yea I made the date element a div and it magically worked fine :D
    this is the result http://facepunch.com/threads/1152034...1#post35115273
    Much better
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  13. Post #1133
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    trying to learn rails with the rails zombies course..can someone tell me what i'm doing wrong here?

    in ruby we use == for equality testing, not =
    Reply With Quote Edit / Delete Mac Australia Show Events

  14. Post #1134
    secretly a furry
    Jelly's Avatar
    April 2011
    2,023 Posts
    in ruby we use == for equality testing, not =
    Pretty sure == and = mean the same in nearly all languages.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Disagree Disagree x 18Dumb Dumb x 1Agree Agree x 1Optimistic Optimistic x 1 (list)

  15. Post #1135
    mcskinsearch
    hacksore's Avatar
    February 2010
    1,054 Posts
    I can't seem to get this package working. Is this just me that has the issue? I've tried installing it via the package installer and by cloning the git repo. None of the methods were successful in giving me the git integration I'm looking for.

    So if you are one that uses this package flawlessly could you shed some light on installing it correctly.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  16. Post #1136
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Pretty sure == and = mean the same in nearly all languages.
    vb
    Reply With Quote Edit / Delete Mac Australia Show Events Agree Agree x 1 (list)

  17. Post #1137
    secretly a furry
    Jelly's Avatar
    April 2011
    2,023 Posts
    Pretty sure == and = mean the same in nearly all languages.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Zing Zing x 2 (list)

  18. Post #1138
    Dragon Member
    Dragory's Avatar
    January 2006
    1,312 Posts
    Pretty sure == and = mean the same in nearly all languages.
    Pretty sure == and = don't mean the same in nearly any language. Or at least from what I've tried. In VB they might (but then again, I haven't used VB).
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Zing Zing x 3 (list)

  19. Post #1139
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Pretty sure == and = don't mean the same in nearly any language. Or at least from what I've tried. In VB they might (but then again, I haven't used VB).
    i think he means '==' means the same as the '==' in nearly any other language
    Reply With Quote Edit / Delete Australia Show Events Agree Agree x 1 (list)

  20. Post #1140
    PLEASE DON'T EAT ME!
    Doritos_Man's Avatar
    June 2009
    2,941 Posts
    My Dad would like me to create a website for his construction business. I already have hosting and a domain but where should I start?
    Should I start by sketching up a simple website or should I get a CMS of some sort?
    It's going to mostly be static material.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  21. Post #1141
    Dragon Member
    Dragory's Avatar
    January 2006
    1,312 Posts
    i think he means '==' means the same as the '==' in nearly any other language
    Wait, so he meant that "== and = mean the same thing (not between each other) in nearly any language"? As in, == is == and = is = in pretty much any language.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  22. Post #1142
    Meow :3
    Ac!dL3ak's Avatar
    July 2005
    6,087 Posts
    if "==" == "==" and "=" == "="
    print "normal language"
    end
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Funny Funny x 4Winner Winner x 1 (list)

  23. Post #1143
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    My Dad would like me to create a website for his construction business. I already have hosting and a domain but where should I start?
    Should I start by sketching up a simple website or should I get a CMS of some sort?
    It's going to mostly be static material.
    I'll make it for a house. plz
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Funny Funny x 1 (list)

  24. Post #1144
    PLEASE DON'T EAT ME!
    Doritos_Man's Avatar
    June 2009
    2,941 Posts
    I'll make it for a house. plz
    Would you like cardboard or paper?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  25. Post #1145
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    lego is preferred but thanks
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  26. Post #1146
    Richy19's Avatar
    May 2010
    5,411 Posts
    Whats the best way to have an admin account with php? I mean atm all I can think of is to have the user log in and if the user is an admin set a session variable, then check that variable to perform admin things but I dont know if this is secure enought
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Dumb Dumb x 1 (list)

  27. Post #1147
    jung3o's Avatar
    October 2011
    2,165 Posts
    Whats the best way to have an admin account with php? I mean atm all I can think of is to have the user log in and if the user is an admin set a session variable, then check that variable to perform admin things but I dont know if this is secure enought
    why would you need to set a admin variable in session?
    just recheck the database?

    or you can make a separate login for admin cp
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  28. Post #1148
    -Kesil-'s Avatar
    February 2012
    87 Posts
    Pretty sure == and = mean the same in nearly all languages.
    gamemaker

    a really good way to defend against this is writing the code out like

    Code:
    if (1 == tweet.size)
    that way if you do type the following on accident ...
    Code:
    if (1 = tweet.size)
    ... you'll get a syntax error as opposed to setting the value of tweet.size to 1
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 2Dumb Dumb x 2 (list)

  29. Post #1149
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    yoda statements
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Programming King Programming King x 2Funny Funny x 1Agree Agree x 1 (list)

  30. Post #1150
    -Kesil-'s Avatar
    February 2012
    87 Posts
    yoda statements
    there we go. That's what they|my_boss called it
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  31. Post #1151
    Gold Member
    Dennab
    January 2012
    1,137 Posts
    gamemaker

    a really good way to defend against this is writing the code out like

    Code:
    if (1 == tweet.size)
    that way if you do type the following on accident ...
    Code:
    if (1 = tweet.size)
    ... you'll get a syntax error as opposed to setting the value of tweet.size to 1
    "gamemaker" is not a language.
    Reply With Quote Edit / Delete Mac United States Show Events Agree Agree x 6 (list)

  32. Post #1152
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,626 Posts
    hey guys! i'm trying to center an image to the right of some right-aligned text in a link. see below:



    my CSS:

    Code:
    .right
    {
    	text-align: right;
    }
    
    .link
    {
    	border-style: solid;
    	border-width: 1px;
    	border-color: #000000;
    }
    
    .icon
    {
    	display: inline;
    }
    my HTML:

    Code:
    <h2 class="right link"><a href="#">Square <img class="icon" src="docs/square.png" alt="square"/></a></h2>
    i tried "float: right" but that completely moved the image outside of the box.

    i can't use pixel-based sizes because the size of the box/borders is determined by the text size, which is specific in ems, and will be different for different resolutions. so i need to somehow smartly resize the image to fit with the text, then center it vertically

    any ideas? web-dev is not my area of expertise :(
    Reply With Quote Edit / Delete Windows XP United States Show Events

  33. Post #1153
    jung3o's Avatar
    October 2011
    2,165 Posts
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  34. Post #1154
    Gold Member
    camacazie638's Avatar
    November 2005
    476 Posts
    gamemaker
    More like gamechanger.
    I have looked into Lithium hosting as a possible service provider, but recalling; I do not believe their service includes servers capable of running .ASP
    It's a shame, as I feel comfortable with the prices they offer; and maybe I am wrong, but does any service provider similar to Lithium hosting in terms of prices that can run .ASP or Windows scripts?
    Thank you ahead of post.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  35. Post #1155
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    More like gamechanger.
    I have looked into Lithium hosting as a possible service provider, but recalling; I do not believe their service includes servers capable of running .ASP
    It's a shame, as I feel comfortable with the prices they offer; and maybe I am wrong, but does any service provider similar to Lithium hosting in terms of prices that can run .ASP or Windows scripts?
    Thank you ahead of post.
    asp classic is fucking terrible.

    think about this: people were recommending php over it back in 2000
    Reply With Quote Edit / Delete Australia Show Events

  36. Post #1156
    Gold Member
    camacazie638's Avatar
    November 2005
    476 Posts
    asp classic is fucking terrible.

    think about this: people were recommending php over it back in 2000
    I've based my pipeline structure over it and have had no issues, other than finding a Windows server provider. I have kept it quite simple and now knowing it is sparce is some-what comforting, security wise.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 1 (list)

  37. Post #1157
    It should be very unsettling in every other regard
    Reply With Quote Edit / Delete Mac United States Show Events

  38. Post #1158
    rookwood101's Avatar
    September 2011
    256 Posts
    It should be very unsettling in every other regard
    I think these two icons in the bottom of his post tell you everything you need to know:



    Why would you even have IE 6 on windows 7? You'd have to try really hard just to get it on there, and why would you want to anyway?

    Edited:

    Oh and guys, what are your opinions on CakePHP? I've been experimenting with it and it looks pretty cool.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Dumb Dumb x 2 (list)

  39. Post #1159
    Gold Member
    camacazie638's Avatar
    November 2005
    476 Posts
    I think these two icons in the bottom of his post tell you everything you need to know:



    Why would you even have IE 6 on windows 7? You'd have to try really hard just to get it on there, and why would you want to anyway?

    Edited:

    Oh and guys, what are your opinions on CakePHP? I've been experimenting with it and it looks pretty cool.
    Library at my university, my-b; use firefox myself.
    And nonetheless, nosed around a little more and found Lithium covers windows hosting.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  40. Post #1160
    jung3o's Avatar
    October 2011
    2,165 Posts
    I think these two icons in the bottom of his post tell you everything you need to know:



    Why would you even have IE 6 on windows 7? You'd have to try really hard just to get it on there, and why would you want to anyway?
    why do you have an APNG for an avatar? are you that desperate?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Zing Zing x 1 (list)