Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=djjkxbox360;45029658]Just saying as I use PHP and had no [I]huge[/I] problems with it. I have to admit, I don't like the fact that it continues running when something goes wrong. There are a few languages where you don't have to specify type so just makes my life a bit simpler. I know there's a lot of complaints about being able to do mathematical operations with numbers in strings, but to me this makes sense in terms of web design, because if you want to add two numbers from text boxes, when you retrieve them from the text box they come out as a string, so it's nice to have PHP allow you to still do mathematical operations. I haven't come across a case where this has turned into a problem[/QUOTE]
I'll admit, I thought PHP was great until I tried Ruby and Node.js. Give one of those a try and see if you still think PHP doesn't have problems.
I have dabbled in PHP a couple of years ago for college, and I remember not really thinking too much of it but that was only basic stuff.
For me, I want to have skills that will be helpful for me to get into the industry as a proper job in 2-3 years when I finish my degree at university. And until then I have a ton of spare time to sit back, and learn some cool, hopefully relevant stuff.
I think for now I'll look at Node.js as I know my way around Javascript (as a programming language, not just front-end stuff). Plus quite a few job listings I look at are related to Node.js development, but there's also a ton of Ruby listings too so I'll be looking at that as a side in the future too see how I get one with it.
Are there any recommended books for learning Node.js/Ruby? I prefer to learn from physical things. E-books are fine also.
Cheers for the help anyway folks, I'm only wondering because although I like website development, I'm not enjoying design as much as I enjoy conventional programming.
[QUOTE=icemaz;45030381]I have dabbled in PHP a couple of years ago for college, and I remember not really thinking too much of it but that was only basic stuff.
For me, I want to have skills that will be helpful for me to get into the industry as a proper job in 2-3 years when I finish my degree at university. And until then I have a ton of spare time to sit back, and learn some cool, hopefully relevant stuff.
I think for now I'll look at Node.js as I know my way around Javascript (as a programming language, not just front-end stuff). Plus quite a few job listings I look at are related to Node.js development, but there's also a ton of Ruby listings too so I'll be looking at that as a side in the future too see how I get one with it.
Are there any recommended books for learning Node.js/Ruby? I prefer to learn from physical things. E-books are fine also.
Cheers for the help anyway folks, I'm only wondering because although I like website development, I'm not enjoying design as much as I enjoy conventional programming.[/QUOTE]
I learned from [URL="http://smashingnode.com/"]Smashing Node.js[/URL], but most of it is just getting your head around the asynchronous architecture. Once you've got that down, you can google your way through it (or read the book, because it's a good book).
I was thinking of making a tool for people to manage their FastDL. All they had to do was upload the tool to their FastDL host, access it, then let the script do all you need.
Basically, a script that checks your server using FTP (breadth first search, in case you're interested), queues the files that need to be synced, then as soon as that's done another script downloads the file, bzips it, moves it to the correct folder, deletes the original file from a temp folder, and continues.
This all with Ajax, getting the queue from MySQL.
Good or bad idea? I mean, ini_set('max_execution_time', 300) should make it possible to bzip even a large map. I understand that webservers are not meant to do this kind of work, but it could work for noobs that don't know what they're doing? Only disadvantage is that the user can not let it run in the background if they close their browser, as it's triggered by Ajax.
[QUOTE=Moofy;45029304]I know I am not saying that "oh we should all stick to this because new stuff is icky" - But might as well learn the most commonly used up front than picking up something like Ruby.
As far as I could tell he works front end for clients and wants to go backend, it's more likely to encounter a site that's using PHP and needs some fixing than a site using Ruby for example.[/QUOTE]
Ruby is a pretty well established choice for web development, not nearly as immature as Go or Node and certainly orders of magnitude above PHP.
How do you manage user interaction to your website/webapp via email?
What I mean is like how facebook allows/used to allow users to email a user specific email adress to ,for example, update their status.
I want to have a webservice that can generate a unique email address, or maybe just have one email address and then just check who sent the email against the registered users to sort them, in order to allow users to submit data to a web application
[QUOTE=Richy19;45062044]How do you manage user interaction to your website/webapp via email?
What I mean is like how facebook allows/used to allow users to email a user specific email adress to ,for example, update their status.
I want to have a webservice that can generate a unique email address, or maybe just have one email address and then just check who sent the email against the registered users to sort them, in order to allow users to submit data to a web application[/QUOTE]
I've used [url]https://postmarkapp.com/[/url] to handle incoming email before. I would really recommend finding a service to do something like this, running your own mail infrastructure is not fun.
i have an icon font rendering wrong in OSX:
[img]http://i.imgur.com/JPiJvzU.png[/img]
supposed to look like:
[img]http://i.imgur.com/Q9IOLZq.png[/img]
if I could mess with the CSS in real time it'd probablty be easier to fix, but i'm just using browsershots and can try a change every 30 minutes... so
[editline]10th June 2014[/editline]
i think it's an issue with the font
It looks like you just need to set a higher width/height on it on osx. It looks like it's being clipped to a rect with slightly rounded courners, not like the font itself is rendering funky.
[QUOTE=KmartSqrl;45062876]I've used [url]https://postmarkapp.com/[/url] to handle incoming email before. I would really recommend finding a service to do something like this, running your own mail infrastructure is not fun.[/QUOTE]
I really, really agree with this. Since about two years, I've been using Google Apps so I could have a personal email address at my domain name "pounc.es". I've recently looked into setting up my own mail infrastructure, but after seeing how complicated it is to set up, manage and secure all the components that you need for a service that even approximates GMail (minus the webmail stuff) in terms of functionality, I just dumped the idea.
When you look at them this way, email services and cars are pretty similar: It takes little training for someone to get really good at using those commodities. But the technology that powers them is incredibly complex, and without in-depth domain knowledge, the very same guy or gal would have no idea to assemble either of those things out of its components.
Does anyone have any idea about where I could get a hold of an API to query top box office movies in, preferably, Sweden?
I have an application to write regarding a possible job, and it states that I should use rottentomates.com, but looking at their website, they do not have a top box office for Swede, only US, UK, and AU.
[editline]11th June 2014[/editline]
And the fact that they seem to take forever to even send an activation email does not help.
[QUOTE=KmartSqrl;45072633]It looks like you just need to set a higher width/height on it on osx. It looks like it's being clipped to a rect with slightly rounded courners, not like the font itself is rendering funky.[/QUOTE]
that's what I thought, but it wasn't, pretty sure it's the font - I tried a bunch of things like setting width and height, overflow visible, line height
[QUOTE=Cyberuben;45052040]I was thinking of making a tool for people to manage their FastDL. All they had to do was upload the tool to their FastDL host, access it, then let the script do all you need.
Basically, a script that checks your server using FTP (breadth first search, in case you're interested), queues the files that need to be synced, then as soon as that's done another script downloads the file, bzips it, moves it to the correct folder, deletes the original file from a temp folder, and continues.
This all with Ajax, getting the queue from MySQL.
Good or bad idea? I mean, ini_set('max_execution_time', 300) should make it possible to bzip even a large map. I understand that webservers are not meant to do this kind of work, but it could work for noobs that don't know what they're doing? Only disadvantage is that the user can not let it run in the background if they close their browser, as it's triggered by Ajax.[/QUOTE]
Anyone?
[QUOTE=Cyberuben;45101807]Anyone?[/QUOTE]
It sounds like it could be far more efficient as a bash script.
[QUOTE=Cyberuben;45052040]I was thinking of making a tool for people to manage their FastDL. All they had to do was upload the tool to their FastDL host, access it, then let the script do all you need.
Basically, a script that checks your server using FTP (breadth first search, in case you're interested), queues the files that need to be synced, then as soon as that's done another script downloads the file, bzips it, moves it to the correct folder, deletes the original file from a temp folder, and continues.
This all with Ajax, getting the queue from MySQL.
Good or bad idea? I mean, ini_set('max_execution_time', 300) should make it possible to bzip even a large map. I understand that webservers are not meant to do this kind of work, but it could work for noobs that don't know what they're doing? Only disadvantage is that the user can not let it run in the background if they close their browser, as it's triggered by Ajax.[/QUOTE]
Write a shell script. This is not the kind of thing PHP was meant for.
Well, I can't understand this one.
I am trying to login to a japanese page to 'take for granted without asking' some content only available for logged-in users.
For this, I'm using cURL on php to send a POST request with the user and password to a secure page, [url]https://secure.nicovideo.jp/secure/login_form[/url] with post fields user_tel & password.
However, when I execute it, it doesn't return anything. After adding errno and error, I get back
[QUOTE]
56
SSL read: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac, errno 0[/QUOTE]
I've googled it, and it appears to be a bug. Other pages, though, say it's due to a lack of a field.
What should I do with this? Also, are there any other alternatives to send post requests in php?
[QUOTE=Coment;45105284]Well, I can't understand this one.
I am trying to login to a japanese page to 'take for granted without asking' some content only available for logged-in users.
For this, I'm using cURL on php to send a POST request with the user and password to a secure page, [url]https://secure.nicovideo.jp/secure/login_form[/url] with post fields user_tel & password.
However, when I execute it, it doesn't return anything. After adding errno and error, I get back
I've googled it, and it appears to be a bug. Other pages, though, say it's due to a lack of a field.
What should I do with this? Also, are there any other alternatives to send post requests in php?[/QUOTE]
According to the source it's mail_tel and not user_tel.
[QUOTE=Svenskunganka;45105345]According to the source it's mail_tel and not user_tel.[/QUOTE]
oh, yeah, I said that by memory, my fault. Doesn't change anything though.
[QUOTE=Coment;45105360]oh, yeah, I said that by memory, my fault. Doesn't change anything though.[/QUOTE]
What's your current cURL code?
Also, according to the error, it's obviously an SSL issue.
[QUOTE=Svenskunganka;45105371]What's your current cURL code?
Also, according to the error, it's obviously an SSL issue.[/QUOTE]
It's pretty normal IMO... Can't see anything wrong with it.
[code]
$ch = curl_init();
$timeout = 5;
$path = "L:/nicohack/NicoLogin.txt";
$path2 = fopen("L:/nicohack/fail.txt",'w');
curl_setopt($ch, CURLOPT_COOKIEJAR, $path);
curl_setopt($ch, CURLOPT_URL, $url);
if(isset($post)){
curl_setopt($ch, CURLOPT_POST, TRUE); // Use POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, $post); // Define POST data values
}
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false); // I trust you, onii-chan!
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false); // Do you trust me?
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_STDERR, $path2);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_COOKIEFILE, $path);
$data = curl_exec($ch);
var_dump(curl_getinfo($ch)) . '<br/>';
echo curl_errno($ch) . '<br/>';
echo curl_error($ch) . '<br/>';
curl_close($ch);
return $data;
[/code]
--
Also, I just thought about it... Could it be an issue that I'm doing this on wamp via localhost?
[QUOTE=Coment;45105400]It's pretty normal IMO... Can't see anything wrong with it.
[code]
$ch = curl_init();
$timeout = 5;
$path = "L:/nicohack/NicoLogin.txt";
$path2 = fopen("L:/nicohack/fail.txt",'w');
curl_setopt($ch, CURLOPT_COOKIEJAR, $path);
curl_setopt($ch, CURLOPT_URL, $url);
if(isset($post)){
curl_setopt($ch, CURLOPT_POST, TRUE); // Use POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, $post); // Define POST data values
}
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false); // I trust you, onii-chan!
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false); // Do you trust me?
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_STDERR, $path2);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_COOKIEFILE, $path);
$data = curl_exec($ch);
var_dump(curl_getinfo($ch)) . '<br/>';
echo curl_errno($ch) . '<br/>';
echo curl_error($ch) . '<br/>';
curl_close($ch);
return $data;
[/code]
--
Also, I just thought about it... Could it be an issue that I'm doing this on wamp via localhost?[/QUOTE]
Here's your cause probably: [url]http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/[/url]
[code]curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);[/code]
Well, it changed of error, so that's progress.
I did two things now:
-Downloaded the cert from the page and converted it to .pem using openssl somewhere on the Apache folder. Linked to it on the script, set the CURLOPT_SSL_ to true, and now I get this error:
[CODE]* About to connect() to secure.nicovideo.jp port 443 (#2)
* Trying 202.248.110.180...
* Connected to secure.nicovideo.jp (202.248.110.180) port 443 (#2)
* successfully set certificate verify locations:
* CAfile: L:/nicohack/niconico.pem
CApath: none
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 2
[/CODE]
-I also tried downloading this '[URL="http://curl.haxx.se/ca/cacert.pem"]master key[/URL]' of certs, which has a shitton of them. Of course, the one used by NicoNico isn't there. Yet, it went further than the other one! This time it... failed just like it did before I put any certificates. Ah welp.
[CODE]* About to connect() to secure.nicovideo.jp port 443 (#3)
* Trying 202.248.110.180...
* Connected to secure.nicovideo.jp (202.248.110.180) port 443 (#3)
* successfully set certificate verify locations:
* CAfile: L:/nicohack/cacert.pem
CApath: none
* SSL connection using AES128-SHA
* Server certificate:
* subject: 1.3.6.1.4.1.311.60.2.1.3=JP; serialNumber=0100-01-052628; businessCategory=V1.0, Clause 5.(b); C=JP; ST=Tokyo; L=Chuo-ku; O=DWANGO Co.,Ltd.; OU=cert01; CN=secure.nicovideo.jp
* start date: 2012-06-11 06:11:09 GMT
* expire date: 2014-06-30 14:59:00 GMT
* subjectAltName: secure.nicovideo.jp matched
* issuer: C=JP; O=Cybertrust Japan Co., Ltd.; CN=Cybertrust Japan EV CA G2
* SSL certificate verify ok.
> POST /secure/login_form HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)
Host: secure.nicovideo.jp
Accept: */*
Cookie: nicosid=<cookie that might or might not work, but just in case...>
Content-Length: 63
Content-Type: application/x-www-form-urlencoded
* upload completely sent off: 63 out of 63 bytes
* SSL read: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac, errno 0
* Closing connection 3
[/CODE]
I think we're on the right path, though.
[QUOTE=supersnail11;45103220]Write a shell script. This is not the kind of thing PHP was meant for.[/QUOTE]
But do you see the point? People are too stupid to run a batch script. Having a FastDL host at NFOServers doesn't let you run batch scripts. Having a gameserver doesn't allow you to run a batch script. SourceRSC is pretty much a batch script, but it's still slow and bad. I know PHP isn't meant for it, I'm asking if it will work.
Oh, I also want to know, there are plenty of GSPs that have a control panel where the remote console is some crappy HTML page that doesn't work on mobile phones and allows people with access to execute commands. I want to make a Node.JS server that listens on a specified port and accepts "logaddress_add <ip>". Once at the Node.JS server, I want to send this information to clients using websockets, including authentication. However, I'm not sure how I would do the authentication. It should be an open source platform, meaning, I publish the app as soon as I am finished. The app should have some sort of admin-login, and after the admin is logged in, he / she can add user accounts for people who are allowed to use the remote console. That way they can log in and view the remote console, without having access to execute commands, or without requiring to have an account at the GSP.
As an addition, I want to make it possible for people to implement the RCon on their own website. I want to achieve this by creating a plugin for major forum software platforms (etc), but also detailed documentation on how to create authentication.
The authentication should involve a "user-key" and a "secret-key". The secret key is generated, in whichever way, and as soon as the user connects to the websocket server, the websocket server will send a request to a specified URL (including the "user-key") and get the "secret-key" in return. If the "secret-key" matches the "secret-key" provided by the user, the user is authenticated. This way you can allow people to have access based on their usergroup on their forum, or their own implementation.
Any thoughts? Recommendations (which is the best WebSocket server I can use)?
[QUOTE=Cyberuben;45105878]But do you see the point? People are too stupid to run a batch script. Having a FastDL host at NFOServers doesn't let you run batch scripts. Having a gameserver doesn't allow you to run a batch script. SourceRSC is pretty much a batch script, but it's still slow and bad. I know PHP isn't meant for it, I'm asking if it will work.[/QUOTE]
You could make it work, but it wouldn't be fun. Why not have it run on their personal computer and have it bzip and upload everything from there?
[QUOTE=supersnail11;45106587]You could make it work, but it wouldn't be fun. Why not have it run on their personal computer and have it bzip and upload everything from there?[/QUOTE]
Because that is exactly what SourceRSC is and I have tried to help plenty of people with it and they simply are too stupid to use it, where as my script will have loads of error checking and all they have to enter is the FTP details and my system will (practically) do the rest.
[QUOTE=Cyberuben;45106616]Because that is exactly what SourceRSC is and I have tried to help plenty of people with it and they simply are too stupid to use it, where as my script will have loads of error checking and all they have to enter is the FTP details and my system will (practically) do the rest.[/QUOTE]
Then why don't you make a script that runs on their personal computer that has loads of error checking and all they have to enter is the FTP details?
[QUOTE=supersnail11;45106809]Then why don't you make a script that runs on their personal computer that has loads of error checking and all they have to enter is the FTP details?[/QUOTE]
Because people will have to download andupload all their files from home on FTP while webservers have a faster speed in general. Saves a lot of time.
Probably a real simple answer here, but I've had quite the headache finding a solution. I have a dedicated server with apache and all the trimmings, how do I setup different domains to go to different folders in var/www/?
Currently I'm using a separate host's panel to set an A Record to my server's IP. This works for a website stored directly in var/www/ but that's it.
Basically how do I set a purchased domain to folders in var/www/? I've only ever used a shared hosting control panel for this kind of thing.
[QUOTE=Cep.;45112718]Probably a real simple answer here, but I've had quite the headache finding a solution. I have a dedicated server with apache and all the trimmings, how do I setup different domains to go to different folders in var/www/?
Currently I'm using a separate host's panel to set an A Record to my server's IP. This works for a website stored directly in var/www/ but that's it.
Basically how do I set a purchased domain to folders in var/www/? I've only ever used a shared hosting control panel for this kind of thing.[/QUOTE]
I'm quite terrible at it myself. You can decide to instal webmin, a free panel like C-Panel and such (however, it lacks a proper user interface). What you need though is vhosts.
[QUOTE=Cep.;45112718]
Basically how do I set a purchased domain to folders in var/www/? I've only ever used a shared hosting control panel for this kind of thing.[/QUOTE]
I add something like this to my Apache configuration file in /etc/apache2 (or in a new, included config file):
[CODE]<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/example.com
</VirtualHost>[/CODE]
On Debian/Ubuntu you can just create a new file in /etc/apache2/sites-available and then use [url=http://man.he.net/man8/a2ensite]a2ensite[/url] to enable it. Works like a charm for me :)
[url=http://httpd.apache.org/docs/2.2/vhosts/]Here's the Apache documentation for VirtualHosts[/url] if you'd like to learn more.
Sorry, you need to Log In to post a reply to this thread.