Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=Coment;43427671]Getting the stupid question out of the way... Do you have any 'index.html' or 'index.php' at the public_html [I]or [/I]www folder?[/QUOTE]
I feel really stupid. I didn't tried to upload it until you said it.
[editline]5th January 2014[/editline]
Basically that was the problem.
[QUOTE=seanm07;43425303]Previously posted problem with Google Analytics _trackEvent not tracking bounce rate[/QUOTE]
I found the cause to this problem, if anyone else was also wondering why tracking events makes the page no longer record a bounce even if there is one this it's because having an event triggered basically says "ok the user interacted with the site and triggered an event so this will no longer trigger a bounce" however I am tracking all game page visits to record if the size of the game is below x width or greater than x width as the design of the page changes to shift adverts around.
Thanks to this article I found: [URL]http://higheredanalytics.com/analytics/index.php/2010/11/google-analytics-event-tracking-and-its-effect-on-your-site-s-bounce-rate/[/URL] which links to here: [URL]https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide?csw=1[/URL]
_trackEvent has a 5th parameter called [B]opt_noninteraction[/B] which is a boolean that defaults to false telling analytics whether or not the event indicates that the user interacted with the site and then if false bounces from that page after that event was triggered won't be recorded.
Could someone give me some examples how to hash my password.
Basically what I need is a way to hash the inserted password in mysql and a way to get the hashed password for the login page.
[QUOTE=seanm07;43428890]I found the cause to this problem, if anyone else was also wondering why tracking events makes the page no longer record a bounce even if there is one this it's because having an event triggered basically says "ok the user interacted with the site and triggered an event so this will no longer trigger a bounce" however I am tracking all game page visits to record if the size of the game is below x width or greater than x width as the design of the page changes to shift adverts around.
Thanks to this article I found: [URL]http://higheredanalytics.com/analytics/index.php/2010/11/google-analytics-event-tracking-and-its-effect-on-your-site-s-bounce-rate/[/URL] which links to here: [URL]https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide?csw=1[/URL]
_trackEvent has a 5th parameter called [B]opt_noninteraction[/B] which is a boolean that defaults to false telling analytics whether or not the event indicates that the user interacted with the site and then if false bounces from that page after that event was triggered won't be recorded.[/QUOTE]
I'm now trying:
[code]_gaq.push(['_trackEvent', 'Game size', 'Full width', 'Game Title', 1, true]);[/code]
But with the 5th parameter this event does not show in the real time events, does anyone know if this is normal for non-interaction events and will it just show in the behaviour events section in a few hours or am I doing something wrong here?
This post from the Google Analytics blog [URL]http://analytics.blogspot.co.uk/2011/10/non-interaction-events-wait-what.html[/URL] gives an example which is pretty much the same to what I am already using but it's kinda confusing me that the event isn't showing in the real time events.
[QUOTE=BoowmanTech;43428996]Could someone give me some examples how to hash my password.
Basically what I need is a way to hash the inserted password in mysql and a way to get the hashed password for the login page.[/QUOTE]
Ideally [url]http://www.php.net/manual/en/function.password-hash.php[/url] but it's PHP >5.5. So as gokiyono suggested [url]https://github.com/ircmaxell/password_compat[/url].
[code]
$hash = password_hash($password, PASSWORD_BCRYPT, array("cost" => 12));
[/code]
Also something to consider for the future is scrypt.
I'm an idiot, I clicked some keybind in sublime and now my pointer/blink thingy has changed. Where do I change it back? :suicide:
[editline]6th January 2014[/editline]
Nevermind, seems like I've pressed insert. Noticed after it deleted stuff that was already written.
So I tried DirectoryIterator, and it worked pretty well
Until I included the script from a different path.
It gives me this error
[quote]DirectoryIterator::__construct(functions/,functions/): Den angivne fil blev ikke fundet. (code: 2)[/quote]
and it looks like this
[code]
<?php
$path = "functions/";
try{
$iterator = new DirectoryIterator($path);
}
catch(Exception $e){
echo $e->getMessage();
}
foreach($iterator as $fileInfo){
if($fileInfo->isFile()){
$return[] = $fileInfo->getFilename();
}
}
foreach($return as $key => $value){
require_once $path . $value;
}
[/code]
Can anyone tell me why this happens?
Hey guys! I have this box, where i want it to adjust its size after another box. Anyway how can do this? [IMG]http://gyazo.com/e34c37c8140ed2e2c2d3d78548920cdb.png[/IMG]
(The box on the right needs to be the same as the one on the left, and the left box uses "height: auto"
I am still new to the HTML world, so help is much appreciated.
[QUOTE=DisasterSoldi;43436232]Hey guys! I have this box, where i want it to adjust its size after another box. Anyway how can do this? [IMG]http://gyazo.com/e34c37c8140ed2e2c2d3d78548920cdb.png[/IMG]
(The box on the right needs to be the same as the one on the left, and the left box uses "height: auto"
I am still new to the HTML world, so help is much appreciated.[/QUOTE]
[code]
document.addEventListener("orientationchange", doOnOrientationChange);
window.onresize = function(){ doOnOrientationChange(); }
function doOnOrientationChange() {
var cellHeight = 0;
$('.mob-cell').each(function(i, obj) {
cellHeight = Math.max(obj.childNodes[0].offsetWidth);
});
$('.mob-cell').each(function(i, obj) {
obj.childNodes[0].style.minHeight = cellHeight+'px';
if (obj.colSpan != 2) {
obj.childNodes[0].style.Width = cellHeight+'px';
}
obj.childNodes[0].style.fontSize = cellHeight/10+'px';
obj.childNodes[0].style.borderRadius = cellHeight*0.02+'px';
});
}
[/code]
[code]
var cellHeight = 0;
$('.mob-cell').each(function(i, obj) {
cellHeight = Math.max(obj.childNodes[0].offsetWidth);
});
$('.mob-cell').each(function(i, obj) {
obj.childNodes[0].style.minHeight = cellHeight+'px';
if (obj.colSpan != 2) {
obj.childNodes[0].style.Width = cellHeight+'px';
}
obj.childNodes[0].style.fontSize = cellHeight/10+'px';
obj.childNodes[0].style.borderRadius = cellHeight*0.02+'px';
});
[/code]
Its abit ugly/messy but this is the solution I used for a similar issue.
Everytime you change your mobile orientation/resize the screen it gets all elements with
class "mob-cell". All of these elements are set to the height of the tallest element of that class.
I also put a text scaler and corner rounderer which you may want to remove.
ps. I recommend you run this once the dom loads also. It requires Jquery
So I've decided to use CakePHP as a framework for a small project for dealing with user logins to display budgets and allow them to add payments and paychecks and stuff like that. I usually have no problem picking up new languages and syntaxes but I am really having trouble figuring out how CakePHP works. Any tips?
CakePHP isn't a language and hence doesn't have any different syntax. I dunno what you're on about. :v:
If you're looking for a better framework I'd highly suggest checking out Laravel.
I know it isn't a language and doesn't have a syntax, but every framework has its own patterns for development and I have absolutely no clue what CakePHP is doing, it's chaotic.
Well, I'm stuck there.
I have a file manager and I try to store user-submitted images as "pi1.jpg", "pi2.jpg", etc. up to 5.
I want to make it able to edit images as well, but that would leave a gap (or more than one, if he deletes more than one image subsecuently); how would I make it check
[code]if(!file_exists(pi2)){
if(file_exists(pi3)) {
rename pi3 to pi2
} else if(file_exists(pi4))......
[/code] ?
I could use some giant mess of if(file_exists), but I'm sure it'd make some baby cry or a kitten die, or something.
[QUOTE=DisasterSoldi;43436232]Hey guys! I have this box, where i want it to adjust its size after another box. Anyway how can do this? [IMG]http://gyazo.com/e34c37c8140ed2e2c2d3d78548920cdb.png[/IMG]
(The box on the right needs to be the same as the one on the left, and the left box uses "height: auto"
I am still new to the HTML world, so help is much appreciated.[/QUOTE]
height:auto; sets the div to be as high as the content that's inside it, if you put something in it, it will expand.
Hey, I'm new to web development and I need help with color schemes, I just can't seem to grasp how different colors work together and what colors are too bright/dark. I use the color wheel things on the internet like [URL="https://kuler.adobe.com/create/color-wheel/"]this[/URL] but I still cannot find a color scheme that I like.
how do you guys get your color schemes?
[QUOTE=Two-Bit;43446508]Hey, I'm new to web development and I need help with color schemes, I just can't seem to grasp how different colors work together and what colors are too bright/dark. I use the color wheel things on the internet like [URL="https://kuler.adobe.com/create/color-wheel/"]this[/URL] but I still cannot find a color scheme that I like.
how do you guys get your color schemes?[/QUOTE]
I use Kuler as you linked, have you checked out [URL="https://kuler.adobe.com/explore/most-used/?time=month"]others color schemes[/URL] they shared to the public?
[QUOTE=Moofy;43446517]I use Kuler as you linked, have you checked out [URL="https://kuler.adobe.com/explore/most-used/?time=month"]others color schemes[/URL] they shared to the public?[/QUOTE]
Another follow up question, is there a formula for the way the colors are [I]supposed[/I] to be used like for instance is the first block meant for font color, the second for background color the third for responsive elements etc? Because I don't really know how to implement the colors correctly.
Thanks !
[QUOTE=Two-Bit;43446570]Another follow up question, is there a formula for the way the colors are [I]supposed[/I] to be used like for instance is the first block meant for font color, the second for background color the third for responsive elements etc? Because I don't really know how to implement the colors correctly.
Thanks ![/QUOTE]
Well I don't know how to exactly reply to that, I guess "taste"? There is no rules for a text colour can't be green, but look up modern sites or get inspired in here. Really, I haven't seen colours been used in text otherwise it's a heading for a site for example. I use creamy colours for [URL="http://onepagelove.com/"]one page designs[/URL] because I feel they are put in good use at that.
[t]http://i.imgur.com/0pH2inb.png[/t]
So these two divs has a 4 weird 4 pixel space between each other.
[code]
*{
margin:0;
padding:0;
}
#content{
padding:10px;
background-color: aquamarine;
height:500px;
}
/* ---CONTENT RIGHT---*/
#contentRight{
background-color: #0000FF;
border-right: 2px solid #8B8B85;
display: inline-block;
min-height: 400px;
padding: 10px;
width: 550px;
}
/* ---CONTENT LEFT---*/
#contentLeft{
background-color: #FF0000;
border-left: 2px solid #8B8B85;
display: inline-block;
min-height: 400px;
padding: 10px;
width: 120px;
}
[/code]
[IMG]http://i.imgur.com/JZ0Z0Ig.png[/IMG][IMG]http://i.imgur.com/kz0pnmc.png[/IMG]
It shouldn't happen. So what did I do wrong? And how do I get it away?
[editline]7th January 2014[/editline]
[t]http://i.imgur.com/xrsO8h4.png[/t]
Ok, so it counts a newline as a space.
How do I stop that?
[QUOTE=gokiyono;43446938][t]http://i.imgur.com/0pH2inb.png[/t]
So these two divs has a 4 weird 4 pixel space between each other.
......
It shouldn't happen. So what did I do wrong? And how do I get it away?
[editline]7th January 2014[/editline]
[t]http://i.imgur.com/xrsO8h4.png[/t]
Ok, so it counts a newline as a space.
How do I stop that?[/QUOTE]
It's because it counts a new line as a space indeed.
You can fix it by setting it on the same line or you can give the container a font-size:0; and then set font-size:16px; or whatever you want to use on the left and right elements or you can float the element.
Here is an example with float: [url]http://jsfiddle.net/SNpj9/[/url]
[QUOTE=Superkipje;43447094]It's because it counts a new line as a space indeed.
You can fix it by setting it on the same line or you can give the container a font-size:0; and then set font-size:16px; or whatever you want to use on the left and right elements or you can float the element.
Here is an example with float: [url]http://jsfiddle.net/SNpj9/[/url][/QUOTE]
I'm not a big fan of Floats
But I fixed it by changing the border size of one and removing the left one
For columns using table layout (i.e. display: table; in CSS) would probably be a better fit (For starters, it gives you same sized columns by default), for newer browsers Flexbox would be even better.
Floats do work, but they're not designed for it, you shouldn't ever need stuff like "clearfix" ideally.
Can someone explain me why lorempixel fetches the same photo for all sources on the page?
[editline]7th January 2014[/editline]
And can you somehow avoid it?
This is more of a design theory question
What would you do if you are restricted to length of text?
[t]http://i.imgur.com/sg8gBlX.png[/t]
(The borders are just to split the text for display)
[QUOTE=gokiyono;43447555]This is more of a design theory question
What would you do if you are restricted to length of text?
[t]http://i.imgur.com/sg8gBlX.png[/t]
(The borders are just to split the text for display)[/QUOTE]
adjust font size?
[QUOTE=Two-Bit;43447729]adjust font size?[/QUOTE]
That would become too small if there is too much text.
[QUOTE=gokiyono;43447555]This is more of a design theory question
What would you do if you are restricted to length of text?
[t]http://i.imgur.com/sg8gBlX.png[/t]
(The borders are just to split the text for display)[/QUOTE]
Truncate with a (read more) or whatever, unless it's information that's really important to show on that page then either change your design up or keep it overflowing like it is. You could maybe limit the input but that's no good mostly.
[QUOTE=Moofy;43447501]Can someone explain me why lorempixel fetches the same photo for all sources on the page?
[editline]7th January 2014[/editline]
And can you somehow avoid it?[/QUOTE]
I think the browser is seeing that you're linking to the same URL for each image, so it only does one request and uses it for all of them.
A way to get around that would probably be to add junk on the end of the URLS.
e.g.
[url]http://lorempixel.com/400/200/?0[/url]
[url]http://lorempixel.com/400/200/?1[/url]
[url]http://lorempixel.com/400/200/?2[/url]
[url]http://lorempixel.com/400/200/?3[/url]
[QUOTE=gokiyono;43446938][t]http://i.imgur.com/0pH2inb.png[t]
So these two divs has a 4 weird 4 pixel space between each other.
-codesnip-
[IMG]http://i.imgur.com/JZ0Z0Ig.png[/IMG][IMG]http://i.imgur.com/kz0pnmc.png[IMG]
It shouldn't happen. So what did I do wrong? And how do I get it away?
[editline]7th January 2014[/editline]
[t]http://i.imgur.com/xrsO8h4.png[t]
Ok, so it counts a newline as a space.
How do I stop that?[/QUOTE]
Not really related to the problem, but your #contentLeft refers to the right column, and your #contentRight refers to the left column :v:
[QUOTE=deadeye536;43448855]Not really related to the problem, but your #contentLeft refers to the right column, and your #contentRight refers to the left column :v:[/QUOTE]
Absolutely amazing, I must say.
I am going to blame school start on that :v:
Sorry, you need to Log In to post a reply to this thread.