[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 - Pajeet Edition
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: 38
File: wdg_pe.png (1 MB, 1119x804) Image search: [Google]
wdg_pe.png
1 MB, 1119x804
/wdg/ - Web Development General PE

Preferred topic: PHP, Wordpress, Drupal, CSS, HTML

Previous Thread: >>54462474

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

> Discord
https://discord.gg/0qLTzz5potDFXfdT

>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/
https://www.freecodecamp.com/
http://www.w3schools.com/
https://developer.mozilla.org/
http://www.codewars.com/
https://youtu.be/JxAXlJEmNMg?list=PL7664379246A246CB [Embed] - "Crockford on JavaScript" lecture series.

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

>Backend development
https://en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks
https://gist.github.com/dypsilon/5819528/

>Useful tools
https://pastebin.com/q5nB1Npt/
https://libraries.io/ - Discover new open source libraries, modules and frameworks and keep track of ones you depend upon.
https://developer.mozilla.org/en-US/docs/Web - Guides for HTML, CSS, JS, Web APIs & more.
http://www.programmableweb.com/ - List of public APIs

>NEET guide to web dev employment
https://pastebin.com/4YeJAUbT/

>How to get started
https://youtu.be/pB0WvcxTbCA [Embed] - "WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice"
https://youtu.be/zf_cb_Nw5zY [Embed] - "JavaScript is Easy" - If you can't into programming, you probably won't find a simpler introduction to JavaScript than this.

>cheap vps hosting in most western locations
https://lowendbox.com
https://www.digitalocean.com/
https://www.linode.com/
https://www.heroku.com/
https://www.leaseweb.com
>>
First for non-pajeet
>>
Second for php a shit
>>
Any of you guys thinking of moving to a poor country to live comfortably as a freelance web dev ?
>>
>>54493941
(In other words, isn't it better to be a lion in Thailand than a lamb in America?)
>>
>>54493941
That implies that freelance doesn't earn enough to live comfortably in a rich country.
>>
>>54493941
Why would you do that? Just live somewhere in the states that isn't fuck all expensive. Work remotely.
>>
>>54493941
Nope, but maybe because I'm already in one.
>>
>>54493970
I do this except I live in Germany.
>>
>>54494009
Yurop?
>>
>>54494070
South Ameritrash
>>
>>54494083
Hello my white friend (arg fag here)
>>
File: 1.jpg (56 KB, 400x400) Image search: [Google]
1.jpg
56 KB, 400x400
>>54494148
We need to hide our white Ki
>>
just before i hide this shit thread as always do, hear me out.

i would be retarded to move to a shithole fantasizing with imaginary money you havent earned.

either way. why would you want to live in hell.. many millions of us dream of leaving this shithole
>>
File: Trust Me I'm White.png (67 KB, 268x367) Image search: [Google]
Trust  Me I'm White.png
67 KB, 268x367
>>54494217
>>54494270
>>
Can you somehow reuse node modules across systems?
I have an SSD that's strictly related to my programming projects, one of them is written in JavaScript using NodeJS. The problem is that if I do npm install electron-prebuilt --save on Windows, and run the program on Linux it will attempt to run the Windows executable and vice versa. The only "solution" for now is to remove node_modules directory and re-run npm install everytime I switch systems but that's not feasible.
>>
>>54494416
create virtual machine and do your development inside.
I mean, thats the whole deal with vagrant isn't it.

also, I must warn you. this is pajeet thread. We do not prefer discussing about node and javascript. jquery is an exception.
>>
>>54494628
Meh, that sucks, I guess I could do it another way, install the package globally on each system and remove it from dependencies them have the start script invoke the global command rather than the relative module.
>>
So I'm nearing the end of udacity's front-end program and it was okay but a little short on practice materials.

Does anyone know of a big collection of well chosen exercises to work on? Ones with a point to them, rather than suggestions to build random things until you've bumped into all the common problems, if you know what I mean.
>>
>>54494658
i was thinking about that too, I have so many node modules directories with the same stuff inside, and it just takes huge amounts of space for no fucking reason.
maybe I'll just create a symbolic link and keep the stuff in one pleace
>>
File: hurr.gif (185 KB, 291x200) Image search: [Google]
hurr.gif
185 KB, 291x200
I am going to be tested for a intern position as a backend PHP developer. What kind of questions should I expect? Should I prepare anything in specific (except Fizz Buzz)?
>>
4 years later and I still have nothing to show for myself.
>>
Might just make some meme image uploading website with twitter authentication or something...

Literally 0 ideas.
>>
What's the proper way for making a bilingual website? Make duplicate php files with translated content?
>>
>>54496078

No.

Separate business logic from content.

Business logic should be in php files. Content should be in an HTML snippet file, or YAML file or XML file or something. So then you can plug that copy straight into a page template.

I mean it depends on what framework you're using (I sincerely hope you're using a framework and not procedural PHP)
>>
>>54496115
>save translation in associative arrays for source code/templates
>save translations of dynamic content in db
>>
>>54496158

Please don't do this

>>54496078

Learn to use gettext for proper internationalization

http://php.net/manual/en/function.gettext.php
https://poedit.net
>>
I have a simple html form and PHP code that allows me to upload a file.
With desktop Chrome and Firefox, it works perfectly. But with a mobile browser, it doesn't work. The file appears to upload, but its size is 0 bytes. Sometimes this 0-byte file will be created, sometimes no file is created. There are no errors in my error.log.
Is this a known problem for forms with file input? Is there something special I need to get my utility working on mobile?
>>
>>54496115
I was planning on using straight up PHP. I never used a PHP framework before, but maybe I should go ahead and finally learn to now. The only one I know of it laravel. Which framework is popular and used in actual jobs?

Also, I was planning on using straight up PHP because I thought I would learn a lot from it. But I might learn even more if I started using a framework. So I dunno.
>>
File: 1462893261607.jpg (62 KB, 640x762) Image search: [Google]
1462893261607.jpg
62 KB, 640x762
>>54496412
Not him but bump
>>
File: record.webm (951 KB, 1600x900) Image search: [Google]
record.webm
951 KB, 1600x900
WHO /AESTHETIC/ HERE?
>>
>>54496078
look for an i18n (internationalisation) library
>>
>>54496473
holy shit i just came
>>
>>54496473
cursor: default
please
>>
>>54496412

Well you should have some level of knowledge of PHP and OOP principles before using a framework, otherwise you're going to be completely lost.

Provided you have this, I'd recommend using a framework as it helps enforce good design principles in your application
>>
>>54496791
It depends entirely on the company. Some companies want you to have a BS CS, some just want a BS/BA even if it's in sjw studies, some don't care at all as long as you demonstrate your competence in other ways. In general, companies that are large enough to have all hiring go through an HR dept are more likely to require a degree, but it's by no means set in stone. Besides, there's nothing inherently wrong with working at a small company or startup as long as you like the job and are getting paid a fair wage. (And if it isn't, it's on you for agreeing to work there.)

It only really matters for your first job anyway. After that, they care a lot more about your experience / work history than your education. On the other hand, a degree will definitely help you to make a bit more. If you're going to get one, BS CS is definitely the way to go as far as formal education. There are also lesser degrees and bootcamps to consider. In general, AS degrees are hit or miss. If it's a good program you might learn the same info a bit faster. Some people need to have structure and deadlines to learn so that may be helpful. You probably won't see any significant pay increase from it over nothing, and it do much to get your foot in the door. 99% of bootcamps are pure garbage money mills that will charge you $10k-$20k to learn bootstrap and basic html. It's not uncommon for a bootcamp to actually negatively affect your resume`. There are a few that are actually good schools, though. If you consider that, do thorough research before you throw your money away.
>>
>>54496791
>>54497064

Nigger, did you delete your post after I wrote all that helpful shit out? Go fuck yourself, you cunt.
>>
Will Google ever open source their Chart library?

So sad that an AJAX call is required to be able to use it. Not to mention they'll probably bring down their API in a few years
>>
>>54497152
>Not to mention they'll probably bring down their API in a few years
That'd be unlikely considering how hard they push their support for development
>>
If I suck at knockoutjs, would learning react not benefit me in anyway? I just can't seem to structure a SPA with just knockout.
>>
>>54497221
knockout is perfect for SPAs considering it's so lightweight. My company moved from angular to knockout because we only needed 2-way data binding and angular is like the Java of web languages: verbose as fuck. React is not as bad, but knockout would be a better investment if you really care about SPAs
>>
>>54497189
Google is notorious for killing APIs
>>
>>54497303
Closing all the react tabs right now. So how do you structure a SPA with knockout? Right now I have everything dumped in a big viewmodel, all in one javascript file.. I'm new to front-end webdev so pls no bully.
>>
File: attack.png (4 KB, 772x111) Image search: [Google]
attack.png
4 KB, 772x111
I'm making a website for my uni and I'm testing SQL injections.

When searching this:

[email protected]; drop table droppable --

I am getting this error and my IP is blocked from the server. The owner of the server says he does not know why this is happening, maybe someone else set it up.

Do you know what exactly, as in, what programs, react to SQL injections in this way?
>>
>>54497880
this is why you don't cut and paste code, kids
>>
>>54497905

What do you mean? I escape the strings in every possible way and pass user input as parameters without interpolating it into the query.

How is this related to my code when it's obviously part of the server's configuration?
>>
File: 3.jpg (23 KB, 384x566) Image search: [Google]
3.jpg
23 KB, 384x566
I've got a viewing problem.
I have to show a chart on the same page where I have my submit button.
When I open my page there is a broken image link and when I click submit it shows the chart on a new page, when I click back the chart appears on the page. This is the code :
View :
  <p class="backgroundHeader">Title</p>

@using (Html.BeginForm("DrawPieChart", "WebTraffic", FormMethod.Post))
{
@:Insert text : @Html.TextBoxFor(m => m.username)


<input id="klikanje" type="submit" value="Submit" />
}
<p id="demo"></p>
<script> document.getElementById("demo").innerHTML = '<img src="@Url.Action("DrawPieChart", "WebTraffic")" />'
</script>


Controller :
[HttpPost]
public ActionResult DrawPieChart(AnalzyerData user)
{
AnalzyerData analyzerData = new AnalzyerData();
return PartialView(analyzerData.getChart(user.username));
}
>>
I wish India didn't exist.
>>
>>54497880

The server has a web application firewall running on it, or running on a separate appliance "in front" of the server. As for the specific program, no clue
>>
>>54498428
way anon?? india bery bery gud
>>
>>54498428
its not just pajeets friend, every male who fails at life goes into programming (mostly web dev which is easiest)
>>
File: squidward.jpg (113 KB, 1152x864) Image search: [Google]
squidward.jpg
113 KB, 1152x864
>>54498484

>programming is easy

It might be easy for you and me, but not for everyone.

If only you knew how incompetent even the final years are at my uni.
>>
>>54497064
I found your post useful, actually.

I'm kinda in the same situation as the other anon, except that I had a degree in some social science bullshit (political science), I worked a few years in some public institutions and then decided I don't want to work as a clerk anymore, I wanted to work on products.

So, after my last contract ended and I couldn't get another one, I took a C++ course, but then I realised it would take me a few years before I could even have any chance to be employable with C++. So I started learning webdev. Now I already know front-end quite well, I'd say, I can build a decent landing page in a day or a few days, depending on how complex it is, using the latest designs and UI practices.

Currently I'm just getting started with backend, so hopefully once I get enough experience with PHP I'll have more chances to get a job. I am close to finishing a front-end only portfolio site, but I'm already having doubts if I should just show some static landing pages on it or maybe I should wait until I learn more PHP so I can re-factor those static pages into actual websites with a backend too.
>>
Node 4 or 6?
>>
>>54498840
How long did it take you to learn the basic front end stuff? Ive learned everythign else pretty quick but javascript just makes me so unmotivated.
>>
>>54498912
For me CSS makes me pull my hair out. It's so fucking stupid and counter-intuitive.
>>
>>54498952
How so?

Anyway use SCSS
>>
>>54499009
Positioning elements mostly. CSS was made to style text, not to position elements inside a application.
>>
>>54499035
>CSS was made to style text, not to position elements inside a application.
[citation needed]
>>
>>54498877
6, unless you want to use some obscure package that isn't compatible.
>>
any of you using adsense? how much money/traffic you make?
>>
So how do you guys get logos? I'm doing a website for my spouse (in my free time, hobby thing) who's into games journalism and his ideal logo is a drawing from a game. It doesn't really have a small "logo-ish" look.

Do you guys just get artfags to do this for you?
>>
>>54499383
My clients already have logos
Logo design goes into Corporate Image, not web dev
So yeah I get my graphics designer friends to do it
>>
>>54499383
>>54499474
But since this is your friends' shitty blog, you can slap up a logo using the website names' initials
>>
>>54498912
I'd say more than half a year. It was very gradual. At first, I didn't understand why would learning Bootstrap be useful, but now I use it on almost every site I build. But I use customised versions, I basically take out everything I don't use, and just keep the basic minimum, which is mostly the grid. I don't want to load tens of thousands of lines of code which are completely useless. I only load what I use.

Javascript is not a language you can learn thoroughly in a few months or even one year. Just like any programming language, it takes years to become experienced in. It's just very easy to get started with.

But if you, for example, start learning about array prototypes or built-in array methods, you see that it's not something you learn in a day. It takes time to learn all that information and to use it in practical projects. And it also takes time for that knowledge to become sedimented, so that you don't forget it.

I once decided to learn the whole canvas API and managed to do so, while also practising canvas stuff everyday. I have to say now I don't remember everything, it's all a blur. I have an idea of how to get started, but if I haven't used all the information everyday, eventually my canvas API knowledge got rusty.

Now take this example and multiply it for every possible built-in function in JS and its APIs. I hardly believe it when someone comes up and says they learned JS in a few months or a year. It depends on what they mean by that. I take it that they learned only the core stuff, not the APIs too.
>>
>>54499786
out of all of the code what functions do you go back to the most? I'm not that guy but I am new to bootstrap and jquery.
>>
I'm running this code in a GreaseMonkey script on the catalog page. Can someone explain the output?

var teaser = document.getElementsByClassName("teaser");

console.log(teaser); // [object HTMLCollection] length:150
console.log(teaser[0]); // undefined
console.log(teaser.length); // 0
>>
I just installed a yeoman scaffold and I see the most random shit like import statements and classes. Should I just Pajeet this shit and keep going or should I learn what the fuck this all means first?
>>
>>54500169
Obviously the second one if you ever want to get better. You should never use code you don't understand at least pretty well, or you're going to have no idea where to even look if something isn't working right.
>>
>>54500151
Started firefox just to try this, I get the same thing when I open a new tab of the catalog but after F5ing the first one prints an empty HTMLCollection.

Probably something to do with timings since the catalog is generated by javascript, it probably runs the first console.log, then 4chan's scripts mess around with the catalog threads (sorting maybe? no idea) and removes the originals.

Wrap that whole code around a setTimeout with a delay of 1 and it works properly.
>>
>>54500352
> the catalog is generated by javascript
I completely forgot about that.

>Wrap that whole code around a setTimeout with a delay of 1 and it works properly.
Thanks, man.
>>
>>54500123
Well, you always need to know core JS very well. But when you're going to work on specific projects, you're also going to use very specific APIs, depending on the project. So there's no single answer here.

Some projects may require you to know web workers or video cameras API. Just two random examples.

For another project you might need to know how to use regex very well or to write some sort of URL scrambling algorithm. Nobody says you're always going to do the same thing. Although some people do report that they are basically code monkeys working on Wordpress and Prestashop sites doing the same thing everyday. So it may be different, depending on the job too.
>>
>>54493941
yes, I will get out of the US or end up killing people here
>>
>>54500352
that looks like a hack desu and it introduces a race condition into your code
>>
How do I add a font like this in html and css? Is there a similar font like this in Google Fonts?

http://www.1001fonts.com/press-start-font.html#styles
>>
>>54500796
.classname {
font-family: 'YourFontName';
}
>>
>>54500796
use @font-face to add it like google fonts does

@font-face {
font-family: "Press Start";
src: url("prstart.ttf") format("truetype");
}

body {
font-family: "Press Start";
}
>>
>>54500555
Alright so basically learn it through like any other language, thats fair enough
>>
What book would guys recommend to learn node.js. Should I learn javascript beforehand?
>>
i am here wondering if anyone knows of good c# to php transpiler. you see i learn c# to know programming for windows but i have not yet learned programming for websites. with c# to php transpiler i could use my windows program to write website program and increase my employment ability
>>
How necessary is a CS degree for this?

Have a b.s. in bio and a MS in medical sciences but I'm too dumb for medical school because chem classes fucked my shit up.

Can I make good money freelancing on the side? Total noon, just learning basic html and css right now but this seems like a good thing to do on the side to generate revenue of I don't get into pt or pa school.
>>
>>54502014
>How necessary is a CS degree for this?
Not. I don't have one, neither do any of my coworkers

>Can I make good money freelancing on the side?
No, not on the side. Freelancing is a full time deal where you have to build up your own brand and network. I don't recommend it, particularly to a beginner. I also advise to stay away from projects with friends if it involves money. Do it for free and without expectations or don't do it at all.

>a good thing to do on the side to generate revenue
It pays very well, yes
>>
>>54498374
your type="submit" on your input button is causing a page refresh

idk wtf I'm looking at otherwise. I don't use vanilla JavaScript
>>
>>54497880
I know .net can detect injection
>>
>>54497221
My experience is in direct contradiction to this post >>54497303
My company is transitioning away from knockout and to angular. Reason being that it's hard to find knockout programmers (nobody uses it), you have to keep track of 2 models (one on the server, one in the knockout code), slower JSON parsing engine (we're rewriting our current program so I compare them side-by-side and there's no comparison), less support and platform staying power (angular is backed by google), and significantly fewer plugins made for knockout than angular.

Codeschool.com has a free course (that I personally used to learn) on angular. I ran through the course 4-5 times (once every day for a week), and I was ready to start making my own site slowly but surely
>>
>>54500151
getElementsByClassName returns a collection that changes when the page changes.

document.querySelectorAll(".teaser")

would give you consistent results.
>>
>>54496404
lol I've actually done this before. y u no MVC? Have the javascript handle it. Otherwise, yes there are differences in how they're delt with
>>
In asp.net how would I use the repeater element to loop through an object and grab a "thumbnailUrl" string property and display them? Hope I'm making sense.
>>
>>54502736
this help? http://stackoverflow.com/questions/14712008/cant-display-images-by-looping-through-folder
>>
>>54502459
>>>/reddit/
>>
>just turned in a http/CSS assignment
>it'll probably get a C for being monochromatic, despite that being the theme I was going for

I'm not even CS, I'm a journalist for fucks sake.
>>
>>54502858
>http
You mean HTML? Also you should be graded for what it does not what it looks like

>>54502835
sorry Pajeet, didn't mean to be condescending
>>
>>54502902
>you mean HTML?
yeah, we'll say that's 1/2 my auto correct, 1/2 my dumb ass not paying attention
>>
>>54502858
Lets have a look then lad.
>>
>>54503684
It's saved to my desktop.
It was pretty much just "make a web page ad for a book or product"
>>
Based Texas with the infinite flow of shitty websites that need replacing.
>>
>>54493941
not that poor, but cheap living - I am moving to Prague to freelance remotely for clients in my home country for a few months. will save a lot more than I can living here.
>>
File: 1365159137764.jpg (8 KB, 247x204) Image search: [Google]
1365159137764.jpg
8 KB, 247x204
I wish to be fucked in the ass right now.

This is a django database lookup that checks the database before you create an entry between two times. Like if you have an entry for 22:00 to 05:00 then it shouldn't allow anything entry between that.

Timing.objects.filter(
(Q(from_time__gt=F('to_time')) &
(Q(from_time__lte=from_time) | Q(to_time__gte=from_time) |
Q(from_time__lte=to_time) | Q(to_time__gte=to_time))
) |
(Q(from_time__lt=F('to_time')) & Q(to_time__gte=from_time) &
Q(to_time__lte=to_time)))


Try to understand that. I dare you.
>>
File: Thank-You.jpg (19 KB, 448x328) Image search: [Google]
Thank-You.jpg
19 KB, 448x328
>>54500990
>>
>>54504668
ew. ew.
>>
Who's going to come live with me in Texas and make websites?
>>
>>54504737
Me. Can I get a piece of your boipussy from time to time?
>>
>>54504668
m8 your logic is shit
>>
>tfw design is boring and frustrating and you just want to write code
>>
>>54501983
Holy shit pajeet ASP.NET exists
>>
>>54505398
Bootstrap
>>
>>54505511
yeah but still. i want to have something that doesn't look cookie-cutter.
>>
>>54505543
Spruce it up later
>>
>>54505498
>not knowing PHP is the only server language
>>
File: pajeetcode.jpg (274 KB, 755x1341) Image search: [Google]
pajeetcode.jpg
274 KB, 755x1341
>>54492344
Pajeet masterrace
>>
>>54498374
You are misundertanding something heavily. First you are putting DrawPieChart return value into img src and then you are submitting form into into. What is bullshit unless your DrawPieChart can somehow magically return both image contents and html. Also why are you even using Javascript?
>>
>>54505814
Its like poop given human form and life.
>>
>>54505814
now you ruined the chart. Now I dont know which are the best languages anymore, the ones at the bottom or the ones at the top?
>>
File: file1 (04).webm (3 MB, 1280x720) Image search: [Google]
file1 (04).webm
3 MB, 1280x720
what do now?
>>
>>54506719
make another one

no serifs in this one either
>>
>>54506719
>.php
why?
>>
>>54506719
why are you putting design over functionality?

there is no fucking way I would be motivated to read any of the text as a visitor. this site looks just boring
>>
>>54507040
can you elaborate more?
>>54506814
to get the year at the end. and maybe some other stuff.
>>54506787
That sounds boring.
>>
>>54507130
>too much text
>font too small
>contrast too low

maybe ask on gd for more opinions, I'm not really a graphi designer
>>
>>54496473
FOR THE LOVE OF GOD
cursor: default
>>
>>54507158
yeah i think ill ask there and see if I can get some help.
>>
How do I put php variables into sql?
$id = 001;
$name = "tester";
$phone = 555999;


$sql = 'INSERT INTO table '.
'(id, name, phone) '.
'VALUES ( '$id', '$name', '$phone' )';


Doesn't seem to work
>>
>>54507566
use ORM. the way you do it is just retrded.
>>
>>54507623
why?
>>
>>54507680
because its more clean and less typing. also, makes sure you dont do anything stupid and you can switch the DB relatively easy.

imagine if you write your app like this and want to switch to postgre or some other db. you would be pretty fucked.
>>
>>54495247
>backend PHP

well you could start by burning that fucking company to the ground
>>
>>54507697
But I want to know whats wrong with my code.
>>
>>54507968
I dont know, I dont write SQL myself and dont know the conventions or ways to protect agaisnt sql injection
>>
>>54507986
it is VALUE not VALUES
>>
Just wrote a blackjack card counting function in JS

I feel like a Javascript Ninja already.
>>
>>54507566
$id = 001;
$name = "tester";
$phone = 555999;


$sql = 'INSERT INTO table '.
'(id, name, phone) '.
'VALUES ( '.$this->id.', '.$this->name.', '.$this->phone.' )';


Don't do that btw, you'll get injected.
>>
>>54502316
>>54505865
I'm using Javascript because at the moment that is the easiest way for me. What would you recommend ? I'm open for suggestions.
My DrawPieChart only returns an image even though it is a separate view generated from my database.
>>
>>54502316
>your type="submit" on your input button is causing a page refresh

not him, but what shuld be used for submiting ?
>>
>>54508456
Doesn't seem to work..
>>
>>54508674
Submit is fine, just catch the event as it bubbles and preventDefault().
>>
>>54508780
you still havent figured it out? how the fuck you gonna compete against fast learning pajeets?

maybe you should study something else, no offense.
>>
File: 1450150353589.jpg (33 KB, 600x476) Image search: [Google]
1450150353589.jpg
33 KB, 600x476
>>54508813
thanks anon.
i didnt know you cant put variable in single quote statement.
>>
>>54508853
you still need to escape them or someone could enter a name with quotes in it to break it or run their own queries on the database
it's called sql injection
>>
>>54508890
sql injection is only possible through string input right?
>>
>>54509098
$name = "tester', '555999'); DROP TABLE table; --";
>>
>>54509098
>>54509262

Just use PDO, anon

$id = 001;
$name = "tester";
$phone = 555999;

$pdo= new PDO;

function insertToTable($pdo, $id, $name, $phone)
{
$stmt = $pdo-> prepare("INSERT INTO table (id, name, phone) VALUES (:id, :name, :phone)");
$stmt -> execute(array(
'id' => $id,
'name => $name,
'phone' => $phone
));
return $stmt -> fetchAll(PDO::FETCH_ASSOC);
}

$result = insertToTable($pdo, $id, $name, $phone);

>>
>>54509459
Oops, missed a ' after 'name but you get the idea
>>
>>54508532
Some things to think about. Whats the point of inserting html with javascript. What does that draw method returns. And why are you using that draw method in two different contexts.
>>
How can you bullshit your way into getting a freelance job? I have no tangible evidence to show it know what I'm doing, but have messed around with Web development for the last year. I'm confident I can deliver a project when needed, but on my own or for practice in get bored and lose interest.

Tl;dr

How to bullshit for a job with no sample projects?
>>
>>54509742
You have to show your projects.
That's the only way unless you have some friends or relatives that can hook you with a job.
>>
>>54509742

>How to bullshit for a job with no sample projects?

You don't. Make some sample projects, dumbass. No one is going to hire you without any evidence that you have any idea what you're doing. Just come up with a couple fake businesses and make websites for them. Get a shared hosting plan from namecheap or something and host them as subdomains of your portfolio site. As a bonus, you'll get some experience messing with a real server ("server" since it's a shared plan but whatever) and be less likely to fuck things up when you end up actually doing it for money.
>>
>>54495247
Get up to date with more advanced SQL stuff. Specifically JOINS and INNER JOINS.
>>
>>54496473

lmfao are you 16?
>>
Is wordpress a meme? I use it with my clients' shit websites because it gives me fast money setting everything up using a theme, but what if I want to create a more serious website? I was considering getting into Python + Django (I already know some Py)
>>
>>54504668
wait why are you making assignments in a functions parama... wtf.
>>
File: kej.jpg (599 KB, 3000x2584) Image search: [Google]
kej.jpg
599 KB, 3000x2584
>>54504668
>>
>>54510492
Wordpress is good for what it does, which is to provide code-illiterate normies with a way to manage content-based websites.
>>
>>54508853
$name =; DROP TABLE;
>>
>>54510492
this >>54510548

maybe check out Drupal too, I've seen many job offerings for Drupal devs in my country (EU).

but I guess you could use django too, probably find some good backend packages for it or write your own if you have time.
>>
>>54510492
No. It's for your client to stop bugging you and for you to deploy easily.
>>
ruby on rails vs django?
>>
>>54510612
If your clients would know how to use wordpress properly, they wouldn't need you, would they??
>>
>>54510649
Not him, but being able to build a website on wordpress and being able to update the company blog through wordpress are on completely different levels
>>
>>54510492
The second a java or C# dev comes along, they'll implement the same shit with just jQuery and those clients will notice much faster loading times and hey, maybe capped mobiles can also view the site.

WordPress is teenage girl tier.
>>
>>54510795
But you probably can't code an entire website in a week just like you could do it with a Wordpress theme
>>
>>54510938
Yeah, I could. I totally absolutely could. Writing html is the easiest shit ever and jQuery is extremely easy and powerful.

SEO on a dynamic website can be challenging, but that's what reactjs is for. Generally, Google will crawl iframes, so just iframe with a backend get request and you'll be sweet. Personally, I enjoy the obscurity. Fuck fame.
>>
>>54510938
What? In almost all cases you'd be faster without needing to build a theme for WordPress
>>
>>54510492
My professional website has a Wordpress backend.
>>
>>54511003
Can somebody link some good tutorial for building a (simple) cms from scratch? I don't know if I should use something like rails or django or just a raw php or whatever. Also, in a way that it can actually be possible to implement it faster than wordpress like you guys say.

Idk, I built the most of my news portal in 3 days with wp and I created my own template (whole design + just putting in php functions). If I could be doing something similar that fast from 0 I would like to learn it because I know wp is somewhat of a meme and I don't feel like being rajesh kumari rakataghidanesh.
>>
>>54511173
Trust me, no one considers you a professional.
>>
>>54511409
Why would you roll your own CMS for a simple website? That's an even bigger waste of time
>>
>>54511783
because your clients want an easy backend to create future content. They dont wont to hire you over and over again to upload the articles to the server.

>>54511409
i would go drupal or djagno if I were you. I myself am trying node out right now, but node would be problematic for servers with cpanel (which most customers seem to buy), so you have to go php or python
>>
>>54511895
Then you use WordPress
>>
What's wrong with this simple JSON album collection updater function guys:



// Setup
var collection = {
2548: {
album: "Slippery When Wet",
artist: "Bon Jovi",
tracks: [
"Let It Rock",
"You Give Love a Bad Name"
]
},
2468: {
album: "1999",
artist: "Prince",
tracks: [
"1999",
"Little Red Corvette"
]
},
1245: {
artist: "Robert Palmer",
tracks: [ ]
},
5439: {
album: "ABBA Gold"
}
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
if((value !== "")||(prop!=="tracks")){
collection[id][prop] = value;
}
else if ((prop=="tracks") && (value!=="")){
collection[id].tracks.push(value);
}
else if(value===""){
delete collection[id][prop];
}
else return collection[id];
}

// Alter values below to test your code
updateRecords(2548, "tracks", "Test");

>>
>>54512344
it tries to do too many things and can do the wrong thing on bad input
you should break up the property setting, track adding and record deletion into separate functions
>>
>>54512344
>mutable data
hahah have fun m8
>>
>>54512652
>>54512745

I think the problem is here:
> collection[id].tracks.push(value);
That's wrong.
>>
>>54512881
it fails if the array doesn't exist?
>>
>>54512939
Is that the appropriate way to access an object using variables ?
>>
>>54513044
i guess
the code looks ok to me
>>
like there isn't anything obviously wrong with it but i haven't ran it so i'm not sure
>>
>>54513118
Thanks mate! I solved the problem!
I changed
 
if((value !== "")||(prop!=="tracks")){


into

 
if((value !== "") && (prop!=="tracks")){


Wrong logical operator

Also changed:

  else return collection[id];


into

return collections;


Because it should return the whole object and it should return it in any case not only if the onther if conditionals aren't the case
>>
>>54513145
Thanks!
I know it's silly but this is the first time I write a real program and talk to other programmers about it... so exciting, I am loving this shit, even at this basic level.
Thanks again,.
>>
*is a little flustered*
>>
File: bootstrap wat.png (94 KB, 1985x757) Image search: [Google]
bootstrap wat.png
94 KB, 1985x757
playing with bootstrap
why arent the green and yellow boxes inside the bigger box ? where does this space come from ? when i do margin-left on the greenbox the yellow box gets pushed away
>>
File: 1461727204968.jpg (9 KB, 228x227) Image search: [Google]
1461727204968.jpg
9 KB, 228x227
>friend tells me that he could give me a fine job if I learn PHP, something I never touched
>check for courses since friend obviously tells me to learn it
>shit's mad expensive (third world country, no surprise here)
>requirements: learn HTML, etc. which I don't know either
fuck me
>>
>>54513584
>expensive courses
>requires learning HTML
Jesus Christ. Read through the official PHP documentation with a PHP interpreter in interactive mode open. That's all you need. There's nothing special and no gotchas in PHP. You should be perfectly capable of learning it without being spoonfed.
>>
I'm never going to get a job.
>>
File: 1452564085772.jpg (145 KB, 393x391) Image search: [Google]
1452564085772.jpg
145 KB, 393x391
>>54513764
>There's nothing special and no gotchas in PHP
>>
File: 1462997299698.png (130 KB, 377x251) Image search: [Google]
1462997299698.png
130 KB, 377x251
>>54513764
Thank you anon. I found about php.net and it has the shit that I gotta learn.
>>
>>54513764
>There's nothing special and no gotchas in PHP.
xD
>>
>>54504668
>mfw all these cucks laughing at me and not helping

I do deserve to be laughed at but should have helped, cucks.

Well, I fixed that. What I did was that I restricted the time not to span days and fucking BOOM.

You can't have an entry between '22:00 to 05:00'. Or in simple words I made it so from_time is never smaller than to_time.

That doesn't fix the overlapping part so what I did for that is this:
>>
>>54513764
>There's nothing special and no gotchas in PHP

Even the PHP documentation itself acknowledges that there are gotchas in PHP

http://php.net/manual/en/function.crc32.php
>>
So, who's a good, cheap email host that supports custom domains? Just want something reliable and secure for my own personal domain.
>>
>>54515526
Why not setup your own mailserver?
>>
>>54515631
Don't really have the time nor energy to set it up and maintain it. I just want to pay a company who knows what they're doing to handle stuff properly.
>>
>>54515526
Zoho. You have 10 free emails with your own domain.
>>
>>54515526
google apps is pretty cheap iirc
there's also zoho mail which is free
>>
>>54515748
>>54515761
Awesome, thanks!
>>
>>54515631
Because its not 1995 anymore.

Email gets automatically spam filtered by big email providers like Google and Yahoo if it doesn't come from a trusted provider.
>>
File: 1462641000875.jpg (198 KB, 960x960) Image search: [Google]
1462641000875.jpg
198 KB, 960x960
How did the guy that made nigge.rs have audio that auto played?

I've never added audio to a page before. IDK why i'm even working so much on a silly placeholder page but its kind of fun desu.
>>
>>54515909
google shit before asking dumb questions

<audio src="urafaget.mp3" autoplay loop></audio>
>>
>>54515909
http://lmgtfy.com/?q=html+audio
>>
File: helpful_error_message.png (5 KB, 309x117) Image search: [Google]
helpful_error_message.png
5 KB, 309x117
>>54515909
<audio autoplay />


Welcome to HTML5.
>>
>>54513484
I can't solve your problem because i'm not really good at this but, in some browsers body, and sometimes other elements, have margins. try setting the margin of the body to 0;
>>
>>54515992
Thank you

>>54515955
>>54515968
niggers
>>
>>54515992
How widely supported is this?

There is nothing wrong with using <embed> still at this point from what I can tell.
>>
File: 1446852439308.jpg (158 KB, 720x480) Image search: [Google]
1446852439308.jpg
158 KB, 720x480
>>54515992
> />
why do people still do this?
>>
>>54516044
http://lmgtfy.com/?q=caniuse.com+audio
>>
>>54515909
I am no weaboo but that fucking music is addictive. Please help.
>>
>>54515884
not strictly true, you just have to do a bit of jumping through hoops to get past the spam filters
>>
>>54516086
it feels better and safer
>>
>>54516288
<audio />
is syntactically incorrect in html5 since <audio> is not a void tag, and even if it was it would have no effect so there's absolutely no reason to use it
>>
I cant find the reason that half my Webm's say they are unsupported or corrupt. Im not sure if its from when i copy over to the SD card but the terminal stops working and doesnt give any warnings.

http://carbonrails.com/webmtest.php
>>
>>54513764
>There's nothing special and no gotchas in PHP
kek
>>
>>54516544
400 Bad Request
>>
>>54516686
Where are you at? I tested it yesterday on 4 diffrent networks and didnt have an issue a hour after I changed it.
>>
>>54516086
Explicit single tag, bro.
>>
What do you guys think of Ars Technica's new site redesign?
I read the article about the motives behind it and one thing that stood out to me was the writer's assumption that scrolling isn't so bad.

I think their new design is okay, but I miss having the higher density of stories @ the top of the page. The way it is now, I take more time to scan each article header before I move on.
>>
File: Capture.png (53 KB, 1366x708) Image search: [Google]
Capture.png
53 KB, 1366x708
>>54516768
Latvia. Perhaps your host region banned all Eastern Europe. It outright ignores my request and times out after 20 seconds.
>>
Anyone else figuring out good strategies to structure large React + Redux apps because this shit is so new there's no battle tested approach?
>>
>>54516862
thats weird. Im using namecheap dns and it takes a while to send nameserver updates.

can you hit it with the ipv6:
2602:306:cec2:2e70:d2f7:9859:d50e:ea56
>>
>>54516044
Every modern browser supports it. For Chrome and Firefox you can use ogg, the rest can use mp3. Have both sources.
>>
>mfw using PyCharm for my django project

Fuck no. It has all these shiny features but nothing beats Sublime and a console window.
>>
>>54517004
What are you talking about?
IntelliJ IDEs are the best thing ever.

Do cmd + click on a function, and you are send to the definition. Show me a sublime plugin that does that
>>
>>54516932
Same with IPv6 and same on mobile network. Maybe they banned us together with Russia.
>>
>>54517078
>Maybe they banned us together with Russia.
Hahaha caught you, you damned Ruskies!
>>
It's cluttered as fuck. I love my clean Sublime environment.
>>
>>54517055
There are Atom plugins for Go and TypeScript that do, from the one's I've used.
>>
Can I make a html button open a new tab while I stay in the current one, like when middle clicking a link? Ctrl+click doesn't work.
>>
>>54517520

Shape a link like a button.
>>
I don't get these fucking issues closures have with loops. The documentation is so confusing
>>
>>54517552
I'm using the button to submit an input.
>>
>>54517574
JS?
>>54517582
So what?
>>
>>54517608
Yes
>>
>>54517608
How am I supposed to make it a link when I don't know what I'm inputting?
>>
>>54517624
Best just use const and let, compile with TypeScript or Babel and forget var ever existed. The alternative is pulling hairs each time variable hoisting creates a bug.
>>54517662
What?
>>
>>54516932
In the United States, GA. 400 Bad Request as well.
>>
>>54517789
I want to be able to submit an input after I load the page in my browser. Can I do that with a link instead of a button?
>>
File: DeepinScreenshot20160512190304.png (391 KB, 2560x1080) Image search: [Google]
DeepinScreenshot20160512190304.png
391 KB, 2560x1080
>>54517837
>Works on all of my machines.
I wonder why....
>>
>>54517892
Of course.
>>
>first time web dev job
>website working great
>doing google search engine tests
>evidently pages are getting doctype errors which makes the search engine not see them correctly
>have no idea what the fuck I should do to fix it

anyone got any ideas? I called Bing and they were the ones that pointed that the document errors are the cause.

But I have no idea what the best method is for finding these errors and cleaning them up is.
>>
>>54517978
Pay me and I'll do your job for you, Anon.

jk. I don't know.
>>
>>54517978
>I called Bing

lol
>>
>>54517978
>I called Bing
>>
>>54518054

[spoiler] I emailed bings pajeet service who pointed it out [/spoiler]

but yeah I have no idea since the website itself is in good condition at the moment with no visible errors.

only the search engines see them.
>>
>>54517978
>>54518098
Well post a link or at least the error text or something. Without any specifics, I have no idea what a doctype error is referring to. Are you correctly setting the doctype on every page?
>>
File: errors.png (28 KB, 1675x509) Image search: [Google]
errors.png
28 KB, 1675x509
>>54518225
here are the errors for one of the pages. Why the hell do these errors cause search engines to think they 404?
>>
>>54518295
So why don't you look in file: Medicine, Line 115, Column: 1?
>>
>>54518390

I did the are just simple <html> tags

I even deleted or fixed all errors for that page except for a

<title> tag being in the wrong spot

still I get a 404 on w3schools validator and google search console indexing
>>
>>54518438
Why do you have an <html> tag on line 115? The only place you should have it should be on line 2 after the <!DOCTYPE html> and the na </html> on the last line.
>>
>>54518502

I am loading 3 html pages and when I first started doing this I didn't realize you only needed the first html tag at the top and 1 at the bottom since when you load the 3 pages it just puts the 3 documents into 1 html page and then loads.

I removed those weird ass errors except for one with <title> since that is determined by the 2nd page loaded and not by the header page or footer page.


but how can minor html tags cause a 404 for google web crawler?
>>
>>54518533
FFS!
Learn the fucking basics before doing shit, for fuck's sake.

<html> denotes the root element of a page. There can be only one of those, otherwise the page cannot be parsed. Fuck, why the fuck are people (me included) spoon feeding you. This is the kind of shit you'd know if you literally studied HTML for 30mins.

Also, how the fuck do you have a job
>>
>mfw doing everything as it should be done

All this fucking beauty. I would fuck this project if it was a girl.
>>
>>54518584

><html> denotes the root element of a page. There can be only one of those, otherwise the page cannot be parsed

if that's true then why after I removed those html tags is the page failing to be verified by googles web crawler?

>Also, how the fuck do you have a job

no one else took it senpai
>>
>>54518615
iktfb
>>
>>54518622
Literally still spoonfeeding you like a babby.
You absolute fucknugget. You're what's wrong with webdev nowadays. People who have LITERALLY no idea how to do the simplest things are getting jobs because they can use "muh bootstrap" or some other absolutely useless piece of shit "library framework api" that lets them drag-and-drop to create >25mb shitty and shoddy excuses of websites that only work with at least 10 external 3rd party JS libs.
Fuck you and everything you stand for.

(Remove <!DOCTYPE> from line 115,
What the fuck is on line 117
What the fuck is on line 212
If you were so retarded as to have multiple <html> tags, I bet you also have multiple <head>s, etc. which are also only supposed to appear once per document.)
>>
>>54518533

First of all, this >>54518584

Second of all

>I am loading 3 html pages and when I first started doing this I didn't realize you only needed the first html tag at the top and 1 at the bottom since when you load the 3 pages it just puts the 3 documents into 1 html page and then loads.

What the fuck are you doing pajeet. No wait, I know the answer: "I have no idea and I should be ashamed of myself for getting this far over my head with zero idea what I'm doing or understanding the first thing about html." Well said, anon.

Now, why the shit are you just concatenating three html pages? Don't do that.

>how can minor html tags cause a 404 for google web crawler?
Because if you don't structure the page right, the web crawler won't have any fucking idea what it's looking at, and assume you did something horribly wrong. Which you did.
>>
> tfw you have to maintain a php 5.2 WordPress site
> tfw wihle WP is up-to date-ish the database is ancient and it was built without post-types and custom taxonomies
> they jerry-rigged custom post types by abusing nested categories
>the theme is a mess because it's impossible to sort this shit out
>I'm used to writing unit-tested OOP code
> there's a download area built upon filesystem-access with $_GET parameters hardcoded into the theme (as far as I can tell, it's not insecure, but goddamn, there's a media library and framework support)
> client maintains that download area using ftp
> they're architects so everything needs to be pixel-perfect with ie7 support
> they don't understand why we pressure them to pay up for a complete refactoring

I am not making this up.
>>
>>54492344
If I ever have to work with an Indian again I'm changing companies
>>
File: 1439154520934.jpg (40 KB, 500x738) Image search: [Google]
1439154520934.jpg
40 KB, 500x738
>>54518691
>mfw literally every single fucking time I come to these threads or hear how people do webdev in general these days
Thread replies: 255
Thread images: 38

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.