[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/wdg/ - Web Dev General
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 20
File: 1449342190628.png (747 KB, 824x553) Image search: [Google]
1449342190628.png
747 KB, 824x553
Old Thread >>51737163

>/wdg/ - Security Edition

>IRC Channel
#/g/wdg @ irc.rizon.net
Web client: https://www.rizon.net/chat

>Learning material
https://www.codecademy.com/
https://www.bento.io/
https://programming-motherfucker.com/
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md
https://www.theodinproject.com/

>Frontend development
https://github.com/dypsilon/frontend-dev-bookmarks

>Backend development
https://en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks

>Useful tools
https://pastebin.com/q5nB1Npt/ (embed) (embed)
https://libraries.io/ - Discover new open source libraries, modules and frameworks and keep track of ones you depend upon.

>NEET guide to web dev employment
https://pastebin.com/4YeJAUbT/ (embed) (embed)
>>
Tell us what you're working on.
>>
How do you make it so that when someone clicks a link the next page holds information from a database for that link clicked on node? For example, if I have a database of products and an inventory page listing the product names, how do I make it so that when someone clicks on a product it loads a product details page that shows all the information relevant to that product?
>>
>>51787714

I just started learning Node.js, but I know you'll need Express.js for that.

http://expressjs.com/en/api.html
>>
>>51787745

Same here. I am using express and a project all setup. I was just hoping someone knew how to do that. I'm not familiar with how passing data like that from page to page works on the web. I've done it in mobile applications but not on a website.
>>
Anyone got any experience with ServerPilot? I'm keen on using a control panel which is free and lightweight (LEMP, firewall, switching PHP versions, quick security patches for exploits and only a few other things). Don't want to go straight in to managing everything by myself with SSH just yet.
>>
Really wanting to get into webdev. Know a fair bit of static stuff, HTML/CSS and a little bit of JS.

Looking at backend stuff... where the fuck do I even start? Everyone is using a different system, and everyone thinks there's is the best. Except for PHP, those fuckers are just stubborn.

So, what backend, and where is the best place to learn it? (Prefer MOOC/Codeacademy style resources)
>>
>>51788478
I tried C# and Ruby but I liked javascript the most so I went with NodeJS. Try to get an introduction for every backend lang. And choose the one that makes the most sense to you.
>where is the best place to learn it?
well I prefer to read books, I guess I can't help with that.
>>
>>51788478
>backend
Go

https://tour.golang.org and follow the links that appear at the end. also, go to #go-nuts @ freenode and ask questions there.
>>
>>51789441
>Go
Stop recommending things you don't use yourself to people.
>>
phew no wordpress site broke when updating to 4.4.
>>
>>51789573
Only update if you have a very good reason to do so. And even then proceed with caution.
>>
>>51789588
You're right. You should wait for others to make the plunge first. But sometimes it's just too tempting. I did make backups first though.

I also want to update to PHP7, but I'm afraid it might break some themes and plugins I made. So I'll try that in a test version first.
>>
I know everyone hates PHP, but I use it only to provide a backend to an API. It's pretty much a thin wrapper around a database, only does security checks and trusts the client.

What language would you use instead? It's for mongodb.

Things like
check input
does it have a valid id?
insert in database
exit
>>
Is it possible to edit the html of a youtube video so that its position is fixed? I want to be able to watch the video and read comments at the same time. I tried adding an attribute, but it didn't seem to change anything. Anyone have a solution to this?

I know this isn't really wdg related, but most of you guys in here should know this.
>>
>>51790156

#player-api

change position to fixed instead of absolute
>>
>>51790306
Thank you! I kept trying to change the 'content' id instead of the 'player' id.
>>
>>51790380

Yeah I found like four different elements that related to the player before finding the right one

btw you can also change the player size if you want to see more comments
>>
>>51790434
Yeah I figured that part out, but it's kind of hard to change the size of the player without cutting off part video
>>
>>51789556
>Stop recommending things you don't use yourself to people.
I do use it, that's why I recommend it.
>>
Where is the guy that was developing a web framework with C# which allegedly was ultra-fast?
>>
How much do you guys make? Only web devs pls
>>
Are there any web dev/programming/design specific podcasts you guys listen to? I'm self learning and would like to listen to something useful while I'm at work
>>
>>51790039
Any language is fine for something so simple, but don't expect PHP to scale well, if you get more users.

>mongodb
Drop this, if you have anything of importance to store.
>>
First for clojurescript. The most awesome programming language ever!
>>
>>51791136
It was fast, because it never implemented the full HTTP spec. Of course no SSL, no SPDY, no websockets and not even a hint of HTTP/1.1 or HTTP/2.0.
>>
>>51791639
Really? fuck... Source on this? Did he ever released it or something?
>>
>>51791669
I asked him about features and he answered. You can check the archives or maybe wait for him to show up.
>>
>>51791513
>I'm self learning and would like to listen to something useful while I'm at work

How can you learn while doing work?

Or are you not working as a developer now?
>>
File: 2342.jpg (50 KB, 615x340) Image search: [Google]
2342.jpg
50 KB, 615x340
Im making a UI with data visuals and want to know what type of chart this is. How should i go about creating something like this?
>>
>>51791741
Nice, thanks. Aprox dates?
>>
>>51791819
For implementation? Memory is blurry, so take it with a grain of salt, but I think never, because then it would not be fast anymore.
>>
>>51791840
No, no, I mean when did you ask him about these things, so I can go check the archives.
>>
How do I style an input element with default value so it looks like the rest ofthe text in the parent element?
Basically what I want to do is make part of the text editable when the user clicks on it. Is there a better way of doing this with JS?
>>
>>51791901
A few weeks, maybe. If I am not confusing him with another anon, the thing was called FAP.NET.
>>
im trying to use this bar chart on my website im making but getting a "output is not defined" error

heres the bar chart with the code:

http://misoproject.com/d3-chart/examples/basic.html


please help i have no idea what the issue is. I noticed "output" is being passed as a argument but dont know what "output" actually is.
>>
>>51791751
I'm not yet a developer. I work a menial data entry job
>>
>>51792155
and where's your code?
>>
>>51792195

im using the same code on that link. I dont have the API yet im just working on the ui. I cant get the graph to show. I'm including d3.chart.js, then i have both the js and styles that the link gives you on the .html page. Am i missing something?
>>
>>51792209
did you include d3.js?
>>
>>51792218

yeah
>>
>>51792209
>>51792232
it would have been much easier if you posted your code.
you copy and pasted the example without knowing what it does.

replace output with a selector of the element you want to render it in.
>>
When hosts have different price plans and talk about "mysql connections", what do they mean? Right now i have "4 mysql connections". If i upgrade i can get up to 32 or unlimited connections. Is this a limit on how many users can use my site? Or is it a limit for the amount of devs working with the database?

Bit confused
>>
>>51792258

thanks that got me in the right direction

i put in the id of the element where i wanted to the graph to show
>>
>>51787714
Use RESTful routing

/products returns the index page
/products/{id} returns the product's page

In the index page, render links with the id for a product. In the route handler for a product, query with the given id and render it into the view.

>>51787825
This information would not be passed between pages like in a mobile environment. You're always asking the server for what you need. In the index page you're essentially listing links to where you get a product's info from the server.
>>
hi i have a question. when i use the @media property, and lets say max-width: 500px; is it going to get its information from the meta tags?
Ok so if i write,
@media(max-width:500px;) {
.classof-random-div{ background-color: red; }

Do i need to have meta tags in order for this to work? From what i've seen so far by testing my code this is true.

-thanks
>>
>>51791503
£25,000 in the North of England after 7 years in industry.

Our wages are low here, but so is cost of living so it all works out.

>>51791513
Been sort of following the Laravel cabal and their productions lately:

http://www.laravelpodcast.com/
http://www.fullstackradio.com/
http://www.devdiscussions.com/
http://anythingbutcode.xyz/
http://www.fiveminutegeekshow.com/

Haven't listened to this in years, it stopped for years but is back again, and it was more relevant when I was freelancing:
https://boagworld.com/show

>>51793153
I have no idea and I'm currently working for a company that has a hosting team too. I've never heard of limiting ODBC connections. Perhaps it's some cheapo shared-hosting reseller that means number of databases, not connections?
>>
>>51787714
Two Ajax requests

One loads a list of products by product ID
The other loads the product information itself

Say
/api/products?0.100 //loads a list of products
/api/product?42 //loads product 42


Easy. You could even make both products (with an s) and if there are two parameters, you load a range and if there's one you load the specific product information.

You can trigger these Ajax requests from onclick events and then use append/html replace to build a product page.

>>51788478
Go, Node, Java and C# are all great languages for backends. Pick one of these and I'll tell you the library I prefer.

>>51789556
I use my custom backend framework written in C#, I used to suggest it to /wdg/ but it's starting to feel narcissistic mentioning it in every thread. I don't want /g/ to hate me (and I would if the tables turned).

>>51790039
Go, Node, Java and C# all "scale" well (lol, they all do >2000 rps), are secure and work well with a variety of databases.

>>51791136
Yo.

What do you need?

>>51791639
This shits me.

Why would I reimplement security when your static webserver does it better, faster and more reliably? That's just an accepted nono. Implement ssl (and compression) from nginx or apache like a big boy.

Also, you attack me every time I mention it. We both know there's no sane reason to implement ssl from a backend.
>>
>>51794211
Yes, you need the viewport meta tag:

<meta name="viewport" content="width=device-width">
>>
>>51791639
I feel like you and the other guy are samefagging... You just really don't like me, do you? I have an odd feeling you're that overly aggressive "super coder" guy trying to justify yourself by pretending I'm uneducated, look I don't hold a grudge (thus the email).

> not even a hint of HTTP/1.1 or HTTP/2.0.
http://www8.org/w8-papers/5c-protocols/key/key.html

I implement most of those features, like caching, transfer encoding (MTU is a property in the server class, change it if you must), etc. Actually, not many other web libraries cache, so I guess mine is the only one that implements http 1.1?

Lastly, whole point was to get away from sockets and implement something as simple as a python web library, just receiving and returning strings. If you want sockets you can call TcpListener yourself, my code is all open source and I'd be flattered if you used it.

Dunno about spdy, does anyone really absolutely need it? You already know my opinion on tls, I'd sooner implement compression from FAP, at least that has a performance advantage.
>>
File: awat.png (64 KB, 1499x571) Image search: [Google]
awat.png
64 KB, 1499x571
>>51794583
Im using fortrabbit, will probably just shoot them an email asking them to clarify.
>>
>>51791561
What's wrong with MongoDB?
>>
>>51791136
>C#
>ultra-fast
You mean nobody? Yeah I remember that guy.
>>
>>51795104
Do u know of any lower level explanations I'm justcurious
>>
>>51795501
It's faster than the Microsoft libraries, not by much, but whatever. It's not faster than fastcgi or Go or even Node (I know...), although I sometimes wonder if Node only opens connections fast and otherwise executes JavaScript as slow as you'd expect.

I'm being constantly reminded that posting my project on /g/ wasn't as well received as I first thought. To be honest I just thought writing a web library that benchmarked faster than a few professional libraries would help me get me a job, it's not easy where I live and every employer wants to (programmatically) know your gender. Yeah....
>>
>>51794211
>Do i need to have meta tags in order for this to work?
Well, shit man. You could have tested this yourself.
>>
>>51795365

I'm guessing its the number of databases they allow? There's no way they're referencing users because why the hell would they give a shit.
>>
What's the best all-in-one resource to learn Web Dev? I was looking at "FreeCodeCamp" which so far looks the most promising to me (it teaches Node rather than Ruby, which I think I'd rather learn). Any alternatives better?
>>
>>51794583
That's a pretty decent salary imo (about $37k US). I'd take that, but I would be doing extra on the side for additional income, possibly starting my own business.
>>
>>51795497


Prone to losing data. At least from what I heard, so I am not sure if it's a valid thing for me to say.

I went from HTML/CSS, then Javascript, then I tried PHP, but was too much of a hassle in Windows, and every book I've read basically told me to use a Mac or fuck off, so I took some Anons advice and went with C#. I gotta say though, C# forced me to write cleaner and more maintained code, and Razor is a pretty wonderful engine so I'm sticking with that.
>>
>>51796240
>PHP, but was too much of a hassle in Windows
Wat? You only need XAMPP/WAMP to run PHP on your machine... Or if you feel like taking the scenic route, install and configure Apache directly.
>>
Does Google index js heavy pages properly?

There was a blog post or something that says they do, but I had a fairly simple site which used jquery to fetch and append html and it wasn't indexed properly.
>>
I just wasted 2 hours of my life trying to figure out why the task system wasn't working correctly when it was all because it was only configured for one worker
How the fuck do I even have a job
>>
>>51796517
What language?
>>
>>51791503
$105k. I do "hipster" JS stuff.
>>
Starting my webdev journey. Hoping to get a job within the next 2 years. Going to be studying at least 12 hours a week. Any good resources on understanding HTTP?
>>
>>51791503
$40 an hour, depends on how much I bill in a month.
>>
>>51797054
I read a few articles but I still don't have the full understanding I'm going for.

http://www.slashroot.in/httphypertext-transfer-protocol-request-and-response

http://www.garshol.priv.no/download/text/http-tut.html
>>
>>51791503
$65k per year, northeastern United States
most jobs are usually 90k to 120k around here, but I am lowly
>>
>>51795497
It has a lot of very strange caveats that don't make a lot of sense

For example they say you should try to shove everything in the same document. Okay sure, accepting that to be true, you can't update nested arrays

So, if you have a nested many-to-many relationship (eg, `user` has `orders`, `orders` has `products`), it kind of defeats the "denormalizing on the write".

And I find random shit like this everywhere when I use it at work.

Just use postgres.
>>
>>51796608
NodeJS, went from godly dev box with umptbillion cores to puny test server, and didn't think about downside of defining number of workers by CPUs present.
>>
>>51795660
>>51795626
>>
>>51797171
>Just use postgres.

Actually, postgres now has NoSQL features like Key-Value through HSTORE and JSON support.
>>
File: 1449159393778.jpg (643 KB, 2000x1000) Image search: [Google]
1449159393778.jpg
643 KB, 2000x1000
Hey /wdg/. I have been dabbling in programming languages and experimented a ton in the web development area. I'm no expert. Just a hobbyist. But id like to do this as a part time job while I'm in university. I was wondering if you guys can tell me what the programming standard in web development is. What do I have to learn in order to become more than just a hobbyist.
>>
>>51797054
>HTTP: The Definitive Guide

http://code.tutsplus.com/tutorials/http-the-protocol-every-web-developer-must-know-part-1--net-31177

http://code.tutsplus.com/tutorials/http-the-protocol-every-web-developer-must-know-part-2--net-31155

http://code.tutsplus.com/tutorials/a-beginners-guide-to-http-and-rest--net-16340
>>
>>51793153
It basically translates to concurrent web requests.
>>
>>51797464
Something this thorough is exactly what I was looking for. Thanks
>>
>>51796240

Yeah, but Apache wasn't having any of it. Didn't kept giving me hoops to jump through. But I did found that IIS and Webmatrix can run PHP out of the box with no configuration required, so if I were to want to get back to PHP, I'd have that option.
>>
does anyone have experience with twitter card and open graph?
can you embed an audio file in twitter? if so, how?
I'm trying to embed this as a test, but it just won't work: http://www.nask.co/L/KyTzu9B3BE

also, on a related question... how does that page look? is it too ugly, is it good enough?
>>
>>51798503
Buttons/controls are huuge.
>>
>>51798758
they are?
they should be the default controls of your browser or whatever your system uses...
>>
>>51797054
>Going to be studying at least 12 hours a week.
That's a bit overkill for just webdev
>>
>>51791503
35k euros a year in Northern Finland. It's kinda low for the industry here but I've been working for less than a year and the cost of living is low so I'm not complaining. I don't think anyone expects to start at the top when they don't have any sort of references or history. I already got a quite substantial raise some time ago so I'm getting there.
>>
>>51799010
That's less than 2 hours a day you shill.
>>
I'm so fucking pissed that I learned javascript over jquery
>hur dur javascript will help me learn the foundations of jquery, nodejs, ajax, etc.
literally fucking useless now
>>
>>51799131
But Jquery is javascript, senpai. In the end you're just learning js.
>>
>>51798943
I thought because I'm on mobile, but no, everything is very large with unnecessary margin on desktop too.

I see you're using bootstrap, maybe that's why? It's ugly in my opinion, but that's hardly your fault. Also, looking through your source, don't have all your js/css/html in one file, try to have a main.css and main.js file instead.

>>51799010
If he's really digging into http/tcp, he might even need more.

>>51799131
I don't understand, jQuery is a JavaScript library, and with a bit of gitgud, the only one you actually need.
>>
>>51798758
>>51799173
ah, I think I know why... it's probably related to bootstrap yeah- I'll fix this tomorrow, thanks
>>
File: e1.0.jpg (40 KB, 1020x680) Image search: [Google]
e1.0.jpg
40 KB, 1020x680
upboat my thread

>>51799202
>>
>>51799070
again, overkill considering his timeline.
>>
>>51799311
Yeah, he didn't say he wanted a job tomorrow. Assuming he does indeed study 12 hours a week for two years, he'd have to be retarded not to have shit together by then.
>>
>>51799343
>>51799311
In that amount of time he could basically master every back and front end code. Also, who the fuck ever loosely makes a commitment like that and actually sticks with it? He'll probably study ~2 hours a week instead of ~2 hours a day.
>>
>>51799385
not my blog but I'm a loser tired of living with mom. I'm very willing to spend a large chunk of my free gaining a valuable skill. watching anime and shitpostong on /a/ all day after all these years has finally lost it's appeal. so yeah I fully intend to give up all my hobbies for a few years if need be.
>>
>>51799440
And what I'm telling you is that a commitment that extreme is not need just for webdev. it's overkill. enjoy life for fucks sake
>>
>>51799483
Out of curiosity, how many hours in a week should one spend in this?
>>
>>51799483
>work less dammit!
what awful advice
>>
>>51799483
I bet you're the 'free spirit' type who's actually content with mediocrity. Web development is one of the things you can teach yourself. I he applies himself then he could very well master every single aspect of it. And judging by his follow up post, he won't be missing much when he commits his time to learning something new that could greatly improve his life in the years to come.
>>
>>51799543
Maybe 5, another a day Monday-Friday.
>>
File: 1435442747868.gif (2 MB, 709x625) Image search: [Google]
1435442747868.gif
2 MB, 709x625
Do employers care about the actual use of a github site? As in, could I make a site about some bicycle company that doesn't exist, or would this be considered pointless to an employer?
>>
>>51795154
Ah, I see. I withdraw the claim of no HTTP/1.1 then. The others still stand.

I'm not comparing yours to networking libraries, but actual web servers. If you never intended your library to not be behind a reverse proxy, then I appologise.

I can see your point, but that can be quite limiting, if you need persistent connections.

SPDY is already being replaced by HTTP/2.0, which is also HTTPS by default. Once again, if your library is supposed to sit behind a reverse proxy, then you can omit these, I guess.
>>
>>51800942
>SPDY is already being replaced by HTTP/2.0, which is also HTTPS by default.
No, its not
https://http2.github.io/faq/#does-http2-require-encryption

Most web frameworks are meant to sit behind a proxy, why would you ever assume FAP would be any different?
>>
>>51794902

Bit of a late response, but pretty damn comfy with C#, and willing to get to know the horrendous language that is JS for just how flexible Node is.
>>
>>51801136
Ah, I see.
>currently no browser supports HTTP/2 unencrypted
This is still a huge point though.

Node and Go can act as front-facing web servers, so it would not be surprising for other modern libraries to be designed for this purpose.
>>
>>51801166
I've thought about it, to be honest I'm not confident enough to recommend or start working so I can recommend FAP to be a front facing server, it's a security thing as much as anything. I'm just one guy and I've committed some pretty awful errors just to meet my own personal deadlines.

Also, a lot can go wrong with web servers and if someone loses data or gets their data stolen the "no warranty" all gpl code has will wear pretty thin. Sitting behind nginx or apache gives me at least somewhat a sense of security.
>>
>>51800847
Are you asking if you should make some random site about something that doesn't even exist just to show off your skills? Personally, I wouldn't do that. Naturally, I assume they will think it's real.
>>
My website has a .css file for mobile, one for tablets and one for desktops. They get media queried based on the resolution. Is this a good or a bad practice?
>>
>>51802362

Having them all in one file makes it easier to maintain, especially when working with other devs on the same project. Besides, it gets activated by the media queries so really there's no need to have them separate. But ultimately it's up to the developer to decide since there are no real performance constraints from having them split into 3.
>>
>>51787541
the idiot using jquery in that screenshot is overqualifying his selectors
>>
Been thru ruby, python, node, perl, php and I am thinking of going to a more "serious" language, which one do you recommend for back-end dev? Don't mention C as I already wrote a restful API etc in it, I have mercy for my wrists.
>>
>>51802406
Alright then.
>>
>>51802502
Go
>>
>>51791503
just under £40k a year as a frontend developer.

protip: work for startups in other countries. its the only way you'll make good money.
>>
>>51802596
Can you give an example of that "other countries" anon
>>
Where are x.509 certificates meant to be stored?
>>
>>51802620
pooinlooistan
>>51802589
sounds good, what about Java, Scala etc? worth learning?
>>
>>51802696
>Java
Only worth it, if you are fine with hating your code monkey job to rake in money.
No opinion on Scala.
>>
>>51802729
Ah well you are right, I used to be all about the cash until I realized money isn't worth giving ones happiness away, Go and maybe some Haskell if I feel autistic
>>
File: Munitions_T-shirt_%28front%29.jpg (57 KB, 499x574) Image search: [Google]
Munitions_T-shirt_%28front%29.jpg
57 KB, 499x574
I wish I was American so I could wear this shirt and feel cool.

I'm sincerely considering implementing TLS. I've been thinking, if you want to use my software to set up a bittorrent tracker, I'd need to implement TLS, I guess you could already do that using a proxy? Maybe give me at least a year to either do it or not, if I did I'd also need to implement compression which would either be slow, or mean Zlib as a dependency. If I didn't, I'd feel bad, because I honestly care more about performance than security.

It's a lot of extra work, and would also mean going back to using streams, which I stopped using in the last version to save, like, 10 microseconds of GetStream.

https://letsencrypt.org/
So these people are running a free certificate authority service. Yep, free, so it's not like getting certificates is going to be hard in the future. Yes, it's already running, you can get your free certificate today.

That's a very persuasive argument for someone like me to implement TLS.
>>
>>51802690
in ur butt
>>
I have a Raspberry Pi 2 and three domains. The websites will pretty much have little to no traffic on a 16mb/s connection. Would the websites be slow on the Pi despite of the low traffic volume?
>>
>>51793774
Thanks anon
>>
>>51803748
Ignore my question. That was retarded of me to ask without highly detailed information and putting an unfair burden on the reader. Those things are often to conditional to tell.
>>
>android WebKit does not implement "no-cache" correctly
What the actual fuck?
>>
What are some good CSS boilerplate frameworks? Want something more minimalistic than bootstrap.
>>
I need some help with this:

<?php

?>
<!DOCTYPE html>
<html>
<head>
<link type= "text/css" rel= "stylesheet" href= "helloworld.css"/>
<title>Hello!</title>
<body>
<ul id= "menu">
<li><a href= "index.php?seccion=home">Inicio</a></li>
<li><a href= "index.php?seccion=contacto">Contacto</a></li>
<li><a href= "index.php?seccion=amigos">Amigos</a></li>
<li><a href= "index.php?seccion=hermanos">Hermanos</a></li>
<li><a href= "index.php?seccion=padres">Padres</a></li>
</ul>
<?php
include("home.html");
if (! isset($_GET["seccion"])) {
include('./home.html');
}
else {
$seccion = $_GET['seccion'];
switch($seccion):

case 'home':
include("./home.html");
break;

case 'contacto':
include("./contacto.html");
break;

case 'amigos':
include("./amigos.html");
break;

case 'hermanos':
include("./hermanos.html");
break;

case 'padres':
include("./padres.html");
break;

default:
include("./home.html");
endswitch;
}
?>
</body>
<html>


I'm trying to make a menu with a switch. I can't manage to make it work. Care to help?

[spoiler]I'm new to webdev, this is just an exercise a friend of mine told me to do.[/spoiler]
>>
>>51804923
You are including home.html before the checks.
>>
>>51804980
So I just need to drop the if/else and just use the switch?
>>
>>51805002
Este código siempre se ejecuta, antes de del if y el switch. Es decir, te muestra el home, y luego el resultado de las otras comprobaciones.
                    <?php
include("home.html");
>>
File: wdg.jpg (25 KB, 698x158) Image search: [Google]
wdg.jpg
25 KB, 698x158
>>51805015
I'm a retard. Well, I've corrected it but I still have the same problem. It's stuck at home.html and doesn't switches to the others. Check pic for info. Every HTML body just has the same word as the name of itself.
>>
>>51805061
Post the code on pastebin and I'll edit it.
>>
>>51805076
http://pastebin.com/saHfCHUG

Sorry if my indentation is a mess.
>>
>>51805061
Try including php files instead of HTML files, in order to discard a weird issue.
>>
>>51805131
Still having the same issue.
>>
>>51805086
I can't enter to pastebin.com

could it be that my ip range is blocked? it happens with the sire battlefront.com too and I'm pretty sure my ip range is blocked there.
>>
>>51805174
Well, the code works on my machine.
What are you using? Apache, Nginx? Which version of PHP do you have available?
Do you have an http cache like Varnish installed?
>>
>>51805274
I just installed the most recent XAMPP out there, version 5.6.15
>>
I have all the skills necessary to create any web application I want to but I have no idea what the fuck I should do, please give me inspiration.
>>
File: cgg.png (447 KB, 1024x610) Image search: [Google]
cgg.png
447 KB, 1024x610
>>51805318
remake pic related
>>
>>51805307
Well... var_dump() the $_GET parameter before the switch-case, and before the if block.
>>
>>51805363
Like this?

<?php
var_dump($_GET['seccion']);

if (! isset($_GET["seccion"])) {
include('./home.html');
}
else {

$seccion = $_GET['seccion'];

switch($seccion): ETC


does nothing
>>
>>51805405
Check if XAMPP screwed up and deleted
variables_order     "EGPCS"
from the Apache php.ini file.
>>
>>51805460
; variables_order
; Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"


It's there. I'll try reinstalling xampp. Seems like that's the problem.
>>
>>51805510
A semicolon starts a line comment on .ini files.
Try giving it a value and then restart the server.
>>
>>51805348
I guess I could.
For what purpose though.
>>
>>51805542

I've fixed it. I'm the biggest retard alive. I was editing the code in ./index.php and not in the actual one located at /sandbox/index.php I was visiting.

Kill me, please
>>
>>51805756
Why a use /sandbox folder in the first place? If you want to test stuff that could break your actual page, use version control to keep track of what you screwed up
>>
>>51805800
I just opened the wrong index.php. At the time it seemed like a great idea to have an specific folder to do practice stuff
>>
>>51804203
>mobile x doesn't implement y properly
I'm not even surprised anymore whenever I learn of a new mobile "feature".
>>
>>51804203
learn 2 google
http://stackoverflow.com/questions/3602887/why-doesnt-safari-honor-my-cache-control-directive
>>
Is there any way to see the information that meta tags get, like device width
>>
Is Firefox Dev ed any good?
>>
>>51791503
About to graduate college but I have an offer doing web stuff for a startup for 100k
>>
Is there any way to see the information that meta tags get, like device width?

I have css code like the following :

.background{ background: url('any random pic url ' ) } @media ( max-width : 500px; ) { .background { background-color: #blue;}

Basically when I check the background on a smartphone it shows the color blue. But when I check the background on a desktop with the window minimized under 500px width it does not show the background blue. I am confused...
>>
>>51806565

Are you having trouble understanding what media queries do?
>>
>>51806662
I think so, but I think they obtain information from the meta tags and adjust the webpage according to the css written in their curly brackets. That's all I know. Other than that I'm having that problem that I described in >>51806565.
>>
>>51806565
>>51806806

Remove the semicolon after 500px, it doesn't belong there. It'll work after you remove it.

By the way, think of @media queries as if statements.

@media (max-width: 500px)

^What this is saying is that if the browser window is less than or equal to 500px, then render the CSS as defined here.
>>
>>51806806
here is the code

http://pastebin.com/TZ1UwVmK
>>
>>51806868
that's the thing, I minimized my browser window to less than 500px. I even double checked on mydevice.io. It wont work.

However it does work on my smartphone.
>>
>>51806868
edit: I fixed the semicolon still wont work
>>
>>51806907

Did you refresh the page? I replicated the exact same problem with your code, then fixed it by removing the semicolon.
>>
>>51805717
Learning
>>
>>51806941
Yeah I have this auto refresh extension it refreshes the page every 5 seconds.

Did you try to use a random Wikipedia image instead of the url. At less than 500 pixels the color should have been #E6E6FA.
Anyways thanks for your help I'm going to move on.
>>
>>51807014

Add this to your media query, then try again.

background-image: none;


It should be fine now.
>>
>>51807153
hey yeah it works thanks for your help.

Anyways I also have this problem when I'm learning that if I find a small bug I wont continue until I've fixed it and i'll spend the entire day figuring out how. Any advice?
>>
>>51807251

No problem. I know that feeling btw, but that's why threads like these exist - there's always at least one person that can help you with your problem.
>>
Any of you fucks make money doing this on the side? How much do you charge?
>>
File: 74.jpg (33 KB, 597x509) Image search: [Google]
74.jpg
33 KB, 597x509
If I block directory listing (403 forbidden) but allow access to the files (if you know the full path) can one still map the whole directory somehow?
>>
>>51789588
Its like you have something to gain by his sites being hacked by Eastern European skiddies.
>>
>>51807251
Get up from your computer and go make a cup of coffee. Don't even try to think about the problem for a while. Read a magazine or something that will take your mind off the subject. Even better to go out for a small walk.
>>
>>51796240
C# is generally very nice to work with once you get familiar with it. With ASP.NET 5, things are getting even better, with native support for non-Windows systems.

Can't imagine any reason to use PHP in this day and age, unless it's for extending an existing legacy system that's written in PHP back when it was relevant.
>>
>>51807438
Your doing it wrong.

Use your skills to make websites that make money automagically.

Why work for one man's dollar when you can work for a 100 people's penny?
>>
>>51799131
You need to know Javascript to use jQuery for anything useful anyway. Also, jQuery is generally of limited usefullness in a proper webapp. Generally you should be using some sort of JS framework instead, such as Aurelia, Ember or Angular. Any app written using only jQuery will almost certainly become a horrible unmaintainable spaghetti very quickly.
>>
>>51799131
jQuery might be an abandoned technology in 8 years.
>>51808563
How much would it cost to host a blog based on a C# CMS and mono? How long
it would take?
>>
I've now used Golang + AngularJS to create a small web application.
Golang serves the file system (HTML+CSS+JS) and a JSON API (GET,POST,PUT,DELETE etc.), which Angular makes calls to. The API lacks authentication at the moment, but that is fixable.

Is this a viable architecture? Even for bigger applications?
What do sites like Twitter or Facebook do? I've only see those JSON+JS applications with simple chat applications like Discord or Slack.
>>
>>51808929
>jQuery might be an abandoned technology in 8 years.
Possibly. Even now it should only be used for those special cases where you need to do manual DOM manipulation that can't be done with databinding.
>>
What are the most popular template engines for express.js?
>>
>>51809889
Handlebars for js and jade for html
>>
Is JavaScript really the only way to send a DELETE request through a browser?
>>
>>51810432
How else would you do it?
>>
>>51810467
The same way you do post requests would be nice.
>>
>>51810491
Using a form?
But how would it make sense for a form to DELETE something on submit?
The concept of submitting something pretty much implies that it's passing data to the server, which DELETE doesn't really do.
>>
>>51810538
Pass a variable through a hidden form field to the action of the form. In the action you specify what happens when the request is sent and a variable is received.
>>
>>51810432
does
<form method="delete">
work?
>>
>>51810588
But then it wouldn't be a DELETE request, would it?
Just a GET or POST request with an action variable passed through it that gets handled by the server.

It would work, sure, but it wouldn't be a very correct way to do it, considering the HTTP standard defines DELETE for exactly that purpose.
>>
>>51810538
Then an alternate method, possibly a new one entirely. I just dislike the fact that some basic functionality is impossible with JavaScript, given the rise of JavaScript blocking addons.

I suppose I could just use a POST for the same thing, but then it kind of defeats the purpose.
>>
Any IDE that has basic code analysing and has a clear sFTP manager?

Is there any IDE that can handle a shared windows samba server?
>>
How does one actually search for entry level web dev jobs? I can't find anything that's not like hours away from me or super senior deluxe level jobs.
>>
>>51810640
If someone is using a Javascript blocker, they either know what they're doing and can figure out how to make what they use work, or they're just retarded. Nothing but the very most simple html markup pages are possible without using Javascript, and almost no site with any interactivity will be possible at all without it, unless you'd rather use Flash.
>>
It's amazing people willingly use languages that don't have exhaustive pattern matching or sum types. If your programming language doesn't support basic type theory, its garbage.
>>
>>51810787
>using incomprehensible academic garbage

Thanks, but you can deal with unusable theory wankery while I make real programs that are more cumbersome, less flexible, and crash more.
>>
>>51810636
If the better solution was blatantly obvious then surely you wouldn't be asking questions right now though.
>>
>>51794902
>calling your framework FAP.NET
Aren't you afraid Github will take it down for being offensive?
>>
>>51810866
The only obvious and correct solution is as far as I know to use Javascript in some form or another. Plain JS XMLHttpRequest (or jQuery's ajax function that uses it), or the newer fetch. (might require a polyfill depending on the browser)
>>
File: 1445368682312.jpg (45 KB, 496x622) Image search: [Google]
1445368682312.jpg
45 KB, 496x622
How long does it usually take for an SSL certificate to start working? I bought an SSL certificate for my website, activated it a few hours ago, received a verification email, and now, when I try to access my website with HTTPS, it errors, says that the website doesn't supply identity information, and the page is broken because "FireFox blocked the content". Will this get fixed with time as the DNS records update? Or am I fucked?
>>
>>51811625
SSL has nothing to do with DNS.

Did you remember to actually set up your webserver to use the certificate?
>>
>>51798503
>>51798758
hey people, please help me, are controls still huge?
http://www.nask.co/L/TT6r0x1W4N?a=1

if you still see them huge, please tell me, what OS are you using?
>>
>>51811712
Yes. I set the certificate up only a few hours ago, though. How long does it usually take to work?
I'm using GoDaddy and all the shit is automated, and it says that everything is in order. Yet when I try to access the website via https, it says that the identity couldn't be verified and that the connection isn't encrypted.
>>
>>51812253
ugh, forgot to remove "?a=1" ... remove it if you don't want the audio to be played automatically.

btw, the site does not need JS or flash. to be used, just disable JS if you don't trust it
>>
File: 1448381161628.jpg (252 KB, 1324x992) Image search: [Google]
1448381161628.jpg
252 KB, 1324x992
>be 2006
>fuck around with HTML & CSS
>make custom myspace layouts for classmates for extra bux on the side
>9 years later
>dude I made a custom layout owns his own gym
>asked if I still fucked around with computer stuff and if I wanted to make a website for his gym/personal training outfit
>whip up something in like 2 hours, use a mesh of some of the pics he has posted on facebook
>hands me $350 even though I told him I was only going to charge $20 and a case of beer
>tells all his fitness clients about me
>one of them is a rich older guy who owns two restaurants in town
>pays me $500 to make a website for his places
>tells his business pals about me
>three of them want me to make websites for their businesses/workplaces as well
>mfw I've made more money off this in the last 3 months than I've made in 6 and a half months at my minimum wage burger flipping ob

Is this awesome? y/n
>>
>>51812420
It is... I'm a NEET and I want to make websites. I tried helping the owner of a small business, only to be given ~$60 for a display that I sold + 10 hours of work, and no referers or nothing :(

People in my country are absolute shit...
>>
>>51812420
N

shut up and go to hell fatty
>>
>>51812494
Honestly I wasn't expecting any of this. I was just helping out an old friend and looking to make some extra gas money and get some beer out of it.

I never knew it'd turn into this.

>>51812502
Ouch
>>
File: 2015-12-11-17-24-47_scrot.png (316 KB, 1280x800) Image search: [Google]
2015-12-11-17-24-47_scrot.png
316 KB, 1280x800
/g/ I want to build a polymer interface for one of my arduino projects.

Basically how should I go about transmitting the sensor data to log and display on a web app? Also I must control the device as well.

here's some random google mod I just did.
>>
>>51812269
Anyone?
>>
>>51810432
a common workaround is to use a form where the method is POST and have a hidden input named "_method_ where the value is "delete"
>>
>>51811625
>>51812983
>>51812269
AFAIU, it should be immediate... use https://www.ssllabs.com/ssltest/ to check your site.
>>
>>51805962
No, he's trying to disable the cache altogether, I'm relying on no-cache to force revalidation, it's a very different use. I don't use no-store and after getting a 200, android treats the 304 as an error. I'd remove the no-cache altogether, but then Firefox won't even hit the backend for consecutive get requests, so you'd post and it won't show up for an hour.

Ideally, people should read the RFC before doing this shit. The brainchild behind no-cache implemented as no-store at WebKit had a very eastern European name, in fact I'm noticing a trend amongst people who clearly haven't read the RFC.

>>51810900
I don't work with SJW and they won't try because it's typical that SJW only care about popular things. In the end, they're just children who care about popularity and image. FAP won't become popular and it's not overtly offensive (x for retards, swear words, whatever), so I'm not worried.

Besides, the work to be done is real work: implementing tls, gzip and mitigating common vulnerabilities. I don't need a "code of conduct" when it's just me.
>>
>>51812420
Being a web dev is like being the main character in a mafia movie
>>
>>51812494
What country
>>
When is
'<span>'+this.meme+'</span>'
going to die?
>>
>>51810618
No, the only valid values for that attribute are get and post.

The only way to send a DELETE (or PUT for that matter) without Javascript is by manually changing/creating the HTTP request.
>>
>>51813498
In HTML6 when they introduce inline wrapping tags
>>
>>51799814
Or maybe he's phenomenally good at it.
>>
>>51813218
This deprived cunt here.

Update: I looked through the WebKit source, no, they're definitely caching correctly and definitely treating "no-cache" correctly. The problem is in android chrome and android chrome alone.

Guys, if you ever do more than design websites or maybe write a backend, as in if you ever implement anything that's standardised: always, always read the fucking standard/rfc/ietf documentation. There is no excuses.
>>
Total layman here. Are PHP/JS still the go-to's when it comes to web development or is the potential for other languages growing more and more?
>>
>>51813498
it's already dead m8
`<span>${this.meme}</span>`
>>
File: 1439757356088.jpg (25 KB, 403x403) Image search: [Google]
1439757356088.jpg
25 KB, 403x403
How long would it take to learn how to make Drupal and WordPress themes if one already has a good HTML, CSS, PHP and JavaScript experience?
>>
>>51814438
this.meme = '<img src=x onerror=alert(0)>';
x = document.createElement('span');
x.innerHTML = `<span>${this.meme}</span>`;
>>
Anybody else ever have a problem with firefox not stopping the page at the end of the content?
firefox will just let this page scroll infinitely into white space
>>
>>51815111
*only when parallax scrolling in on
>>
>>51803022
what is the joke
>>
Is it possible to trigger an onclick event when unfocusing an inputbox? Want to trigger a js function whenever the user tabs/unfocuses away from an input box. I basically have a big list of values where it would be nice to submit changes without having to click a dedicated submit button everytime one makes changes.
>>
>>51815613
>Is it possible to trigger an onclick event when unfocusing an inputbox?
why would you want to do that? just pass the same function to onclick and unfocus
>>
Im new to webdev and learning Ruby on Rails and cannot figure out where to write code that would be considered complex. Like a recommender system or a trending news algorithm. Every tutorial I look at pretty much says to keep your controllers small and your models fat but I dont see how you would put it in a model.
>>
>>51814518
this works? too lazy to try...
>>
File: Screenshot 2015-12-11 23.26.27.png (145 KB, 3120x1920) Image search: [Google]
Screenshot 2015-12-11 23.26.27.png
145 KB, 3120x1920
I made a simple webpage with a couple of divs and a background image, and one media query. Unfortunately the media query only works on Explorer Edge, Opera and Firefox.
Can somebody help me? I have attached a screenshot, plus a pastebin link.

http://pastebin.com/YgJv5MMA
>>
>>51816413
Additionally, it works on chrome too if i add the css to the html file.
>>
Im making my personal website. First time using JS aswell. only tested on chrome/firefox/safari so far. criticisms appreciated.

http://michaelvandiest.github.io/
>>
File: 1440124493317.jpg (46 KB, 410x620) Image search: [Google]
1440124493317.jpg
46 KB, 410x620
>>51816413
I like your font.
>>
>>51816497
Thanks. Im going to create my own custom font to work with, when i get the time.
>>
>>51816488
Thats nice. But the drop down menu reminds me of tetris. I dont like your menu anon. You got a problem?
>>
>>51816548
yeA i got a problem friend. What would you recommened?
>>
>>51816572
I'll tell you what i recommend, if you help me with my problem >>51816413.
>>
>>51816413
>windows
>notepad++
>that ugly code, inconsistent spacing, shitty indenting
>that font
>forcing the google botnet upon visitors
>html5 doctype but not a single html5 tag
wat are u doing lAD
>>
>>51815156
No joke, it's just cool to wear something that's under law illegal. It's like "look how stupid luddite laws are, this shirt is illegal but only if a foreigner sees it".

>>51814116
Okay, this guy here again.

Turns out that the best dynamic caching is done with an expires header set to a date equal to or less than the current date, but not max cache age set to 0, because ie implements it identically to nocache and won't store it.

The issue then wasn't that mobiles weren't caching right, but that nginx doesn't pass etags when you also use gzip. Desktop still caches correctly, but for some reason they dont need etags for 200 responses. The solution is to disable gzip from the location, or to install a version of nginx as new or newer than 1.7.

Been trying to update nginx on debian for a while without success. I get a broken pipe trying to source straight from the nginx website and backports won't give me newer than 1.6. My Vps provider wants to charge me more for jessie, so I'm stuck in wheezy.
>>
>>51816284
It alerts 0.
>>
>>51812269

You are doing something wrong. SSL doesn't "take time to work". It's like saying "I just installed Wordpress. How long does it take to work?"
>>
>Frontend code pretty much amounts to

if(form field is empty) {
alert("PLEEASE FILL IN THE FORM BEFORE HITTING SUBMIT")
}


> Asked why there's no unit test
>>
>>51810697
>hours away
Why is that a problem? The main reason for unemployment is that people aren't willing to relocate to where the jobs are. If you don't have junior web dev position available in your area but have them somewhere the obvious action is to relocate to where the jobs are.
>>
>>51817412
People who ask for unit testing either don't trust your commitment or absolutely depraved cretins.
>>
>>51812269
Possibility: your CA fucked you over and charged you for something akin to a selfsigned signature.
>>
>make a website for 2+ months
>can't even find users for it on 4chan because barely anyone cares
I feel useless :(
>>
>>51816497
>>51816413
>Not using a monospace font whenever dealing with code
>>
>>51817019
Forgive me, I've only read a couple of pages from an html and css book, and I only started messing around with what I learned very recently.

Please help anon :(
>>
Anyone here use Plesk 12? If I'm making a few sites completely managed by myself, can I get by with just the Web Admin edition for $4/month?
>>
>>51806968
I can do all that.
What I want to do is apply my skills outside of my 9 to 5 job.
>>
File: thoughts.jpg (83 KB, 1176x747) Image search: [Google]
thoughts.jpg
83 KB, 1176x747
Thoughts on using pic related for a new website?
>>
>>51817555
> paying for a cert
> not just using StartCom for personal sites
>>
>>51818790
>StartCom is a company based in Eilat, Israel
Nice try
>>
>>51814518
It won't work. And XSS is something the programmer should be aware of.
>>51816246
Look for examples on github.
>>
>>51811625
You didn't install the intermediate certificate. Easy.
>>
So PHP 7 says it's faster 2 times
What's node.js speed compared to that?
I guess RIP fully-JS websites
>>
>>51820267
lol i think you dont realise exactly how slow php is
>>
>>51820303
Not pretty well, my first language learned was php, but php itself writing is cancer, laravel maybe makes it nicer, but I still somewhy can't work with php. JS seems very difficult and stuff
Could I read about speeds? Trusted one, because there are loads of showing different chart results
>>
>>51820330
>my first language learned was php, but php itself writing is cancer
>laravel maybe makes it nicer, but I still somewhy can't work with php
>JS seems very difficult and stuff
You're in no position to say which programming languages are cancer.
>>
>>51820387
Not pretty well, my first language learned was php, but php itself writing is beautiful, laravel maybe makes more lovely, and I'm married PHP for all my life. JS seems very easy and nice
Could I read about speeds? Trusted source, because there are loads of showing different chart results.
Thread replies: 255
Thread images: 20

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.