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

/wdg/ - Web Development General Previous Thread: >>57

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 301
Thread images: 20

File: tumblr_mijcpbneUm1rpyupco1_500.gif (875KB, 500x281px) Image search: [Google]
tumblr_mijcpbneUm1rpyupco1_500.gif
875KB, 500x281px
/wdg/ - Web Development General

Previous Thread: >>57767395

>Discord
https://discord.gg/wdg
OR
https://discord.gg/0qLTzz5potDFXfdT
(they're the same)

>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/
https://www.freecodecamp.com/
http://www.w3schools.com/
https://developer.mozilla.org/
http://www.codewars.com/

>Useful Youtube channels
derekbanas
thenewboston
learncodeacademy
funfunfunction
computerphile
codingrainbow

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

>Backend development
https://en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks
[Gist] backendDevelopmentBookmarks.md

>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
http://pastebin.com/pDT82mQS

>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
>>
What should i build in php?
Suggest me something
>>
File: notspam.png (7KB, 974x122px) Image search: [Google]
notspam.png
7KB, 974x122px
I'm trying to write text in an existing input box automatically when the page loads, the input has no "value" tag.
I tried this but doesn't work, am I going at it in a wrong way? (can't post the text here because it says it's spam).
>>
>>57804802 (cont)
>"(nameFill)"
I just noticed I forgot to remove that (it's from a previous test), it should be "()" though I tried and still doesn't work.
>>
>>57804802
You don't need the .input. Console. Log this shit anon
>>
>>57804404
A website where users can submit a wish list (including descriptions and links to products), and people invited to the wishlist can check off purchased items without letting the user know.

Shamelessly plugging myself here, you can use this script I wrote for snowflakes:

https://github.com/collinoswalt/Flakes.js

You can demo it here:

collinoswalt.com/list.html

(the snowman thing isn't included)
>>
I'm installing Apache and plan to use it for local testing. In the config file can I just set ServerName to localhost?
>>
>>57804996
>10 contributions in the last year
>>
>>57806760
>>57806775

You can close off php and switch to HTML mode by typing '?>' and go back in to PHP by typing '<?php'

'<?= ..... ?>' is just short for '<?php echo ..... ?>'

<php foreach($result as $row) { ?>
<tr>
<td>
<input type='checkbox' name='checkbox[]' class='checkbox' value = '<?= $row['column'] ?>' />
</td>
<td>
<?= $row['column2'] ?>
</td>
<td>
<input type="text" value="<?= $row['column3'] ?>" />
</td>
</tr>
<?php } ?>
</table>
>>
I asked in the last thread just before it died but couldn't see the replies.


I'm doing a web development boot camp right now and also learning about SEO as SEO and digital marketing are an easier field to get into. I heard web development guys don't know shit about SEO. is this true? Most SEO guys build sites using a CMS like WordPress.

But wouldn't it be best to all of you in web development to also learn some SEO to optimize your sites traffic, search engine ranking and also if you code and design your website with a SEO mindset your site would be better, no?
>>
>>57806939

i'm not quite the php guru yet but this looks absolutely horrendous

><?php } ?>
>>
>>57807174
SEO is not really coding.

You can optimize your site's traffic by doing annoying bullshit like slide shows, "click here to view more", and all that shit that everyone fucking hates in a website.

Most SEO is done by keeping the site updated. That means running a blog, being active on social media, etc. You don't need a developer for that.
>>
>>57807174
SEO nowadays doesn't really get you shit unless your website is heavily information based.

Using HTML5 tags, meta tags, no pop-up ads and HTTPS will boost your pagerank and get you as much SEO as you need.

>>57807274
You can also do <?php endforeach; ?> If you started the loop with ':' instead of '{'. Many prefer that for the readability.
>>
>>57806939

so i have to add in each td then? this is really no different than what i have no, except less echo's. This IS nicer to look at....not arguing that, but either way i'm still gonna have a shit load of td's....oh well...
>>
>>57807418

lots tr's too...it's a huge table
>>
>>57807433
The <tr> is only going to be required once in the foreach loop since I'm assuming that each record requires one row.
The HTML output though will be the total amount of rows that were pulled from the database
>>
>>57807174
>I heard web development guys don't know shit about SEO. is this true?

Sounds like whoever told you that is bitter because they're too stupid to write code and need to feel relevant or something. Most web developers do actually know about SEO because of-fucking-course they do.
>>
>>57807465

right. That's how i have it now. I'm just echoing it instead of like what you did. I'll try not to echo as much next time...thanks
>>
>>57807485

i know about SEO but i absolutely despise doing it
>>
>>57807174
Was the person speaking a pajeet? Everyone I know that is concerned about SEO are pajeets for some reason
>>
Can anyone recommend some resources to learn what and how to create REST API?
>>
is it better to leave a form action blank or not even put the action attribute? btw if youre thinking why i dont have a whatever.php file as the action, it's because i dont wanna change to a different URL/page after submit
>>
>>57807650
You can leave it blank if you plan to submit the form with AJAX. That being said if a user has JS disabled or is using Lynx, your form won't work. So I recommend having *something* there to fall back on.
>>
>>57807639
Just google REST API <language of your choice>
>>
>>57807673

ya im using PHP....it's been my shoulder to lean on when things get crazy
>>
>>57806071
github is boring so I don't use it much
>>
>>57807294
AFAIK slideshows are BAD for SEOs, and I see them less and less.
>>
>>57804361
i got a VPS
$uname -r 2.6.32-042stab116.2

thats a fuckold kernel if im not mistaken, how do i update the kernel. i only have a cli.
>>
i'm confused on this...

$name = $_POST['name'];
$email = $_POST['account'];

foreach( $name as $key => $n ) {
print "The name is ".$n." and email is ".$email[$key].", thank you\n";
}


why shouldn't you do $name[$key] to get the name? why the => $n part?
>>
$('.sidebar-controls ul li a').css('color', '#fff');
$('.sidebar-controls ul li a:nth-child(1)').css('color', 'red');


Why does this make all the links red, instead of just that one?
>>
>>57804802
If you want a placeholder you can just use the 'placeholder' attribute on the input tag.
>>
>>57808452
Are there multiple links in each of the list items?
>>
>>57808314
Depends on the distro but usually it's relatively simple to do with the package manager. Just google <your distro> upgrade kernel
>>
>>57808452
Try this

$('.sidebar-controls ul li a').css('color', '#fff');
$('.sidebar-controls ul li a:first').css('color', 'red');


Also would help posting the HTML
>>
>>57808501
Otherwise if you have 1 'a' link in every list item element it's going to go red. You can fix this by:

$('.sidebar-controls ul li a').css('color', '#fff');
$('.sidebar-controls ul li:first a').css('color', 'red');

Also would help posting the HTML
>>
>>57808479
>>57808501

>>57808525
Ah, thanks guys, this is it. I knew I had this problem before, should have give nth-child to <li> item instead of <a>, facepalm.

Here's the code, but doesn't matter now. Yeah, I have separate links and I change their css in the functions they call.

<ul>

<li><a class="load_popular" data-url="<?php echo admin_url('admin-ajax.php'); ?>">Popularno</a>
</li>

<li><a class="load_most_liked" data-url="<?php echo admin_url('admin-ajax.php'); ?>">Najbolje ocjenjeno</a>
</li>

<li><a class="load_latest_comments" data-url="<?php echo admin_url('admin-ajax.php'); ?>">Novi komentari</a>
</li>

</ul>


Formatting will probably get fucked, sorry.
>>
>>57808550
If you're doing page navigation with PHP why not just put styling for the colours in the stylesheet for every of those links.

You can then style an '.active' class that has the colour red. Then in each list item element you can check if the page is loaded and echo out the class 'active' if it is.
>>
>>57808614
Yeah, I would have done that for the navigation, but these are tabs on the sidebar, so URL doesn't give me any information. But it's easy to know which one is selected based on the function they call, so I figured out I could just change the colors there. Don't know if there is a better solution, though.
>>
>>57808366

ok i think i understand

$n just prints each name in the $name array, but the $email[$key] is confusing me now. I know what an associative array is...but these are indexed arrays. Is this foreach loop trying to imitate an associative array...? cot dam this is confusing.
>>
Gonna have to ask again, problem isn't solved yet and it's driving me crazy.
Why does this mongodb query only update the entry with plupdate and not with update2?
 collection.update(query, {$set: plupdate, $set: update2} 

When I change the order and have update2 first it uses that key/value pair to update the field (and ignores plupdate), so I figure the problem has to be here and nowhere else in the code.
>>
>>57808665
>>57808366
You don't need a foreach loop unless it's an array.
$_POST is an array that the server receives when a user submits a form with the method of "POST"

$name = $_POST['name'] indexes the name key that was sent to the server. This may have not necessarily happened (the user may send anything they like to the server and it's your job to validate these inputs on the back end)

If you print out the variable $name you should get whatever the user sent you

print "Your Name is $name";
print "Your email is $email";

That foreach loop that you made may have probably looped for the amount of characters in the name

Also remember if you're using double quotations you can insert variables in to them without needing to close/concatenate the strings


I'm assuming by your variable naming
>>
>>57808779

that was just an example i found online. My real code is as follows, but it didn't echo out anything.

if (isset($_POST['submitBtn'])) {
$checkBoxValues = $_POST['checkbox'];
echo $checkBoxValues;
}


$checkBoxValues should be an array... i gave multiple html checkboxes a name of "checkbox[]". When a user selects some checkboxes, the values of those checkboxes should be put into the array
>>
>>57808993
The isset should check if the POST checkbox is set, not the submit button.

There's also a PHP function print_r($var) that prints out the contents of an array so you can see what exactly you're getting.

It may also help showing us what your HTML code is. The check boxes on the client side should be named 'checkbox[]'
>>
>>57809077
You may want to use print _r($_POST) to see what you are receiving
>>
>>57809077

i found another part i messed up on...the submit button wasn't properly named. But shouldn't i check if the subit button is set? the input checkboxes are in the form a long with the submit button...its a delete button. User selects which rows they want deleted from the table via checkboxes and hit the delete button to delete them.
>>
>>57809289

ok i got this code to show me whats in the array after the submit button is clicked

    $checkBoxValues = $_POST['checkbox'];
print_r($checkBoxValues);


it looks like it's an associative array. I thought it was going to be an indexed array
>>
>>57809289
>But shouldn't i check if the submit button is set

It just depends on your implementation.

One implementation can have both buttons going to different URLs (this is typically used in conjuction with javascript)

For example:
submit button goes to add_record.php
delete button goes to delete_record.php

If you have a form like the following:
<form method="get" action="update.php">
<input type="checkbox" name="checkbox[]">
<input type="checkbox" name="checkbox[]">
<input type="checkbox" name="checkbox[]">
<input type="checkbox" name="checkbox[]">
<button type="submit" name="update">Add Record</button>
<button type="submit" name="delete">Delete Record</button>
</form>


You can add a check on the update.php page if the $_POST['update'] key is set else check the $_POST['delete'] key is set and make a decision based on the action.
>>
>>57809425
Meant to also change the method="get" to method="post"
>>
>>57809425
And if you're handling row deletions, you may want to set the checkbox value to the record ID

for example:
<input type="checkbox" name="checkbox[]" value="<?= $row['personID'] ?>">
>>
>>57806939

Nigga, if u do that. please use:

<?php foreach($result as $row) : ?>

//things

<?php endforeach; ?>
>>
>>57809515
Yeah I did note that in the previous thread, and also following his comment
>>57807342
>You can also do <?php endforeach; ?> If you started the loop with ':' instead of '{'. Many prefer that for the readability.
>>
>>57809377

ok nevermind it's not an associative array. It's an index array like i thought the entire time. I think i got it now.

i have 2 nested if isset conditions that first checks if the button was submitted, then the second one checks if the checkbox array is empty, which would mean the user hasn't selected any checkboxes yet
>>
Is there anyway, using html5/js/css, that i can make it so a specific image will appear on screen for a short period of time only after the user inputs a specific sequence of keys while they're on my page?
Much like the konami code on some sites.
>>
>>57804361
how do i connect to the localhost on my laptop from another laptop, or an iphone? i have a laptop running lamp that i want to be able to have my teammate connect to from his apple laptop. my database doesn't work on his mamp for whatever reason, and we spent 2 days trying to get it running on his mac but it just doesn't work. so we're going to try to have him connect to my laptop as a server for the demo we have to do coming up.

right now i'm just trying to access my laptop's localhost from my iphone. i'm entering the IP address into the iphone's safari bar and it doesn't work, says server stopped responding like if i sent in any fail website
>>
This is my third semester doing Web programming is bad that I'm still using the books for reference? Alot of this is difficult to remember out the of my head.
>>
>>57809934

Something like this perhaps

HTML:
<img id="image-display" src="image.jpg"/>


JS:
var combination = "";

var secretKey = "12345";
var iterator = 0;

document.addEventListener("keydown", function(evt) {
var charCode = evt.keyCode || evt.which;

characterPressed += String.fromCharCode(keynum);

if (secretKey.charAt(iterator) != characterPressed) {
combination = "";
iterator = 0;
return;
}

iterator++;

if (combination == secretKey) {
document.querySelector("#image-display").classList.add("popup");
}

})


CSS:
.popup {
opacity: 1;
animation: fade 1s linear;
}

@keyframes fade {
0%,100% { opacity: 0 }
50% { opacity: 1 }
}
>>
>>57807294
>>57807342
>>57807485
>>57807524
>>57808237

so I'm considered a pajeet just because I can code a simple CRUD and do SEO for WP ? Smh.
>>
>>57810198
Just replace characterPressed with combination. hadn't tried this out but with some tweaking it should work fine
>>
>>57810103
for some reason, the IP address i was told was mine when i went googled it and google told me i had wasn't the right one. i had to type ifconfig and enter one i found in there. why would it tell me a completely different ip address? it wasn't even close
>>
>>57810359
It's because ifconfig shows you your LAN (Local network) IP address, not your WAN (external) IP address.
Your external IP address is used by many devices on your LAN to connect to the internet
>>
jquery only seems to make things more difficult
>>
>>57810480
so they have to be on the same local network to connect? i can access my laptop1's localhost from my laptop2 on my home network where they're both on the wifi. should this work at my school's wifi between me and my teammate then, if we're both on the same school wifi network?
>>
>>57810629
They can be on a remote network to connect but that requires you to open your router's settings, allow port forwarding of port 80 (HTTP) from the router to the PC on the local network (192.168.x.x or 10.x.x.x).

This is so when people access your public IP with port 80, the router knows to direct this request to your PC so that your PC can respond to the request.

Also it may require a bit more additional configuration of your web server to allow it to work on remote networks. A lot of the time typical WAMP/WEMP/MAMP software stacks disable external network access.
>>
>>57810708
i don't think i'd be able to change anything with the router settings. is it possible the school wifi would have some setting that would prevent him from even being able to enter my LAN ip address and connect to my machine? maybe i entered the wrong IP address, but i'm pretty sure i tried multiple on his machine and it didn't work like it's working now i'm at home
>>
>>57810794
You need to configure port forwarding on the router that is connected to the server. If your home PC is running the server then you'll need to configure your home router.

It would only allow port 80 access to your PC from remote users on the internet. The worst they can do is exploit some server side script you added on the server to delete or move files.

Alternatively you could just connect through remote desktop
>>
Anyone deal with recruiters a lot?

Are my suspicions correct that if you don't have a degree or prior professional experience then they toss you out?

Not a single recruiter has clicked the link to my "sample" website that is used more than their recruitment website.

What is this retarded shit? I'm about to just send emails to everyone at web dev companies with links to what I can do.
>>
>>57810964
it won't be at home, it'll be at our university. we have to demo our project

right now i'm having an error, i changed the URL in my code from localhost/android_connect/get_all_entries.php (works on my main laptop) and now i'm testing it on my secondary laptop. i changed the url to my laptop1's LAN ip address, and it works in the address bar on firefox. but java tells me

java.net.MalformedURLException: no protocol: my.ip.add.ress/android_connect/get_all_entries.php
at java.net.URL<init> etc etc


will it not let me have the url be an ip address? how do i fix this?
>>
>>57811092
>no protocol
Sounds like you may need to put "http://server.ip.address" in your code
>>
>>57811092
needed http:// at the front. it's working now which is awesome. to pre-empt the possibility of the school wifi having blockers in place that wont let us do this, would i be able to do this with a cable when neither of us are connected to wifi? like, an ethernet cable between our laptops?
>>
>>57811172
yeah that was it. lol
>>
>>57811026
>Are my suspicions correct that if you don't have a degree or prior professional experience then they toss you out?
Recruiters are interested in anyone that will make them money. It's just that there is an over-supply and under-demand for junior devs in general.

>Not a single recruiter has clicked the link to my "sample" website that is used more than their recruitment website.
Recruiters are glorified keyword matching algorithms that can use a phone. They aren't going to put in any actual work if they don't have to.

>I'm about to just send emails to everyone at web dev companies with links to what I can do.
That's probably going to be more annoying to them than helpful. What you should do is figure out which one or two people at each company you should actually be talking to and focus on them. Ask around, go to meetups, etc. Make friends with other developers. Personal recomendations >>>>>>>>> cold calls/emails for getting the job you want.
>>
>>57808314
Must be openvz
It's different compared to KVM hosts, usually with OVZ you are running a layer on top of the host OS meanwhile KVM is full virtualization so you can run any OS you want

In the long run OVZ is better but for more resource constrained VPS' seems that OVZ is the better solution as it uses less resources.

Can be prone to overselling though, guess that's a heavy point why KVM is generally more expensive.

>>57807174
You need to know basic SEO if you are planning to monetize *anything* on the internets. Most traffic nowadays comes from search engines.
I'm involved in a heavy SEO optimization project and there's a lot of stuff that can be very complicated to grasp when you are trying to squeeze even the smallest advantage you can get.
>>
Is Ruby/on Rails still a reasonable language to invest time in?
>>
How do you just serve a static HTML file with Go, using gorilla mux to point to some handler? also using negroni.
>>
>>57814370
Just go the JS route, you already need JS for the front end and just use express for the backend (if you want it to be more simple and get up and running faster, use firebase)
>>
Non-web programmer here. I want to create a small website where I can type up a post and then click submit and it will create a new page and add links to some other pages. I just tried following some ruby on rails thing and all these gems and node js runtime requirements and coffee script and bash scripts and tables made me want to die, I don't understand any of this, what do?
>>
For putting projects up on github, if they use API keys is it standard to just edit them out before you upload or something?
>>
>>57816372
I'm storing mine in config files which are on the gitignore list and have a general empty/default example.config next to it.
So I don't accidentally push secrets to the public and everyone else just have to rename the example.config file after configuring.
>>
File: me_on_the_left.jpg (81KB, 1024x683px) Image search: [Google]
me_on_the_left.jpg
81KB, 1024x683px
>halfway through project
>get bored
>think of new project and start on that
how to stop this mentality
>>
Should I create 5 copies of the same page for the sake of changing one section with some divs?
is this the way to go?
>>
>>57817480
no.
use a templating engine/generator or anything that lets you use a master page for the layout.
>>
What should i build in php, suggest me something
>>
>>57817634
I already use bulma and I'm creating a landing page for a business

it has 5 different categories of pricing tables which should be accessed via a tab system

I'm thinking of just showing and hiding them inside the html but that's a lot of repeated html and js
>>
File: wtf.jpg (71KB, 1808x438px) Image search: [Google]
wtf.jpg
71KB, 1808x438px
Pic related, see comments

Why is the 'value' keyword not needed in normal object declarations but is needed in the object.create method?

I understand everything else going on here, just dont understand the format of the second argument to object.create().
>>
Opinions on JS templating engines?

I'm setting up a backbone app and I'm not sure what kind of templates to use.

I've used mustache/handlebars a couple of times and liked them. But while mustache is pretty rigid, handlebars offers so many possibilities at the cost of having to maintain a shitload of helpers.

So I'm leaning towards saying fuck it and just using ejs straight away.
>>
>>57818089
the 2nd parameter for object create wants properties, which have multiple other settings besides a value.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
>>
>>57818129
Interesting, this language gets messier and messier the more time I spend with it.
>>
File: 1457477612407.png (235KB, 633x633px) Image search: [Google]
1457477612407.png
235KB, 633x633px
I've a <p> inside 2 <div> (div> div> p <div <div) that doesn't have any id or class. How can I edit the properties of this <p> in CSS?
The <p> is generated by a widget, I cannot directly modify it.
>>
>>57818162
just use a class instead.

class SuperHero {
constructor(name) {
this.name = name;
}

sayHello() {
console.log(`Hello, my name is ${this.name}`);
}
}

var superman = new SuperHero('Superman');
superman.sayHello();
>>
>>57818221
div > div > p { }
>>
How do you use the HTML datetime inputs (week, month, datetime-local etc.) consistently even in browsers that don't support it?

All the polyfills I've seem so far look awful and I can't really expect my users to input dates in the yyyy-MM-ddThh:mm:ssZ format that the standard demands. Using a shitty JS based date dialog on all browser just because Firefox doesn't support those inputs feels wrong too.
>>
>>57818358
I check if the date input type is supported before adding a custom date picker.
>>
>>57818249
I'll try that, thanks!
>>
>>57818388
What datepicker are you using? Also have you found anything for month or week inputs?
>>
>>57818471
pikaday.
for months I'm just using two dropdowns, one for the month and another one for the year.
haven't had a case where I needed weeks yet.
>>
If you created 50 pages of website content, mostly in the form of guides.

Is it better for SEO to upload 30 pages and then slowly add the rest?
Or is it better to add all content right away?
>>
>>57808366
<?php print_r($_POST); ?>

Just do it, faggot
>>
Are emojis cancer?
>>
>>57819016
It's best to have fresh content every week or so.
>>
>>57809515
>>57806939
>>57807274

What is wrong with all of you? This is the nicest way

<?php 

foreach($result as $row) {
echo <<<HTML
<tr>
<td>
<input type='checkbox' name='checkbox[]' class='checkbox' value = '{$row['column']}' />
</td>
<td>
{$row['column2']}
</td>
<td>
<input type="text" value="{$row['column3']}" />
</td>
</tr>
HTML;
}
echo "</table>";

>>
>>57815894
Just use wordpress
>>
>>57820392

still looks like crap, m8
>>
Mummy asked what I want for christmas. I've asked for a book on functional javascript. What would you ask for, /wdg/?
>>
>>57820651

ask for something different. There are so many js tuts online....even books you can just read the pdf's....
>>
>>57820665
I'm so not materialistic I don't know what to ask for. I prefer physical books to electronic versions. So far everything else on my wish list is just beer.
>>
File: wargames-1983-01-g.jpg (57KB, 500x500px) Image search: [Google]
wargames-1983-01-g.jpg
57KB, 500x500px
>>57820689
Also a trashcan. I need a new trashcan so I asked for that. The kind with a little pedal at the bottom so you don't have to touch the lid
>>
any good alternative to dropzone.js?

currently our project is developing a digital asset repository in our office, we are trying nosql as database(cuz its scalable lel)
>>
>>57820713

React? I would just use php/nosql and vanilla js and jquery for front end......js frameworks are kinda meme-ish
>>
>>57818106
I usually prefer ejs. It doesn't have any bullshit alternate syntax or markup languages to deal with. You can just deal with plain html and plain javascript.
>>
>>57820743

nvm i though dropzone.js was a meme front end thing framework. Why dont you want to use it for drag and drop file uploads?
>>
>>57820713
I think jquery has draggable elements, but idk if you can drag and drop to upload things.
>>
What are some more "easy" java web frameworks ? I tried the spark-webframework but it had like zero documentation available. Is Spring MVC worth getting into or is it just the usual "enterprise"-megabloat ?
>>
>>57821025

>almost 2017
>java for web development
>>
>>57811026
Or you can just fill out the job application on their site like a normal person
>>
>>57817249
Adderall and/or meth
>>
>>57821025
struts2 is pretty easy.
>>
>>57820392
No the heredoc shit is cancer
>>
Are people using Typo3 anymore?

It's all wordpress and joomla
>>
I'm trying to get into web development a bit. Where can I find some very, very basic html templates to mess around with? As in, very basic.
>>
>>57821895
https://html5boilerplate.com/
>>
>>57821895
Here you go

<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>My great template</title>
</head>

<body>
<h1>Welcome to my page!</h1>
</body>
</html>
>>
>>57821697

>being a degenerate

nobody should do drugs like that especially for programming, will fry your brain, and lead you down a bad road. If you need drugs for programming then this isnt for you anyway
>>
>>57821933
Amazing.

>>57821910
This is pretty much what I was looking for. thanks anon
>>
>>57821969
b-but mr. robot does morphine all the time
>>
>>57821995

morphine is a pain killer....how this relates to programming i have no idea
>>
I have a navbar here, how do i change the color and the font color?

https://jsfiddle.net/hoevqu8a/
>>
File: thefrogofmemestreet.jpg (280KB, 800x1200px) Image search: [Google]
thefrogofmemestreet.jpg
280KB, 800x1200px
>>57808366
>he doesnt use REST endpoints
baka familia
>>
>>57822499
https://developer.mozilla.org/en-US/docs/Web/CSS/background-color
https://developer.mozilla.org/en-US/docs/Web/CSS/color
>>
File: bc3JtOm.jpg (116KB, 640x960px) Image search: [Google]
bc3JtOm.jpg
116KB, 640x960px
I'm making a reflowable EPUB in InDesign. I want the text as it appears on a kobo or any other e-reader to be as customizable as an ebook is supposed to be—font, paragraph justification, line-spacing—but it seems that "Generate CSS" in the export options makes all of this fixed and unchangeable on the kobo.

I need the CSS on the other hand to keep formatting such as alignment, indentation, paragraph spacing and font styles. I've been scouring tutorials and articles everywhere and can't find the answer.

Can anyone help? Pic unrelated.
>>
>>57822890
either you want to keep the formatting or let it be changeable.
you can't have both.
>>
What should I write in PHP or Python
>>
>>57823205

whatever youre most comfortable with i guess...if you go php route make sure you aren't writing old php that isn't secure. I dont know much about python security issues....JS is "up and coming" on server side....look into that too. At the end of the day its up to you.
>>
So, I have a fixed sidebar which shows recommended posts and additional information about articles.

Should I let users open/close it or always have it opened? I designed everything around it so it is not bothering while you read the articles but I can't decide because, if it would be closed on a default, given the psychology of people, they would rarely open it, and I don't want that - I want them to see other articles at all times.
>>
>>57822964
So how do publishers create epubs with adjustable font, line spacing, margins and justification but with fixed character alignment, indentation, font styles and paragraph spacing? It's standard for all epubs you buy. I want to know how they do it.
>>
File: 2016-12-03---14-35.png (23KB, 652x266px) Image search: [Google]
2016-12-03---14-35.png
23KB, 652x266px
>>57818089
var superHero = function(config){
for (key in config){ this[key] = config[key]; }
this.sayHello = function(){
var s = {
"a": "font-weight: bold; color: green;",
"b": "font-weight: initial; color: black;"
};
console.log("Hello, my name is %c%s%c!", s.a, this.name, s.b);
};
return this;
};

var superman = new superHero({"name":"superman"});

superman.sayHello();

console.log({"prototype":superHero, "instance":superman});
>>
Is angular2 an abortion?
>>
So in a few days I will have a 2 hour interview where they will put me in front of a pc to do something related to ASP.NET + MVC + Entity Framework. Any idea what I might need to do ? Or if you know any place where can I find some practice ideas ?
>>
>>57823510

It's good for UI work, but people are developing with it thinking all the same tenets and security that comes by default with PHP/ASP/etc is totally gone when you use it to fetch data.

One example is that the cache needs to be treated way differently in an angular world.
>>
>>57823540
A very simple guest book for example.
Reading all posts with paging, creating posts.
>>
>>57823570

front end frameworks like angular aren't focused on security anyways, so you shouldnt expect those things to carry over. You can use angular with both php or asp.net
>>
>>57823598
Thanks for your idea, the CRUD operations are easily to implement with scaffolding, also managed to learn about paging lists. For my practice I implemented a Checkbox that acted like a filter for example if it was checked , a certain operation would happen in the controller. Are there any other common things to know ? (something similar to the checkbox example perhaps ? ) .
>>
>>57823570
Wut?

Please explain.
>>
>>57823540

definitely don't limit yourself to M$ stuff. If you get the job, cool, but dont feel like youre forced to do asp.net, especially if youre a beginner. Don't want to start with a layered framework that prevents you from learning whats really going on underneath. They'll probably have you go through how you would make an app that does this and that
>>
>>57821995
>doing something just because mr. reddit does it

Also he gets his ass kicked constantly and is batshit insane. Plus he's in netsec which has garbage job prospects compared to web development. Probably not someone you want to model your career after.
>>
>>57823806

to be a little more specific:

>MVC
probably will make sure you have a good understanding of this architecture, which you should. MVC is not specifcally related to .net, it's everywhere nowadays
>Entity
this IS specific to .net. It lets you "map" your data in a "easier" and more "efficient" way using OOP

Hope you know MVC and OOP already...
>>
Guys, can you, in short, tell me some things you would like to see or want from a web portal with news and reviews of multimedia, like video games, music and movies?

They are all quiet similar and I have no idea how would I survey potential users for that kind of websites.

Like, what is necessary for you to stay and use site like that? What news sites do you use?
>>
>>57824335
something specific and niche
if it's about video game + music + movies give up now
even video games is too broad
try doing a search for Super Nintendo rpg games
>>
>>57824575
Sorry, maybe I explained it wrongly. For uni I'm creating one portal, focus is on the UI design. It is just for a project. Although the focus is not on the UX, I guess I should have written about some potential users and made some survey, but since it's not a niche website everything is out there in terms of statistics and what not - it's just one more news portal. So i haven't made any survey before going to a design, although I got feedbacks during the process. I'd just like to read some more about your browsing habits, so I may possibly add some additional functionality.
>>
>>57824335

>web portal

I hate this term. The browser IS a portal. Web apps already ARE a portal. Just use the word app.

I like Metacritic...comparing professional reviews to the general population is interesting.
>>
>>57823401
bump
>>
>>57823652
>>>57823570
>front end frameworks like angular aren't focused on security anyways, so you shouldnt expect those things to carry over. You can use angular with both php or asp.net
Sure. I'm fine with that.
>>
Why is Angular so unnecessary complicated?
>>
>>57825383
Angular has always really been for """enterprise""" projects with several team members, extensive testing, lots of moving parts. For one person's demo todo app or whatever, yeah it's going to have way too much stuff, just use Vue or something.
>>
Working with PHP/SQL - So i have a loop that gets image URL's from the database and then echos them as HTML.

Now what i'm trying to do is add voting buttons under each image that when clicked, can increment a value in the database under that images ID.

What would be the code in the button and the PHP function and how will the button send the ID of the image on to the function?
>>
I'm kinda new to all this. I want to make small elements on my main page. I want each element to consist of a picture with accompanying text underneath it. How do I structure this?
>>
>>57825640
<div class="element>
<div class="imageContainer">
<img src="<path to image>"></img>
</div>
<p>Your text Here</p>
</div>
>>
>>57825598
there's a hundred ways to do this.
you could add the image id as data attribute to the button and using javascript post it back with an ajax request.
or make a form element for each image with it's id in a hidden field and a button that submits it, if you want to not use javascript.
>>
>>57825694
thanks anon, but how do I specify a specific height and width so that it is consistent across the page?
>>
>>57825733
add this to your head section

<style>
.element{
width: 300px;
}

.imageContainer{
height: 300px;
width: 300px;
}

.imageContainer img{
max-width: 100%;
max-height: 100%;
display: block;
}
</style>

also I missed a quote in the first line of my first reply after element
>>
>>57825773
Perfect, thanks. I feel like I'm starting to understand it better.
So if I wanted have these elements aligned with my navigation menu on the top, so that the end of the navigation, both to left and right, also marks the end of the content on the page, I would need to place all of that inside of a wrapper, right? As in: I can't manually assign that, just modifying the CSS of the .element.
>>
>>57825890
Yes if you want to align all the content to center on the page you need a wrapper

place all contents of the body between these two lines

<div id="wrapper">

<!-- code goes here -->

</div>

then add this code in the style section:

#wrapper{
width: 960px;
margin: 0 auto //Center on page with equal margins left and right
}
>>
>>57825971
forgot a semicolon after auto. Should look like this instead:

margin: 0 auto;
>>
>>57825971
Cheers anon! I appreciate it
>>
>>57825598


It depends on what you want to do this data (integer that represents votes). If you want to keep it, then store it in your DB. If you don't, just increment and display it through the front end with JS.

Also, never ask for "the code". Always ask about the process and end goal you're trying to accomplish. The "how" part was much better. You don't really learn or think through design patterns if people just give you the code.
>>
>>57826561
I'm trying to just increment the DB and show something visually to show the user that it worked (like a grayed out button)

So far I am handling the button click with Jquery and i'm learning how the ajax works and i'm getting the post ID from a parent.data() attribute. is this correct?
>>
>>57826679

If I understand you correctly, you DO want to store the number of votes in your DB. What you could do is have a form, hidden input that stores a unique image id, and a button for each picture. Then when submitted (or "voted" for) you can run a query that adds 1 to the vote count based on the images unique id. Better solutions might be out there...

Just HTML and PHP/SQL would suffice for this.
>>
>>57826826
the problem is that I don't want the page to refresh upon clicking the button so people suggested going the ajax route.

This is the work in progress code I have

 
$(document).ready(function() {

$('.voteButtons').click(function(){

var self = $(this); // cache $this
var action = self.data('action'); // grab action data up/down
var parent = self.parent(); // grab grand parent .item
var postid = parent.data('postid'); // grab post id from data-postid
var score = parent.data('score'); // grab score form data-score

$.ajax({
url: 'php/vote.php',
type:'POST',
data: {'postid' : postid, 'action' : action},
success: function(msg)
{
alert(action +' Vote Sent');
}
});
});
});



            <div class="col-sm-4" data-postid="$row[id]" data-score="$row[score]">

<a href="$fullURL" class="thumbnail">
<img src="$fullURL"><img>
</a>

<button class="voteButtons btn btn-success" id="btnUpvote" data-action="up">
<span class="glyphicon glyphicon-arrow-up"></span>
</button>

<button class="voteButtons btn btn-danger" id="btnDownvote" data-action="down">
<span class="glyphicon glyphicon-arrow-down"></span>
</button>


</div>
>>
>>57826877

I'm not familiar with AJAX yet. But the logic should still be the same pretty much...i could be wrong but i dont think you want it to submit to a vote.php page...you want it to stay on the same page right?
>>
>>57827060
I don't fully get ajax either

specifying vote.php in the ajax request wont make the page refresh
>>
Should I just use nodejs socket.io environment to program a messaging system through a database? Or should I go the ole php-server-client interaction route?
>>
>>57823676


If I say because of DOM XSS, will that be enough?

Because I see devs storing the stupidest stuff all to make for a slicker interface.
>>
>>57827188
.....what?
>>
>>57827342
I'm programming a server-client interaction website feature to allow users to send messages to one another sort of like facebook. Naturally, my web senses are telling me to just go the php route like I normally have, but my client insisted javascript.
>>
>>57827342
In addition, it's meant to be real-time, so needs to have a frontend instant update.
>>
>>57826877
Finally got the voting to work.
check it out here NSFW http://www.yogafap.com/gallery.php
>>
>>57827403
Do they messages have to be persistent? You could just use websockets to forward messages to clients and skip the database. Think irc
>>
>>57827505
Nice, but see if you can implement using sockets so you don't have to reload the page to view the vote update
>>
>>57827519
The messages have to be persistent, so it's going to be a mixture. At the moment, I guess I'm going to assume it's going to be a mixture of persistent and instant.

>instant if the person is there, so the message comes automatic, while being stored in a database
>if they are not, saved for when the user logins in the next time

I actually think it's just a normal message-save system like any other forum. The client didnt give a lot of info. So I may be thinking too much about this.
>>
>>57827383
Just have the clients communicate to the server with sockets. When a client sends a message, forward it to the recipient via websocket and insert it in the database. If a client was to reload the page, just load the previous chat from the database. ez pz
>>
>>57827628
Pretty much what I'm going to do.
>>
>>57808550
>admin_url
Brah, please make sure to escape URLs when outputting HTML with esc_url https://codex.wordpress.org/Function_Reference/esc_url
>>
>>57827520
no idea. where do i start
>>
>>57818234
It's better to understand prototype based inheritance before jumping into classes.
>>
>>57827750
Just make an ajax call and +-1 the vote count, or return the new value in the request.
>>
>>57820392
>value = '{$row['column']}'
Hello script injection
>>
>>57827777
Hey, long time no see.
>>
>>57827776

>and +-1 the vote count

you mean this right?


$.ajax({
url: 'php/vote.php',
type:'POST',
data: {'postid' : postid, 'action' : action},
success: function(msg)
{
alert(action +' Vote Sent');
}
});



so by "return the value in the request" you mean that i put a line that says

return $newScore


or something?
>>
>>57827818
In the success function you do something like $('span.score').html(newScore);
>>
>>57827854
okay I get that but i'm just confused on how it is going to return the new score value from database

More specifically how do I pass the new score variable from vote.php back to the ajax/jquery function?
>>
>>57827876
die(5);

You'll get the response in "msg"
>>
>>57827890
No, he needs a true debug script. In Vote.php, use unlink(__FILE__);
>>
>>57828017
for debugging vote.php i open the dom and go under network
>>
>>57827854
>$('span.score').html(newScore);
okay I got everything working well

the only problem now is selecting the specific sore span. At the moment that above code updates all spans on page
>>
>>57828017
and nice troll. didnt work on me
>>
>>57828250
NVM!! ITS WORKING!!

                $(document).ready(function() {

$('.voteButtons').click(function(){

var self = $(this); // cache $this
var action = self.data('action'); // grab action data up/down
var parent = self.parent(); // grab grand parent .item
var postid = parent.data('postid'); // grab post id from data-postid
var score = parent.data('score'); // grab score form data-score

$.ajax({
url: 'php/vote.php',
type:'POST',
data: {'postid' : postid, 'action' : action},
success: function(newScore)
{
self.siblings(".score").html(newScore);
}
});
});
});
>>
>>57828348
nice! this may be a big stretch, but see if you can have it re-rank the images on each vote instead of on refresh.
>>
File: bacon.png (417KB, 1900x961px) Image search: [Google]
bacon.png
417KB, 1900x961px
Does this webpage look ugly?
>>
>>57829124
http://getbootstrap.com/
>>
Why is azure so shit and un-userfriendly compared to google cloud? They literally tried to emulate windows in js and html and its laggy as fuck and confusing. Who thought it would be a good idea to do this
>>
>>57829124
>those w3c badge things

What is this, 1998?
>>
>>57829209
>getaidsautisticnigger.kys

>>57829124
looks like shit you have literally no custom styling
>>
>>57829124
Yes
>>
>>57820758
Well, I'll probably stick to ejs then.
I'm experienced enough to keep logic out of templates and don't need some handholding curly syntax for faggots between me and progress.
>>
File: Capture.png (11KB, 506x288px) Image search: [Google]
Capture.png
11KB, 506x288px
Why does w3schools say yolo kill me now
>>
>>57804996
>https://github.com/collinoswalt/Flakes.js
nice
>>
>tfw learning Redux and React
>tfw this is the most convoluted shit ever
>>
>>57829124
just get bootstrap
>>
>>57831887
don't worry it gets better.
started a react job a few weeks ago and I've come to like it, even started my own little project in my spare time.

the start was shit though. especially if you've never used ES2017 and webpack before
>>
>start a project
>get working on it.
>See how bad it looks like.
>want to quit.

Fuck you css.
>>
>>57820743
Try writing a modern SPA with more than a few pages with just using jQuery.
It's 2016, no one does that anymore pajeet
>>
>google for Wordpress code how to implement some function
>100 results are just pages who show you what plugin to install

Fucking kill me. Now I just want a singup link and form, why the fuck would I need a plugin for that?
>>
best php stack for window?
>>
>>57834085
ampss
>>
>>57833322
bootstrap
>>
Is thinking about suicide every day normal for this field or is it not for me? When I get up from a PC I feel like I escaped from eternal torture in hell.
>>
>>57824004
Thanks for the tips.

I already know MVC and OOP. I am trying now to fully understand the communication between model controller and the view (for example passing some variables between controller and the view).

I already know C++ and some Java , I won't get stuck on MS things.

My only problem is I don't know what they will ask for me to do in those 2 hours and I try to practice common things so I won't get stuck on a trivial thing for more than 30 minutes without having time to actually implement the requirements.

Sorry for late reply.
>>
File: 1415267655547.jpg (82KB, 680x827px) Image search: [Google]
1415267655547.jpg
82KB, 680x827px
>start working on project and happy learning something new
>suddenly waves of depression
>give up and start working on new project
is this normal in this field of work?
>>
I'm building a theme in wordpress and when I insert a picture in a post (through the wordpress interface) it shows up weird like this when its displayed on the page. Any ideas?
I have it aligned right in the post but the text is all weird. I haven't done anything weird with the css either. I'm using bootstrap but I don't see how that would mess with it
>>
>>57834436
Yes that sums of my personal web dev experience. I have like 6 failed websites and I am still making more
>>
>>57834085
Literally anything. As long as you promise to not use it as a dedicated web server
>>
>>57834663
Float the image to the left perhaps?
>>
sup lads.
I'm a manual QA tester who's starting to learn the basics of test automation. I've got a test task to develop a test for checking request sending with valid data. We use Selenium framework and Codeception, and I'm trying to wrap my mind around PhpStorm.

Anyone here has the experience with qa automation? I'm trying to find out how can I run my test locally from my PC once I'm done, but I've never used Jenkins or anything similar.
>>
>>57834436
>lurk moar
>>
How do I get rid of "0" which shows randomly right outside of the html tag? And what is the cause of that tag showing == $0?
>>
>>57835222
in chrome it means that your current selected element is accessible with $0
so you can just click an element and access it with $0 instead of having to retrieve it by id/class to use it in console.
>>
>>57835254
Oh, thanks. It's also outputting "0" under my image and I'm not sure how to get rid of it.
>>
>>57835297
post a screenshot and part of the code
>>
File: zero.jpg (325KB, 1000x700px) Image search: [Google]
zero.jpg
325KB, 1000x700px
>>57835308
Here.
>>
>>57835413
post more code from below, your 0 is after the last </div> but that's where your image ends.
>>
>>57835441

That's the end of the function. I realized I forgot one closing div tag, but that didn't solve the problem, though. It's weird because it didn't output it before when I had this code placed in my page template.
>>
>>57835413
>>57835465
can you check with view-source instead of the element inspector?
is the 0 there?
where does the function get called?
>>
>>57835465
I mean, I could always hide it with JS, but that would be shitty.
>>
dudes it's a function returning false (0)
>>
https://codex.wordpress.org/Function_Reference/wp_get_attachment_url

>Returns a full URI for an attachment file or false on failure.
>>
>>57835485
>>57835498
But it is not failing, you can see the image.

Basically, I have this in my functions.php.


add_action('wp_ajax_load_info', 'load_info');
add_action('wp_ajax_nopriv_load_info', 'load_info');

function load_info() {

$post_id = $_POST['post_id'];

//Call OMDb API

$filmID = get_post_meta($post_id, 'id_field', true);

//$film = str_replace(" ", "-", $film);
$response = file_get_contents('http://www.omdbapi.com/?i='.$filmID.'&plot=short&r=json');
$res = json_decode($response);

/*
echo '<pre>';
print_r($res);
echo '</pre>';
*/

function get_cast($response) {
$cast = $response;
//$actors = str_replace(' ', '', $actors);
$castList = explode(',', $cast);
foreach ($castList as $person) {
echo '<h4>'. $person .'</h4>';
}
}

// TOC

echo '<div class="toc"></div>';

// Movie Poster

echo '<div class="popular-post">';
echo '<div class="movie-poster">';
$imageid = get_post_meta($post_id, 'File Upload', true);
echo '<img src="';
echo wp_get_attachment_url( $imageid );
echo '" /></div></div>';

}



I'm calling it on a press of a button with AJAX. That "Movie poster" part of the code doesn't return "0" if I paste it directly in the HTML in my page template, though.
>>
>>57835533
show where you call the function and how you add the element to the DOM.
>>
>>57835542

/* Load film information in a sidebar */

$('.load_info').click(function() {
load_info();
});

function load_info() {

var that = $('.load_info');
var ajaxurl = that.data('url');
var postId = $('#post-id').html();

jQuery.ajax({

type:"POST",

url: ajaxurl,

data: {
action: "load_info",
post_id: postId
},

success: function(response) {

$('.sidebar-controls ul li a').css('color', '#fff');
$('.sidebar-controls ul li:nth-child(4) a').css('color', '#af8e65');

$('.sidebar').empty();

$('.sidebar').append(response);

}

});

}



And the link looks like this:


<li><a class="load_info" data-url="<?php echo esc_url( admin_url('admin-ajax.php') ); ?>">Info</a></li>

>>
I made a basic shitpost detector in python, and i'd like to make a web extension that put a little image next to the poster name depending on whether the post is shit.
I don't know shit about wed dev tho, so where could I start ? I know that web extension use Javascript so I used jiphy to convert my code into JS, but i'm quite lost after that.
>>
>>57835561
in chromes network tab, what's the response from the server?
what's the markup of .sidebar?
>>
>>57835585
200 OK.

I don't know why would markup of the sidebar matter if it works like it should if I put it directly.

But it is just an empty div with a class of "sidebar".
>>
>>57835623
not the response type, the actual response.
>>
File: header.jpg (307KB, 1068x963px) Image search: [Google]
header.jpg
307KB, 1068x963px
>>57835631
It returns this:


<div class="toc"></div><div class="popular-post"><div class="movie-poster"><img src="http://localhost/wordpress-4.4.2-hr/wordpress/wp-content/uploads/2016/11/ring_ver2.jpg" /></div></div>0



Header in pic related anyway
>>
>>57835652
put a breakpoint in admin-ajax.php and check where the 0 gets added.
>>
>>57835669
Wait, where is that? I don't quite get it where to put it.
>>
Should I use bootstrap or just say fuck it and write my own CSS?
>>
>>57835770
Depends how much you care and know about design I guess. Bootstrap is boring and generic and ugly, but CSS could make you want to jump out of a window sometimes.

(Coming from a guy who currently has 1800 lines of CSS for just a few similar pages.)
>>
>>57835818
Not to mention that it will take much longer than if you just used a bootstrap.
>>
>>57835669
>>57835585
>>57835542
>>57835498
>>57835485
>>57835475
>>57835441

Holy shit, I figured it out. WP needs "die();" at the end of functions called by AJAX. Forgot to add it here. Everything is fine now. Thanks anyway.
>>
Pewdiepie announced he's going to delete his channel at 50m subscribers so I made this:

http://goodbyepewdiepie.com/

warning: audio
>>
>>57835953
>http://goodbyepewdiepie.com/
Forgot to add: color gets closer to red as the number approaches zero. Green->yellow->red->black
>>
File: file.png (23KB, 473x107px) Image search: [Google]
file.png
23KB, 473x107px
might be a newbie question, but is it possible to connect to my site's MySQL using a db manager other than the given phpMyAdmin over the web? I need to migrate a large db to my web host and I would like to use something like MySQL Workbench to do it.

Enabled remote mysql and tried to connect using phpMyAdmin's hostname parameters, but doesn't work
>>
>>57835974
generally sql servers are not made public.
if it's your server then you need to forward the ports, make the server listen on all hosts and add any/your ip as allowed hostname to connect from to your user.
>>
>>57835974
databases are usually configured to only connect to localhost by default. Usually you don't want to change that unless you know what you're doing. Keep in mind that if you allow connections over WAN you can connect to it, but potentially so can anyone else, so take precautions.
>>
File: file.png (21KB, 511x215px) Image search: [Google]
file.png
21KB, 511x215px
>>57836001
>>57836045
It's not my server, but one that my web host offers. how can i upload my 10gig db to it using phpMyAdmin? it only allows 50mib imports
>>
>>57836158
ask your hosting company.
>>
>>57836186
i did, no reply. prob time to change web host?
>>
>>57835770
Bootstrap look is overused as fuck.
The time it takes to style it so it doesn't look like every other page could be spent on writing your own style.
Use flexbox for general layout and look into Sass (+ optionally post css) and its not nearly as bad as it used to be
>>
Where / with who do I host my web page? Requirements below:

I want to host a web page for a community with interests in anime. It is centered around file uploads, video and images.

Naturally, this means people will eventually upload porn or even illegal material, same as with 4chan, imgur or anyone that allows file uploads.

While I have a countermeasure for that, it's not enough. I also need to host the server or web page in a country or location that allows for potentially illegal material to be stored in wait for deletion.

Think exhentai, gelbooru etc. - these are sites which stores material I wouldn't want to be caught with. But it's inevitable that I will eventually come to store similar if not the same content due to the userbase.

What's stopping people from putting child porn, snuff or other horrible stuff in their avatars and whatnot? What's the legal concerns here?
>>
>>57836659
Legally, you've got the responsibility to make sure you moderate illegal content and ban users who post it.

If your site will be heavy in content (images, videos), I'd go for one with higher storage instead of one with faster speed. Vultr has a 100gb model for $5/month to start that I use to host a bunch of music.

It's not like the FBI kicks down Hiroshima's door every time someone posts cp on /b/, or threatens to shoot Hillary Clinton on /pol/. As long as there's no collusion from the moderators to encourage this activity and as long as the files are actually deleted (host isn't keeping it for his own private collection) you shouldn't have anything to worry about.
>>
File: 24994732.jpg (897KB, 3996x1329px) Image search: [Google]
24994732.jpg
897KB, 3996x1329px
I have to create an interactive website for uni and have really basic knowledge on coding so I would appreciate if I could get a little help.
Basically what I have to do is create a site where there's an image of a desk with a computer etc. and when you click different for example the computer it sends an email and stuff like that. I have made the desk and can animate it via blender to do different things but have no idea on how to apply it in a web page. I have been studying html and javascript but they don't really help me with what I am going for. So any suggestions on what should I learn to make this possible?

Thank you
>>
>>57836726
>Legally, you've got the responsibility to make sure you moderate illegal content and ban users who post it.
Well, I've prepared for and programmed in a few countermeasures that automate this, and the general workflow implies moderator involvement. That part is OK.

But, then we get to the culture of the anime-interested community. We all know what it's like. The userbase are interested in hentai and other forms of pornography involving anime. Could be porn magazines, could be written fan fiction, they eat this stuff up AND they are going to share/host it on this page.

In fact, the sharing/hosting is an integral part of the web site and a core feature. I'll have to read up on Vultrs terms of service.

>It's not like the FBI kicks down Hiroshima's door every time someone posts cp on /b/, or threatens to shoot Hillary Clinton on /pol

If I assume they do, and make preparations to avoid that, I'll be all the safer for it.
>>
>>57836942
Look up WebGL and Three.js in HTML5 canvas. You'll need to know javascript.


Here's something I googled about using blender models in webgl

http://blender.stackexchange.com/questions/408/how-can-i-use-my-blender-models-in-webgl

Don't bother asking me anything more because I don't know anything about blender or webgl, I just know that webgl is what you're looking for.
>>
>>57836962
Well, I know in the USA, Loli porn is legal, while in the UK/Australia (I believe), it isn't. So if that's the kind of stuff you're worried about, the good ol US of A is the place you want. However, if you want to host videos of 13 year old japanese girls prancing around in their underwear (not explicitly porn, but legally questionable nonetheless), you'd want a Japanese host.
>>
>>57837028
I'm thinking e.g cosplay videos / gifs may quickly enter that latter area. There's just no way to be sure with these people.

Maybe it'd be better if I could store everything on imgur and blame them.
>>
>>57836366
>>57836158
That's the PHP upload limit, increase that to 10GB and you can import it.

Better just do it from the command line.
>>
>>57837073
Do not use imgur as a cdn; they're not reliable and your files will be removed if they find out, or will be eventually deleted as imgur rotates things around. You can let users themselves upload to imgur (different story; like what reddit does), but then you're basically just a niche anime reddit clone.

But I can't imagine cosplay videos entering into a legal issue. Take these two examples:

1.) Japanese softcore porn company films young asian girl stripped down to her underwear doing cute shit and smiling (actual genre in Japan).

2.) 13 year old Japanese girl dressed as chun li at an anime convention posing suggestively.

They may seem similar in content, but in the second one, you couldn't reasonably lock someone up for looking at this person in public. However, in the former, the intention of the production of the video is obviously for pedophiles to get off to.

IANAL, but I dont think underage cosplayers dressing suggestively in public counts as a legal issue. In fact, nudity in itself is not considered child porn; sexual acts must be taken. a lot of child pornographers get away with publishing nude photos by calling their publications "nudist magazines", which fly under the radar because there's no sexual acts occurring, just people enjoying the sun in the nude.
>>
>>57835565
Please respond.
>>
>tfw you will have to remove a cool functionality because it fucks up multiple other things and you don't know how to work around it

Music for this feel?
>>
>>57836158
If you have access to the terminal, you need to set it in your php.ini file typically found in /etc/php/

Then you'll have like, nginx or apache or something and cli folders. Set the upload limit in the php.ini file to 10G or more and restart the server.
>>
File: 1478422927062.png (213KB, 900x955px) Image search: [Google]
1478422927062.png
213KB, 900x955px
>tfw you're too stupid to align shit on your site and use float and margin for everything
>>
>>57837211
use table tags like its 1999
>>
>>57837211
Learn flexbox.
>>
File: fedora_dog.jpg (11KB, 219x230px) Image search: [Google]
fedora_dog.jpg
11KB, 219x230px
Is Java a good language for web backend?
>>
>>57837174
A lot of good points, but the cosplayer example can be modified: such an image, produced by the cosplayer itself, with the intent to show off to others, others implicitly being pedophiles. Would that qualify?

Because these days, even in the good US of A, you can apparently get charged with possession of child pornography even if you were to report it.

What is considered child pornography or not varies greatly by country. Consider if just the actress/actor looks young, or the age can't be determined. As a non-US resident myself, I live in a country where e.g hentai is considered child porn, regardless of the persons depicted being thousand year old dragons in human bodies or not.

I don't actually want this stuff on my web host if possible, but it's an inevitable consequence of dealing with anime communities.

>>57837211
>>57837229
Why not css tables? What's wrong with css tables?
>>
>>57837477
no
>>
>>57837489
why?
>>
>>57837477
It's arguably THE language for web backend.
>>
Is a sugar daddy website legal?

Basically just a platform to meet sugar daddies.

Yes, been done before but very poorly.
>>
>>57839300
Might vary with local laws, but in general it's probably fine as long as you're using a similar monetization strategy to other dating sites. (ads, subscription, etc.) If you charge per "encounter" and there's an expectation that sex will occur, you're probably asking for trouble.
>>
why shouldn't I do:

<a href="/"><div>home</div></a>
>>
>>57839610
Because block elements aren't allowed inside inline elements. Use <span> with inline-block if you must.
>>
>>57839739
Why not though
>>
>>57839739
Why not? How would you, for example, make a whole card clickable then?
>>
>>57804361
>hackers
I must watch it again, damn good movie.
>>
>>57839739
Block elements are perfectly fine in inline elements, grandpa.
>>
Should you use "a" or "button" tags for custom javascript functionalities? Before I used buttons, but since I've seen on tutorials that "a" tags are usually use, I use them now. I have to add "event.preventDefault()" everytime, though. Button always seemed more logical to me. Is there some other impact on the app?
>>
>>57840466
I love it how much grammar and spelling errors I make on 4chins.
>>
>>57840466
your best case scenario is using an a tag with a meaningful href, so users can middle-mouse-click it and open it in a new window, even if it just flips open an element, you want it to be open on the new tab then.
>>
>>57840515
No, I meant functionalities like e.g. "show/hide". That's why I use e.preventDefault. Href doesn't matter afaik.
>>
>>57840630
it does, anon, and you do want to have your show/hide state in your url when opening in a new tab.
fuck you if you don't do this.
>>
>>57839927
I stand corrected, in HTML5 it's allowed. Good to know.
>>
>>57840640
I literally didn't know that faggot. Why "fuck you"? I have to google this shit now.
>>
>>57840640
Wait a second, again you are talking about opening it in a new tab. You CAN'T open anything in a new tab, what are you talking about? If you middle click the button it just works like you left-clicked it, it literally just does .toggle() with jQuery to show/hide a comment box.
>>
>>57840774
that's what you want to avoid.

Imagine having a list of 100 entries, each list can be toggled open to show information.
If I am now interested in 20 items I'd just scan the list and open the 20 I am interested in in a new tab.
Now the problem is, all tabs just load the same site instead showing the information I want.

What you want to do instead is have the state in that href, very simplified like #entry=5, so on page load you look for that query string and toggle and scroll to that entry.

This also helps when linking to information.
If you hide information behind toggles like this and I want to give someone a link to that information I also have to tell him where to click to show it. So a meaningful href solves all of this.

Here's a good example http://run.plnkr.co/exmwyxyPRIzQgoWn/
>>
>>57840925
Thanks for that.

I get it now that there would be problems. So basically, I already have all of that functionality, when I click on the comment, a new param in URL shows up and if I link it to someone, he will open it and the site will scroll to that comment. I have to figure out how to do that when the div with all the comments is hidden on a default, though.

I don't quite get the part where you say you would open a part of the list you are interested in in a new tab. I mean, all the comments load immediately and I just want to hide them on default. I don't have multiple buttons to toggle each list. It's a one list of comments. (using Wordpress).
>>
I need to get my Angular2 / TypeScript skills up, only have any reasonable ideas for example projects that arn't insane, but also not trivial?
>>
>>57835953
instead of fucking plowing your server with ajax requests, you could use the youtube javascript api to do this instead.

That way every client is pushing traffic to the youtube servers, instead of your servers.

Think about if you've got 100 people using your page. That's like 100 requests a second to ./checksubs.php

Wouldn't you rather those 100 requests a second go to the official google servers that are designed to handle that kind of load?
>>
>>57841212
Do something with an API of your choice.
>>
What's the best way to force a page-break at a particular row in a tbody?
>>
>>57835953
https://github.com/collinoswalt/modem/blob/master/modulate.c

Cool stuff bro.
Data Acquisition and Signal Modulation / Processing has always really captured my interest. There's something pretty cool about taking data and constructing different equations to convert them to signals, which you can then send through a circuit or whatever.

Brings back some fun memories of learning the principles of engineering with Labview
>>
I'm making my own little imageboard/blog to get the hang of web dev and flask.
However, I'm trying to check my form to make sure fields aren't empty. So I added a js function to my static folder in flask and called it onsubmit but it doesn't seem to be getting called at all when I submit.

What could cause this?
Thread posts: 301
Thread images: 20


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

If you need a post removed click on it's [Report] button and follow the instruction.
If you like this website please support us by donating with Bitcoin at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties. Posts and uploaded images are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that website. If you need information about a Poster - contact 4chan. This project is not affiliated in any way with 4chan.