Navigation: /b/ - Random [Archive] | Search | [Home]
RandomArchive logo

I know PHP, ask me anything.

The stories and information posted here are artistic works of fiction and falsehood.
Only a fool would take anything posted here as fact.

Thread replies: 249
Thread images: 19
File: php.png (349 KB, 650x433) Image search: [Google]
php.png
349 KB, 650x433
I know PHP, ask me anything.
>>
How much do you hate yourself?
>>
>>705144879
Have you learned any other language that isn't complete shit?
>>
>>705144879
Do you freelance?
>>
>>705144879
Is it a strongly typed language?
>>
I need a way to query a windows domain controller to get group the user is included in. The login is automaticaly done with ntlm but for querying the DC I need a ldap bind connection with user credential, that I don't have because I login wirh ntlm
>>
>>705145435
>implying php even knows what a type is
>>
>>705145303
Not OP but PHP is beautiful because it gives you access to a server right from your browser, and it's possibly the easiest language I've learned.
>>
>>705145518
Oh shit I can do that give me admin creds
>>
Is it as popular as it used to be? Will node overtake
>>
>>705145584
>access to a server right from your browser
Nigger that's called the internet
>>
>>705144879
What the fuck does this simbol:
->
means?
Use to see it between a variable and a string.
>>
>>705145723
Nigger I'm not talking JavaScript. I mean you can do a lot of cool shit with PHP. A lot of things can be automated in your browser instead of SSHing into your server.
>>
>go through university computer science course
>get taught java
>try to find a job
>apply to web programming jobs saying I write whatever they need with java applets
>get laughed at
>a few weeks later I find out that java applets aren't even used anymore, chrome doesn't even support them and firefox won't support it either before long
>find out that most of my knowledge is obsolete
>have debt from uni
>can't find a job
just kill me tbh.
>>
At all the edgy kids thinking their opinion is worth shit. For some reason when kids program, its turns them into whiteknight fedora wielding spergelords. Or literally a fuken fgt with some alpha complex. Its a proffesion like anything else with every language having thier pros and cons.
>>
>>705145635
User:op
Password:faggot
>>
>>705145747
>simbol
>Doesn't know '->'
You are a dirty retarded shitskin
>>
>>705145747
Not OP but anyway. I don't know all the terminology and I'm pretty bad and don't do shit professionally. But typically I use it if I'm calling a variable from another class. For example: $gayClass->myvar
>>
Node is far more superior. PHP is dying. The only people who use it are lazy fucks who don't want to switch from a dated language to a superior one.
>>
>>705145887
>taking a course to learn programming
>not learning on your own
>>
>>705145887
Did you go to ITT tech or something?
>>
File: right.jpg (205 KB, 1024x768) Image search: [Google]
right.jpg
205 KB, 1024x768
What is the fucking meaning of life, bitch?
>>
>>705145887
That's what happens when you go to community college. They teach you to be a shitty code monkey. Assuming you took the whole curriculum. If you only took one cs class, that won't do you dick moron.
>>
>>705145978
this is what I was thinking
>>
>>705145978
Node is not a programming language. Do you mean javascript is superior?
>>
>>705145903
If you see it as a profession then you should kill yourself immediately. Programming could be so much more, but it's faggots like you that hold people who actually enjoy it back.
>>
>>705146146
"Node isn't a programming language." Please kys
>>
>>705145870
Nearly every scripting language can do that...
Nice try freshman
>>
Why are SQL / script injections so prevalent? I used to code PHP and I could never understand why some coders seemed to find it so perplexing to know the difference between " and ', and to use htmlentities(), stripslashes() etc correctly to avoid potential issues. Over the last number of years, some absolutely huge corporations have been brought down by the SQL injection - something which as a kid I always assumed only happened on websites coded by teenagers because we didn't know our shit yet and were still learning.

What's up with that?
>>
>>705146256
Not who you're responding but it literally isn't a fucking programming language. It uses Chrome's V8 Javascript implementation.
>>
>>705146153
LOL, how do people who use it in a proffesional environment ie research/science hold back neck beards from having fun programming? You literally sound like a 10 year old who has no idea what cross disciplines with computers have done for research.
>>
>>705146256

Lol you are a fucking underage idiot.
>>
>>705146556
When you can do basically anything with it, I consider it a programming language you autist fuck.
>>
>>705146654
Because you treat it as a boring job and you're not advertising its true beauty to the world, meaning less people are interested in it.
>>
>>705146430
Because they learn from outdated tutorials and use raw SQL statements without considering prepared statements or safer alternatives like ORM which is the paradigm that dominates today (SQLAlchemy etc).
>>
>>705146768
And let me guess, Anaconda is a programming language? No. It's the organizational name used to distribute a programming language's operating environment.

>NodeJS
>JS
>Kys retard.
>>
>>705144879
Do you have super hacker powers? Are you a wizard?
>>
>>705146337
No, they really can't. Not as easily, anyway. What you're saying is like trying to reinvent the wheel.
>>
Do you want a job?
>>
what a shit language man
>>
>>705147007
Might not be as easy for you because you've only been exposed to shit php. Easy is relative. Nice try.
>>
>>705147004
More like Super getting hacked powers? Amirite?
>>
>>705144879
Why aren't you using a God-tier scripting language like powershell dicknose?
>>
>>705147173
So you're saying there should be a universal language dedicated to everything? Literally kill yourself.
>>
>>705146768
It's javascript
>>
>>705147314
>>705147314
What is CGI, or for that matter, WGSI?
>>
>all these webdev plebs in here
>>
>>705144879
I know PHP too LOL I'm not bragging
>>
>>705146791

This is a fair point, but even IF you're just using classic old-school SQL statements, the issue lies with sandboxing your forms correctly so that users cannot alter the query in the first place. And that lies in the simple task of separating user-entered content and code syntax through the proper use of code punctuation and security functions which sanitise user-entered content before it is processed.

Again, it just seems like such an absurdly simple concept that it astounds me how massive corporations and even governments can be completely butt-fucked because a successful, professional coder who probably charges tens of thousands of dollars for a project doesn't know to use htmlentities() before processing a textarea, for example.

I totally get that mistakes are made - we all make them. But do these people just not proofread their code at all to find such mistakes before going live?
>>
>>705147371

JavaScript in which you can run sever side or compile into a program.
>>
>>705147401
No idea.
>>
>>705145952
Thank you mate
>>
>>705145927
Kill yourself you virgin looser moron
>>
>>705147407
Now try to develop C web framework. Protip: it's interesting.
>>
>>705147314
You really are stupid aren't ya? Probably couldn't even program yourself out of a paper bag even in shitty php7?
>>
I'm learning Python at the moment in my computer science classes.
>>
>>705145747
It is for accesing object members, vars and methods.
>>
>>705146430
because the code was outsourced to pajeets in india
>>
>>705147659
Bitch please. I could do that in php3.0
>>
>>705144879
Using PHP by itself it's not viable. You need to combine it with HTML, JavaScript and specially use Node and JQuery
>>
File: 11.gif (49 KB, 1520x700) Image search: [Google]
11.gif
49 KB, 1520x700
I know HTML and CSS on a more than average level. how much harder would it be to learn PHP from here and should I even bother?

The only thing I know about PHP is I was told I would need to use it if I wanted to hand code a way for an email to be linked to a box on a website where somebody types a message. like a label style like this except it also has a space to leave a message and that would send to an email.
>>
>>705148019
YES, learn PHP
>>
>>705147921
I've reduced some bash scripts and C++ scripts that were 50+ lines down significantly by using PHP. It's easy, well developed, well maintained and fast. What's not to love?
>>
>>705147407
Link?
>>
>>705148019

Either wait for PHP7 to become more widely adopted, or go with Node or Python. Node has a wide following with express.js and it's generally more suited for aync. Python has Flask/Cherrypy etc...
>>
PHP has actually come a long way the last few years. 7 gets rid of a lot of garbage and inconsistencies
>>
>>705146768
You're right. I prefer Apache and nginx programming languages because you can do anything in them.
>>
File: 1473374387281.jpg (235 KB, 610x400) Image search: [Google]
1473374387281.jpg
235 KB, 610x400
what is the best way to go about completely securing your MySQL from being attacked? I mean 100% foolproof?
>>
>>705147284
I dont get it
>>
>>705145179
Underrated post.
>>
>>705144879
Why would you want to use php?

Also, webdev sucks.
>>
>>705149128
The same way you would with any other language or toolset, don't be an idiot. A language is only as good as you know it
>>
>>705144879
When are you going to start programming in a grown-ups language?
>>
>>705149128
>>705149128
>>705149128
ORM mostly. Good abstraction to seperate Model from view etc....

Depens on your attack surface too. What type of data are you collecting (JSON vs. CSV) and what other parts of your stack will interpret/handle the data (JQuery/Redis/etc).
>>
>>705149128
Uninstall MySQL and power off the server.
>>
>>705145887
So learn a framework like spring which is written in java or Django with Python you lazy faggot. I minored in computer science but learned a lot of shit on my own and got a job immediately after school. Computer science theory != real world application
>>
File: 1369176510784.jpg (9 KB, 305x399) Image search: [Google]
1369176510784.jpg
9 KB, 305x399
>>705148163
>bash scripts for a web server
>>
File: phpvsbash.jpg (91 KB, 892x549) Image search: [Google]
phpvsbash.jpg
91 KB, 892x549
>>705148163
And vice versa. Why use a different language when you can do it better in another?
>>
>>705149515
It wasn't for a webserver. Nor was the PHP I used.
>>
>>705146556
Faggot. It's an implementation of a language. JavaScript. Eat a bag of dicks rookie
>>
>>705149515
>cgi-bin
>>
>>705149515
I run bash scripts called from PHP for ocr and image processing.
>>
>>705147921
Why especially Node and jQuery?

jQuery is on it's way out and I can't imagine a need to combine Node with PHP unless you're trying to abstract some existing MySQL requests to create an API in node.
>>
>>705148019
Lol pick up learning Python for beginners. You need to learn a lot about logic. For loops all that shit which translates to all languages. Python imo is the easiest way to learn these concepts. Then try to pick up PHP. It's easy to learn if you stay focused and consistent. Pick projects to work on that interest you personally and use Google a lot and you'll be fine. Good luck m8
>>
>>705149128
Don't use PHP.

Seriously though there are a few things you have to do.

Sanitise everything. EVERYTHING. Even your own variables if they're going in a query.
Keep your configuration files, including anything used to connect to a database, outside of the publicly accessible web folder.
If you're using an open source or off the shelf package make sure there's NO version reporting on anything. Not in HTML comments, not in the CSS, not in the back end or front end, not in the footer, not in the meta tags or anywhere. Google Hacking known insecure versions is the fastest way to get your site volunteered to be part of a bot net.
Beware WYSIWYG editors.
Penetration test your site to shit. There are utilities to help you.
Make sure you're keeping up to date with PHP releases.
If you're using off the shelf or open source software then make sure you rename the management section.
Put a .htacess based password on ALL management system directories.
Make sure your CHMOD for files like .htaccess and others is set correctly and that it's not public.
Turn directory listing off so people can't easily discover files.
Don't name files obviously - backdoor.php is a suprisingly common developer auto-login script name that people often forget to remove before release.
Use sessions and cookies properly, protect against cookie stealing with unique ID's and tracking sessions vs granting permissions in database.
Sanitize everything. This is the single most important thing. MySQL injection is hilariously easy. mysqli_real_escape_string is your friend but not infallible. Use regex to replace characters that you KNOW should not be in input. A name will never have ;' DELETE FROM in it anywhere.

There's more, lots more, but since you're asking here for a "foolproof" security system I'm guessing your knowledge of the subject is 0. If it was higher you'd know that the best you can hope for is a system that more difficult than another so your site becomes a fruit not worth picking.
>>
>>705149727
"Node.js is an open-source, cross-platform JavaScript runtime environment"

Nah, I'm going to believe the consensus established by the nodejs devs themselves. They didnt even implement it. It's based libuv.

> FUCKING RETARD
>U
>C
>K
>I
>N
>G
>R
>E
>T [ KYS ]
>A
>R
>D
>>
>>705150036
JQuery is def. not on its way out. You can use JQuery on the server side to traverse DOM elements if you use something like the request library. Also it's Ajax wrapper provides better support than trying to roll your own.

It's also going to be generally more performant than something you can roll your own unless you sink a shit ton of time trying to re-implement all of JQuery's functionality.
>>
PHP sucks. Seriously.
>>
>>705146028
42
>>
>>705150549
No.
>>
>>705150607
In denial
>>
>>705150073
I have a backdoor on my server. I secured it by allowing access only when the client's useragent matches 40+ alphanumeric characters and only then will it prompt for a password. If there is no match I have a nice little do404(); function: http://pastebin%2ecom/byqn9yGZ
>>
>>705150067

thanks

I basically just want to get good enough to be able to add on some form of coding onto CSS and HTML because its limited unless you just want to make basic static websites.
>>
>>705150549
Must be user error or just hipster trend cancer
>>
>>705144879
Can I laugh at you?
>>
>>705149471
Thanks, I'm checking out Spring.
Honestly I was completely lost in the various technologies, you look at some programmer job postings and see dozens upon dozens of keywords of requirements I never heard about, starting with various javascript libraries and frameworks like node/angular/etc, a bunch of different build tools like maven/gradle/ant, for java you have spring, hibernate and what not, a bunch of different databases outside of the plain old SQL that I was taught like mongo, postgre, hadoop, db2 and so on.

It feels awfully hard starting out and knowing nothing, the only thing I really learned was a ton of generic coding in java, c, c++ and a bunch of others, and plain html and css.

I can write you any kind of desktop application you want, but no one cares about that anymore. 95% of the jobs are all about web development it seems.
>>
Basic logging script. Can you explain how this functions?
<?php
header ('Location: http://www.ninjacats.nuts');
$handle = fopen("log.txt", "a");
foreach($_POST as $variable => $value) {
fwrite($handle, $variable);
fwrite($handle, "=");
fwrite($handle, $value);
fwrite($handle, "\r\n");
}
fwrite($handle, "\r\n");
fclose($handle);
exit;
?>
>>
>>705150768

Well that's a shit way to do it.

This is how.
>Check origin IP, if not localhost 404
>ssh -D 8080
>change proxysettings on your browser or throw and easy proxychains to wrap
>then ask for standard password.
>use HTTPS
>>
>>705151020
I do all that when I'm at my PC. For remote access anywhere (specifically areas where I can't proxy or SSH) I have the useragent and password memorized.
>>
>>705150073
>Sanitise everything. EVERYTHING.
Is it enough if I just use prepared statements and pass raw POST parameters to bind_param?
Is mysqli_real_escape_string even needed if I use that?
>>
>>705150972
It writes post variables to log.txt and redirects to ninjacats.nuts after doing so. Also poorly done.
>>
>>705150549
Do you know a better alternative for PHP if your client prefers a good old classic LAMP stack instead of node.js?
>>
>>705151444
Thanks anon if you want to know anything about cisco ios routers I got you dog.
>>
>>705150439

I agree about AJAX, but native DOM traversal methods should always perform better than jQ, being it was designed to support multiple browsers. Outside of methods like find(), most of the things you would want to do with the DOM have well-supported native methods. I haven't used jQuery professionally for at least a year now.
>>
>>705146556
It's an interpreter for JavaScript that provides CLI functionality, just like Chrome & browsers are interpreters that provide DOM and browser functionality.
>>
>>705144879
<?php

$message = "wow I am special because I know php!";
echo $message;
?>

//php is fucking garbage.

public class JavaGetsYouPaid {
@Autowired
public JavaSpring isSoMuchBetter;

System.out.println(isSoMuchBetter.gitGudFaggot());

}

>Kill yourself op
>>
>>705151288
Fuck no, pass the raw post to a function(s) that will return a clean array of the post parameters/values
>>
>>705150073
I just delivered an android application to some faggot. It connects to the backend with PHP. He only paid like $500 so I didn't really give a fuck to write some proper security.
Here are some of the features:
-send password in POST without SSL
-server at least uses hash+salt (i was feeling generous and it only took 5 minutes)
-the only user identification is log in once, get session token, then app sends user email+session token with every request until he logs out
-absolutely no session hijacking or session replay protection
-API keys stored in application in a file called api_keys.xml
-I think I forgot to check in a place or two if the user actually has the right to perform an operation so if someone wants to post some shit on the server it ain't gonna be pretty

How does this make you feel?
>>
>>705150439
jQuery is on it's way out. It's old, most of the functionality it provides is builtin nowadays.

Also Node doesn't have "jQuery" you mong
>>
>>705151772
If your doing naive selection, sure, but something like selecting a particular class='' and then updating it with a call back to ajax afterwhich animating a slide in animation, well I'd leave that to JQuery.
>>
>>705151453
>implying the client should choose your stack for you
>>
>>705152015
The $message variable is redundant.
Let me fix it for you, seeing as your coding skills seem to be that of a 5 year old.

<?php
echo 'wow I am special because I know php!';
?>
>>
>>705152177
I said you can use it with request, you dipshit.

SImilar pattern to Python's requests+beautifulsoup
>>
>>705151453
Well if the client insists on it then PHP it is. MEAN stack is so much nicer though, but clearly it isn't worth converting everything over.
>>
>>705152015
> Doesn't know that modern PHP borrows heavily from java
>>
>>705152241
Well, 2/3rd of the jobs is some client with a static website wanting to add some dynamic content. PHP is always available, but asking the client to migrate to node is nonsense.
>>
>>705151288
Prepared statements should always be used. There's no fucking point worrying about escaping shit for db queries prepared statements makes that obsolete
>>
>>705145584
>access to a server right from your browser
that's the dumbest fucking thing I've read today
>>705145870
you're either trolling or a fucking idiot... literally every scripting language allows you to 'automate things from your browser'. PHP is a piece of shit, but it's the "de-facto" scripting language for apache and you're probably too retarded to configure anything else
>>
>>705152351
>>705152177

Also:
http://trends.builtwith.com/javascript/jQuery, How does it feel to talk out of your ass?
>>
>>705152288
<?php

while(true) echo 'look we got a pro php developer haha poo in loo 20 bucks an hour under the table top kek';

?>
>>
File: ht3.webm (2 MB, 800x600) Image search: [Google]
ht3.webm
2 MB, 800x600
>>705144879
>>
Serious question.
Why is even developing a website from scratch on say, node.js even a thing when you can do the same faster and cheaper with something like wordpress? And if you need some ecommerce site there's Magento and others.
>>
>>705152691
wordpress is grabage magento is garbage poo2loo
>>
>>705152691
Because wordpress was written by literal retards. Try standing up a wordpress site and having even 10,000 hits an hour and it will probably shit the bed.
>>
>>705145887
When you learn programming, it's not so much about the language you learn as the core skills required to code. Java is a C-like language, which means you should be able to fairly easily pick up C, C++, Objective C, C#, Javascript, Perl, and even PHP (though why the fuck you'd want to learn that one is beyond me). Try it - it's much easier to learn a SECOND programming language than a first.
>>
>>705152571
Considering most people stack Angular, React, Ember, etc with jQuery, of fucking course it'd still be statistically growing. That doesn't mean the amount of people that use jQuery as their core dynamics is large any more
>>
>>705152691
Garbage like WordPress gives PHP a bad rep, it's total garbage code under the hood and really weak security wise.
>>
>>705152691

Depends on the level of control or integration you need. Wordpress/Django/Ghost are all great boxed alternatives but they're limiting.

Want to use socketio with a redis pub/sub for some "live" part of your website? You better hope there's a plugin for that. Need to use a proprietary or little known API? Again, you'll have to work around the underlying CMS/blog.
>>
>>705152968
>PHP (though why the fuck you'd want to learn that one is beyond me)
Maybe I'm writing an android application with my java skillz and need 5 lines of backend code that connects it to a database. I don't know a simpler method than just using PHP that I learned in one day for that.
>>
Not OP but,

Noobs give PHP a bad rep. If they learnt how to deal with SQL injections and other basic security features, it wouldn't get such a hard time.

That said, Facebook's Hack implementation is beautiful
>>
>>705146430
sql injections possible when a developer writes his sql queries in the client code and sending it to the server. someone can modify it and send their own query to drop tables or do whatever the hell they want. thats why you dont put your queries in the client.
>>
>>705144879
Will you make a site for me if I pay you?
>>
>>705152968
I don't think someone who's done nothing but java development will be able to do much in most of those langauges. C isn't OO, you have to worry about memory management, pointers, etc. Javascript and PHP and Perl are waaaaay different too. So are the other two but to less of an extent.
>>
>>705152177
>node doesn't have jquery you mong
Search NPM before you talk out your ass
https://www.npmjs.com/package/jQuery
>>705152691
Is this a troll post? Why the fuck would I use a shitty framework when I could build from the ground up and have full control over MY project? Why the fuck would I use PHP when I could use node and get all the benefits that come with using Javascript?
>total garbage code under the hood and really weak security wise.
You just described PHP.
>I don't know a simpler method than just using PHP that I learned in one day for that.
Node is pretty simple...
>>
>>705153267
This guy gets it.
>>
>>705153318
just use squarespace
>>
>>705152550
Okay sure, then explain to me how you'd run an nmap scan from your server using your browser, better and faster than PHP using any other language (except node.js).
>>
>>705153481
>Why the fuck would I use a shitty framework when I could build from the ground up and have full control over MY project?
Because writing your own shit can take weeks, while you have server hosts with wordpress preinstalled. It's all about how fast can you deliver a project.
>>
>>705152189
Something like this?

var leftTit = document.querySelector('.left-tit');
leftTit.addEventListener('click', handleNipplePress);
function handleNipplePress(ev) {
someAjaxPromise.then(function() {
ev.target.classList.add('diamond-nipples');
});
}
>>
>>705153404
This is true, but knowledge of Java and programming principles gives you a huge head start. Although as you said transitioning to a procedural language would be more difficult.
>>705153654
>except node.js
why are you excluding arguably the best server-side language there is? and also, literally every scripting language can do that. like holy shit how are you this incompetent?
>>705153839
>writing your own shit can take weeks
yeah if you're shit
>>
>>705148019
do not learn php
>>
>>705154000
I think we found a script kiddy.
>>
>>705154000
>best server-side language
You can use node.js for your shitty blog, but serious developers use EJBs or JSP.
>>
>>705154000
node.js is pretty powerful, and just as robust as PHP. But, PHP is more reliable and quicker. Tell me how you'd do what I just asked in C++, no need for code, just a basic outline of what you'd need to do. If you can.
>>
>>705154216
Spring dude, use spring
>>
>>705154216

>serious developers use ASP
>>
>>705154237
>node.js is pretty powerful, and just as robust as PHP. But, PHP is more reliable and quick

ur retarded cunt stay in school
>>
>>705149471
Can confirm, although Python is best used for automation and devops. I have used and built web apps with Django/Flask but they're so cost inefficient.
>>
>>705150894
learn javascript for that
>>
>>705144879
If you you know PHP then why is that coding in C#?
>>
>>705154402
>confusing java JSP and ASP.net
>>
>>705154237

comparing apples to oranges really but i'll byte

>download c++ library for sockets/web server, many exist
>run dat shit on port 80
>detect connection or specific route depending on if you choose to use dirty sockets or some robust lib
>run nmap
>???
>profit

you do realise the php interpreter is written on c/c++ right? so c++ is fully capable of doing what you describe

you faggot.
>>
>>705154433
Can't even give me a basic outline of what I asked for? Oh, I didn't expect that. I thought you'd whip out your 1337 hax and but us incompetent plebs to shame!
>>
>>705154530

i know they are different you faggot, but saying thats what serious developers use you may aswell say serious developers use ASP

we're not in the 90's anymore lad
>>
>>705154529
it isn't
>>
>>705154554

see

>>705154540
>>
>>705154540
Indeed I did. But I wasn't disagreeing with you. I was saying you're reinventing the wheel. Why do all that when you can write 1-3 lines of PHP? Also, I asked for faster and better. That isn't faster, nor better.
>>
>>705154827

it isnt faster? so you think running php's interpreter is quicker than running c++ directly?

its simple enough to download a web server library or listen for socket connections, if you dont find it easy then you're just incompetent and should stick to php.

>better is subjective, define "better"
>>
>>705154088
No fucking kidding.
>>705154237
...C plus fucking plus? Why the fuck are you comparing PHP, a ~scripting language~, to C++, a ~general-purpose programming language~? That makes no goddamn sense. C++ can of course be used for writing servers, but it's most certainly not the best tool for the job. And can we also address
>But, PHP is more reliable and quicker.
Because no, no it fucking is not.
>>705154216
It's all about the right tool for the right job. If you're building enterprise level shit then use these things, but if you want to develop for the rapidly expanding web-app market then node.js is superior.
>>
>>705154827

and hardly reinventing the wheel when you gave a specific scenario to use, personally to do this i'd run nodejs to do this, would take be about 5 minutes to setup but apparently i can't mention that
>>
>>705154827
because php is a fucking garbage language. Also less lines don't mean it's faster you retard.
>>
>>705144879
Whats my PHP address?
>>
>>705155008
Faster to build m8

<?php
exec('nmap ' . $_SERVER['REMOTE_ADDR']);
?>

>>705155076
>Why the fuck are you comparing PHP, a ~scripting language~, to C++, a ~general-purpose programming language~?
This is my point exactly you autist.
>>
>>705154827
FASTER DOES NOT MEAN LESS CODE, JESUS FUCKING CHRIST. C++ is a compiled language... it would run circles around the interpreted PHP. You seriously must be trolling.
>>
>>705155241

but you havent factored in the setup of a web server/apache
>>
>>705144879
does popcorn kill snails?

https://www.youtube.com/watch?v=HDKLvRHkGLo
>>
>>705155268
calm down he is a college junior who just learned some php and he is excited about it and wants to talk like one of the big boy programmers
>>
>>705155205
see >>705155241
and >>705149516

>>705155307
Literally a 30 second process.
>>
>>705155241
>>705155241

hell if you really wanna be a faggot...

ssh into your server over the internets, run nmap - more secure but thats too hackerman for you ey
>>
>>705155268
Php7 and hhvm are damn near at native speed
>>
>>705154827
>arguing about what's faster when you want to shell out to run an external program
wtf

>>705155241
Bash also works just fine for this. You are forgetting about the Apache server sitting in front of your php interpreter. Apache is the one actually doing the work here

>#!/bin/bash
>nmap </dev/stdin
>>
>>705155446
>>705155446

once again, comparing apples to oranges. its like me saying its quicker to develop a game in rpg maker it doesnt make it a better game or an amazing tool to use

fact of the matter is php is dead and has been for a while, the only jobs you'll get is developing shitty wordpress plugins/themes or working with indian code monkeys who are 10 years behind in technology
>>
>>705155446
sudo apt-get install apache
sudo apt-get install php-5
sudo apt-get install mysql

dude that is a lot of work I usually charge people 200 dollars to do this
>>
>>705154652
yup ;). ive made countless games in c#
>>
>>705155580

>script
>compiled assembly

hm gee i wonder which is faster to matter what
>>
>>705155706
c# doesn't use $this
>>
>>705155706

and havent released one because they all suck
>>
>>705155702
>apt-get
>not using bestOS
>>
>>705155268
see >>705155241

>>705155455
It was an example you autistic sack of wank. Build this faster in C++ http://pastebin%2ecom/byqn9yGZ
By faster I mean code it faster. Type it up faster. Fucking idiot.

>>705155675
Once again, that's what I'm saying. Why build a project using C++ when you can build it quicker in PHP? And PHP isn't dead. Do your research.
>>
>>705155986
>imblying debian ins't best server
>>
>>705145723

>>705152550


He meant database queries, I think.
>>
PHP is worse then .NET. Hell it may even be worse then JSP.
>>
>>705155706
>not making games in Go
>;)
>>
>>705144879
Do you know PHP?
>>
>>705156094
Sry brev, AIX > any Linux shitware
>>
>>705155675
I make $120k a year building back end systems using PHP/Symfony. You're just another hipster retard that has no clue what the fuck you're talking about.
>>
>>705156311
>Go
>the language that won't compile if you name a variable and don't use it
you masochist.
>>
>>705156403
You make $120k writing because you maintain and develop for a legacy system. That doesn't make PHP good. People make $150k writing COBOL, doesn't make COBOL any more than a worthless piece of shit that needs to be maintained.
>>
>>705156311
>not just typing in the 1s and 0s yourself
>;)
>>
>>705155706
That is not C# you retard, C# doesn't use $dollarSignVariables.
>>705156007
Once again you're creating the false dichotomy of C++ and PHP. Why are you excluding python, node, perl,...?
And what the fuck is your example code even doing? Why use sockets when file_get_contents would be easier?
>>705156403
>I make 120k/year
that's proof that PHP is dying... fewer PHP devs = more $$$, supply and demand
>>
>>705156734
>PHP
>Symfony
>legacy system
wot
wot
>>
>>705156878
>not using butterflies
>;)
>>
>>705156734
Once again retard, I said build, not maintain. I don't dick around in legacy systems. Backends that handle large healthcare edi and hl7 transactions
>>
>>705145584
>access to a server right from your browser
when will we be able to inject memes directly into our brains?
>>
>>705156969
I mean I would give you the benefit of the doubt that you added symfony on later to help the environment. If your team actually decided php and symphony was the best idea for a modern program, I am sorry. It's okay though I write web apps in apache wicket which is old garbage I am good at it and we already have a million lines of code written in it.
>>
>>705157119
How does a post on PHP live so long on /b
>>
>>705153654
>nmap scan in browser using php or nodejs
you literally have know idea what you're talking about and yet are still trying to argue, I admire your perseverance.
>>
>>705157390
lots of faggot programmers on here
>>
>>705145584
A retard leading a PHP thread? Who would have thunk it.
>>
>>705156007
>>705156007

you never said build it quicker you said "hurr faster". there are things in c++ that would take forever or are impossible to do in php. you're clearly a faggot with no understanding of programming whatsoever
>>
>>705157425
doesn't nmap scan your ports and shit?
>>
>>705153922
You forgot to also animate and pull from ajax. Thank god JQuery hoists.
>>
>>705156909
Build it quicker in any language you want. I'll wait. < 30 lines of code shouldn't take long at all.

>Why use sockets when file_get_contents would be easier?
Now I'm convinced this is bait.

>>705157425
Was an example. It was the first thing that came to mind. Take the fake 404 page instead.

>>705157475
I agree. PHP isn't a be all, end all language. It's multipurpose, sure, but it can't do everything. Like I've said for the 4th or 5th time now, using the language that does the job easiest is always the best approach. Why over complicate things?
>>
File: B85bAHcCUAEL5KT.jpg (23 KB, 590x295) Image search: [Google]
B85bAHcCUAEL5KT.jpg
23 KB, 590x295
>>705157777
php is shit here is the creator of php saying php is shit
>>
>>705152691
>>705153107
this is the answer, thanks anon for typing this out though i would't really group django with the cms's, it's only as limited as rails i guess
>>
>>705145887
i'm sorry bro but i would have laughed my ass of if this happened, at least you have skills that can easily be applied elsewhere
>>
>>705157955
>>705158023
That adequately describes PHP. I'm not disagreeing with you, I'm just saying it's easier to do. And I love simplicity for simple things and complexity for complex things. Otherwise it becomes tedious.
>>
File: 653488.png (31 KB, 700x700) Image search: [Google]
653488.png
31 KB, 700x700
>>705158382
>php
>>
>>705158480
>Me
>>
>>705158631
>(You)
>>
>>705158671
Nigger
>>
>>705157560
yep, most intrusion detection programs will ban you instantly if they notice an IP doing it though... it's also pretty popular to write your own scanning scripts in python btw, great way to get started. there's a book called black hat python if your interested
>>
>>705145887
if you havent leaned at least 3 very different programming languages, you havent learned programming
>>
>>705159221
dude like, if you haven't be writing haskell for 2 years you aren't a real programmer
>>
File: banned.png (73 KB, 1128x817) Image search: [Google]
banned.png
73 KB, 1128x817
>>705159511
i had not have suicidial thoughts for years before that. then came haskell, then came PHP.

i still wouldnt describe myself mentally stable as of today.
>>
>>705159511
I had 1 semester of Haskell. It was a nice eye opener, but not something I would choose to work with.
>>
>>705159840
why the fuck does your school teach haskell
>>
>>705159917
So you get a taste of some unique languages. Was also taught Eiffel and Ada.
It was only 2 hours a week for a single semester, so not much of a time waster, but for example thanks to Haskell I intuitively know how to use lambdas in other programming languages that support it.
>>
is html good for a beginner?
>>
>>705159917
My school (Edinburgh) also teaches haskell, the purpose being to teach a language nobody will know so they don't need to make you un-learn bad habits. At least that's what my prof told me when I asked.
>>705161094
HTML is not a programming language, but if you combine it with CSS and JS (+node), you have a very solid foundation for writing (cross-platform by nature) web apps. And it is indeed one of the easiest things you can learn.
>>
>>705161094
it is not programming language
>>
File: 1463414852489.gif (2 MB, 320x240) Image search: [Google]
1463414852489.gif
2 MB, 320x240
>>705145179
>>
>>705144879
did you take that pic yourself? what text editor is that?
>>
>>705161297
thanks
>>
>>705145887
>Comp Sci degree
>knows one language
Nigger, this is bait, right? I was fluent in Java, HTML, PHP, and dabbling in Objective C by sophomore year of high school.
>>
>>705145907
I realy enjoy the many ways /b insinuates teh gay
>>
>>705161792
I only really did the homework assignments
>>
>>705161525
If I had to guess, and if it even supports PHP, I would say Atom.
>>
File: order-clean.png (49 KB, 865x1747) Image search: [Google]
order-clean.png
49 KB, 865x1747
>>705145583
>>705145435
>>
>>705146783
How filled with cum is your anus everynight?
>>
Dear Op,

How does one deal with null byte injections?

Yours faithfully,

Anon
>>
>>705144879
Why trix is only for kids?
>>
What os do you use for local development?
>>
File: RhkQi.jpg (191 KB, 1437x2172) Image search: [Google]
RhkQi.jpg
191 KB, 1437x2172
I am a little more than moderately knowledgeable when it comes to HTML, CSS, and Visual Basic. I have messed around with PHP and MySQL. Which I seem to keep running into problems with. I get frustrated and end up leaving it after spending weeks on it. I'd like to think I have a good understanding of logic but PHP is kind of shitty.
>>
>>705163258
I would make it to where the user cannot submit with a blank text box. Disabling the button until the text field has a certain amount of characters is one way to go about it. Or just not have a button at all until the textbox is full of a specific amount of alpha and numeric characters.
>>
File: t2kc14.gif (2 MB, 390x220) Image search: [Google]
t2kc14.gif
2 MB, 390x220
>>705145887
This is a perfect example of how the government and justice system FUCKS you. They fill your head with the idea that you will get a great job with great pay so paying back your student loans will be actually doable but they dont teach you what you really need to learn, nor do they at least try to let you know that you should really look into what really will be useful. You end up not being able to get a job and thus go into debt with them and years later when you're 40-60 they will arrest you for non payment.
>>
>>705165233
What if i just fake the request and send the post data with a null byte injection instead?

In bash that could be one line:

curl -X POST -d [my null byte injection data] www.example.com/your/endpoint
>>
>>705165233
Also I don't think you understand the issue with a null byte injection.

Basically c sees null bytes as an "end of string" char, this mean that when php calls c based functions like preg_replace() a null byte injection can be used to skip part of your validation which means at any point in time any var you take into your system could skip your validation.

Scary shit /b/ro
>>
>>705166336
Good idea actually. If it detects certain keywords which are signs of someone trying to inject, then redirect them elsewhere. Then as well, post the keywords they were trying to use to send as an email or something to you so you can keep track of what they are doing. Also, grab their IP and post it to you and then block that IP from your domain.
>>
>>705162247
or sublime
>>
>>705167048
ATOM, SUBLIME, AND BRACKETS ARE SHIT
>>
>>
>>70516>>705166912
That's not what i said but sure if it makes you happy.

I would also suggest that if you're using preg_replace or any replacement validation you just stop right now and go and remove it.

If you're stripping chars from input because they're illegal in your arguments, then just stop there, don't keep trying to remove letters from a numerical order id, just stop the process there, if somebody is trying to inject something into your system that shouldnt be then they can go fuck themselfs, and if you're working with a team then they should conform to a standard and not just remove the fucking letters from an order is.

Just noticed something some people do alot
>>
>>705167649
GO CUT URSELF EMO
>>
>>705167570
Care to explain why? What editor or IDE do you use?
>>
>>705167821
They don't let me have sharp objects any more, only abstract object...
>>
>>705164962
this site has been around for quite a while
http://phpsadness.com/
tl;dr PHP is shit

the basic story of PHP is that someone released his
>Personal HomePage tools
and he named the function so they would get into equally sized bucket in a hash called "function length"
fucking kek
>>
>>705147489
> JavaScript
> compile into a program
> compile

Ha fuck you faggot. Learn a real language you underage piece of shit.
Thread replies: 249
Thread images: 19


Navigation: /b/ - Random [Archive] | Search | [Home]
Navigation: /b/ - Random [Archive] | Search | [Home]


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site. This means that RandomArchive shows their content, archived. If you need information for a Poster - contact them.