Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
Why won't spoiler image pop up in tinyboard for the public but in mod.php it does
Recently I made a simple network-multiplayer game (game itself is processing on server, client is only getting and sending the information), but I strongly think it doesn't deserve to be executable because of it's simple nature - so it should be a web-application.
[img_thumb]http://i.imgur.com/HpfuMHv.png[/img_thumb]
I have close to zero web development experience. I wrote a little HTML and JS in the past but never built something complete.
I need to know what I should use to remade the game as a webapp. At first I thought about using a framework but which one? What about using Ruby on Rails or that would be overkill?
To put the question more simplier, how would you make this kind of game?
How do I get these tiles to flexbox row-wrap as I resize the browser window live?
Am I using flexbox correctly here?
[URL="http://almost-there.org/new/squares.php"]http://almost-there.org/new/squares.php[/URL]
[editline]15th December 2013[/editline]
[QUOTE=xianlee;43172392]Is it possible to make it so that when your website is viewed at less than a certain pixel range it swaps to mobile?
E.g if a mobile device width is less than 1024px + a desktop browser window swap to mobile.css[/QUOTE]
I am currently exploring "flexbox" things for CSS to allow my website to layout things differently depending on browser width
[url]https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes?redirectlocale=en-US&redirectslug=CSS%2FTutorials%2FUsing_CSS_flexible_boxes[/url]
You can use jQuery UI to switch classes.
[url]http://jqueryui.com/switchClass/[/url]
And here is a nice jQuery script so you can detect the live browser width of your webpage...
[code]<div id='dimensions'><script>
window.onresize = displayWindowSize;
window.onload = displayWindowSize;
function displayWindowSize() {
document.getElementById ('dimensions').innerHTML = $( window ).width();
};</script></div>[/code]
Could anyone help me with this problem.
Basically I want the top bar to be fixed so whenever I scroll I will still see the top bar.
I set the position of the header as fixed and it worked but the other div is behind the header when it's fixed.
[url=http://i.imgur.com/Qgp2eHT.png][img]http://i.imgur.com/Qgp2eHTl.png[/img][/url]
[code]--------CSS-------
#header {
height: 60px;
width: 100%;
background-color: #141414;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: #c0392b;
position: fixed;
}[/code]
Without the fixed position it's working but the header is not fixed how I want it.
This is how is suppose to look. I've been looking for a solution but I couldn't find anything.
[url=http://i.imgur.com/LtzQqcg.png][img]http://i.imgur.com/LtzQqcgl.png[/img][/url]
[QUOTE=BoowmanTech;43197050]Could anyone help me with this problem.
Basically I want the top bar to be fixed so whenever I scroll I will still see the top bar.
I set the position of the header as fixed and it worked but the other div is behind the header when it's fixed.
[url=http://i.imgur.com/Qgp2eHT.png][img]http://i.imgur.com/Qgp2eHTl.png[/img][/url]
[code]--------CSS-------
#header {
height: 60px;
width: 100%;
background-color: #141414;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: #c0392b;
position: fixed;
}[/code]
Without the fixed position it's working but the header is not fixed how I want it.
This is how is suppose to look. I've been looking for a solution but I couldn't find anything.
[url=http://i.imgur.com/LtzQqcg.png][img]http://i.imgur.com/LtzQqcgl.png[/img][/url][/QUOTE]
[code]
margin-top: 60px; -- or whatever the navigation is --
[/code]
That's for the div that you don't want appearing under/behind it.
Is there any real point in minifying a PHP script?
Or are there any downside to it?
[QUOTE=Datzy;43198317][code]
margin-top: 60px; -- or whatever the navigation is --
[/code]
That's for the div that you don't want appearing under/behind it.[/QUOTE]
If I add the margin-top: 60px; this happens, the header is moved down by 60px, not the content bar.
[url=http://i.imgur.com/Bh5gMEc.png][img]http://i.imgur.com/Bh5gMEcl.png[/img][/url]
I found a way to fix it but idk if this is a good way because it might be bad habit.
Each box it's a div and content div is inside indexcontent. If I give indexcontent a border than the problem is solved for some reasons but if I don't I have the above problem.
[url=http://i.imgur.com/MfKRtaG.png][img]http://i.imgur.com/MfKRtaGl.png[/img][/url]
So should I keep the border or I have to find another fix ?
[QUOTE=gokiyono;43199610]Is there any real point in minifying a PHP script?
Or are there any downside to it?[/QUOTE]
whos gonna see it if it's serverside
[QUOTE=gokiyono;43199610]Is there any real point in minifying a PHP script?
Or are there any downside to it?[/QUOTE]
Unless you're using a remote interpreter, (:v:) it'd be completely useless/dumb to do so.
[QUOTE=BoowmanTech;43199647]If I add the margin-top: 60px; this happens, the header is moved down by 60px, not the content bar.
I found a way to fix it but idk if this is a good way because it might be bad habit.
Each box it's a div and content div is inside indexcontent. If I give indexcontent a border than the problem is solved for some reasons but if I don't I have the above problem.
So should I keep the border or I have to find another fix ?[/QUOTE]
Do you have a live demo or somewhere you can host the site?
What are you trying to accomplish?
[editline]16th December 2013[/editline]
[QUOTE=lkymky;43191822]How do I get these tiles to flexbox row-wrap as I resize the browser window live?
Am I using flexbox correctly here?
[URL="http://almost-there.org/new/squares.php"]http://almost-there.org/new/squares.php[/URL]
[editline]15th December 2013[/editline]
I am currently exploring "flexbox" things for CSS to allow my website to layout things differently depending on browser width
[url]https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes?redirectlocale=en-US&redirectslug=CSS%2FTutorials%2FUsing_CSS_flexible_boxes[/url]
You can use jQuery UI to switch classes.
[url]http://jqueryui.com/switchClass/[/url]
And here is a nice jQuery script so you can detect the live browser width of your webpage...
[code]<div id='dimensions'><script>
window.onresize = displayWindowSize;
window.onload = displayWindowSize;
function displayWindowSize() {
document.getElementById ('dimensions').innerHTML = $( window ).width();
};</script></div>[/code][/QUOTE]
What does it do, scale it down 'fluidly'? do you have to code in percentages and ems or would px work too?
[QUOTE=xianlee;43200264]Do you have a live demo or somewhere you can host the site?
What are you trying to accomplish?
[/QUOTE]
So here are some live examples: The header has a fixed position and indexcontent has a border. Everything is fine except I have a scroll bar on the bottom of the screen which is not the main problem but I would like to fix it.
[code]
----CSS Header----
#header {
height: 60px;
width: 100%;
background-color: #141414;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: #c0392b;
position: fixed;
}
----CSS Content----
#indxcontent {
height: auto;
width: 100%;
border: 1px solid;
}
#content {
width: 960px;
margin-right: auto;
margin-left: auto;
margin-top: 60px;
height: 1200px;
background-color: #eeeeee;
border-right-width: 2px;
border-right-style: solid;
border-right-color: #AAAAAA;
border-left-width: 2px;
border-left-style: solid;
border-left-color: #AAAAAA;
overflow: auto;
}
[/code]
Second example: The header has a fixed position but indexcontent doesn't have a border and the header has been moved 60px from top. If you scroll slowly you will see that the content bar is behind the header.
[code]
----CSS Header----
#header {
height: 60px;
width: 100%;
background-color: #141414;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: #c0392b;
position: fixed;
}
----CSS Content----
#indxcontent {
height: auto;
width: 100%;
}
#content {
width: 960px;
margin-right: auto;
margin-left: auto;
margin-top: 60px;
height: 1200px;
background-color: #eeeeee;
border-right-width: 2px;
border-right-style: solid;
border-right-color: #AAAAAA;
border-left-width: 2px;
border-left-style: solid;
border-left-color: #AAAAAA;
overflow: auto;
}
[/code]
[QUOTE=RusselG;43200027]whos gonna see it if it's serverside[/QUOTE]
Saying things like that are the reason why we need this board.
[QUOTE=BoowmanTech;43200376]*wall of text[/QUOTE]
Ok so what are you trying to do? do you want the content to stay behind the bar and just close the gap it causes when scrolling?
and the scrollbar at the bottom is because of overflow being set to auto on the '#content' div (i think).
if it was set to 'hidden' it would disappear, if it doesn't then its the width percentages causing it, because on one of my old websites I had to set a fixed width on the body as when a browser window was being resized it shrunk the divs down but created a scrollbar and when scrolling to the right it had created some weird gap.
Basically what I want is the content div to be under the header div not behind it.
Most likely the bottom scroll bar it appears because the indexcontent is in percentage and because I have a border.
I added overflow: hidden; in indxcontent and it's working.
[QUOTE=BoowmanTech;43201566]Basically what I want is the content div to be under the header div not behind it.
Most likely the bottom scroll bar it appears because the indexcontent is in percentage and because I have a border.
I added overflow: hidden; in indxcontent and it's working.[/QUOTE]
Not sure then sorry, all I know of is this
[URL]http://codepen.io/senff/pen/ayGvD[/URL]
Anyone know how to get jquery working locally? I tried googles link too and it doesn't work :\ I can get a java alert to work but when I code jquery its just not working..
[QUOTE=xianlee;43201664]Not sure then sorry, all I know of is this
[URL]http://codepen.io/senff/pen/ayGvD[/URL]
Anyone know how to get jquery working locally? I tried googles link too and it doesn't work :\ I can get a java alert to work but when I code jquery its just not working..[/QUOTE]
you are most likely missing this
[code]
$( document ).ready(function() {
//jquery code here
});
[/code]
[QUOTE=Lizart;43203008]you are most likely missing this
[code]
$( document ).ready(function() {
//jquery code here
});
[/code][/QUOTE]
It was actually http:// off of googles CDN, for some reason it misses it off and it doesn't work without adding it locally..
I just added auto_incrementing ids to one of my sql tables so I could delete rows, but now the rows I add are messing up in php
here's the code to add a row, the vars are just straight off a form
[php]
$date = date('Y-m-d', strtotime($date));
$canceled = empty($canceled) ? 0 : 1;
$query = "INSERT INTO shows(date, venue, location, canceled) VALUES ('$date', '$venue', '$location', $canceled)";
[/php]
after getting all the rows, this is what $shows looks like
[code]Array
(
[0] => Array
(
[0] => 7
[1] => 1387170000
[2] => Beaver Bar
[3] => Murells Inlet, SC
[4] => 0
)
[1] => Array
(
[0] => 1
[1] => 1364616000
[2] => The Sound Hole
[3] => Myrtle Beach, SC
[4] => 0
)
)[/code]
which is what it should be, the keys in order are id, date, venue, location, canceled
but when I do
[php]
foreach($shows as $show) {
print_r($show);
};
[/php]
it prints this:
[code]
Array
(
[0] => 1
[1] => 1364616000
[2] => The Sound Hole
[3] => Myrtle Beach, SC
[4] => 0
)
Array
(
[0] => 1
[1] => 1364616000
[2] => The Sound Hole
[3] => Myrtle Beach, SC
[4] => 0
)
[/code]
does anyone know why foreach would be messing up? or what's wrong with my code?
I'm having some hosting issues with GoDaddy and looking for anyone who can help me out.
I uploaded my website a week ago and it works fine. Later I tried to upload an updated version of the website and it worked great, but one issue arose: images do not update. Even if I manually upload the new file with filezilla it still shows up as the old image, and I've tried everything including clearing my cache. Can anyone help?
Is PHP really that bad? I always hear it being put down by proggrammers specifically, but I've been using it and it seems to work fairly well.
Not to mention with platforms like WordPress being built on it, it's hard to stay away from it.
[QUOTE=PortalGod;43207837]
does anyone know why foreach would be messing up? or what's wrong with my code?[/QUOTE]
It's not messing up, $show is a multidimensional array. So when iterating through $show you're just receiving the the two keys within. (array) 0 and (array) 1.
[editline]17th December 2013[/editline]
[QUOTE=Shadow801;43210738]Is PHP really that bad? I always hear it being put down by proggrammers specifically, but I've been using it and it seems to work fairly well.
Not to mention with platforms like WordPress being built on it, it's hard to stay away from it.[/QUOTE]
Meh, a lot of people over-exaggerate on how bad it is. There are definitely better things out there than PHP but it's not as horrible as some people make it out to be.
[editline]17th December 2013[/editline]
Also, Wordpress is a really bad example of "good" code. Projects like WP are part of the reason the language is so frowned upon.
Bad home builders can make an architect's plan look shit. Same principle.
[QUOTE=jetboy;43210739]It's not messing up, $show is a multidimensional array. So when iterating through $show you're just receiving the the two keys within. (array) 0 and (array) 1.
[editline]17th December 2013[/editline]
Meh, a lot of people over-exaggerate on how bad it is. There are definitely better things out there than PHP but it's not as horrible as some people make it out to be.
[editline]17th December 2013[/editline]
Also, Wordpress is a really bad example of "good" code. Projects like WP are part of the reason the language is so frowned upon.
Bad home builders can make an architect's plan look shit. Same principle.[/QUOTE]
I'm actually somewhat confused about WordPress's backend code. I'm not sure if it's bad code or if I'm just too inexperienced to tell if it's actually good code. It simply doesn't feel clean to me, I'm not sure why.
[QUOTE=jetboy;43210739]It's not messing up, $show is a multidimensional array. So when iterating through $show you're just receiving the the two keys within. (array) 0 and (array) 1.[/QUOTE]
it was printing that $shows had two different arrays in it, but printing $show printed the same array twice. for some reason, assigning $show by reference (&) fixed it though.
How can I remove that ?
[url=http://i.imgur.com/MkDM7Ti.jpg][img]http://i.imgur.com/MkDM7Til.jpg[/img][/url]
[QUOTE=BoowmanTech;43217564]How can I remove that ?
[url=http://i.imgur.com/MkDM7Ti.jpg][img]http://i.imgur.com/MkDM7Til.jpg[/img][/url][/QUOTE]
[code]
resize:none;
[/code]
[QUOTE=BoowmanTech;43217564]How can I remove that ?
[url=http://i.imgur.com/MkDM7Ti.jpg][img]http://i.imgur.com/MkDM7Til.jpg[/img][/url][/QUOTE]
resize:none;
Thank you for the answer it worked.
How do you guys come up with your domain names? I'm looking in the direction of something that could mean anything so I'm not limited to one type of project.
[QUOTE=Garrison;43220594]How do you guys come up with your domain names? I'm looking in the direction of something that could mean anything so I'm not limited to one type of project.[/QUOTE]
how about your first and last name?
[QUOTE=Shadow801;43210738]Is PHP really that bad? I always hear it being put down by proggrammers specifically, but I've been using it and it seems to work fairly well.[/QUOTE]
It's mainly nitpicking.
PHP works well if you use it well
Sorry, you need to Log In to post a reply to this thread.