Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=andypopz;45865458]I have been learning PHP,Python and JavaScript on Codeacademy, and really would like suggestions for a good framework to start experimenting with. One of my friends recommended CakePHP and Django, but if there are better or easier frameworks to get started with I would love to hear about them. Thanks![/QUOTE]
In these times, more and more applications are leaning towards Javascript. Not only is it great because it's being run client-side, but that it's [URL="http://en.wikipedia.org/wiki/Asynchronous_I/O"]asynchronous[/URL].
Nowadays you let social medias such as Google+ and Facebook authenticate a user, which means that you don't neccessarily need alot of back-end code to write an application, which is why AngularJS and Javascript in general has become more and more frequent on the web. And for those who love the Javascript syntax and its functionality, there's always NodeJS, which works really well with the major Javascript front-end libraries.
Summing up, my advice would be to start developing something using Javascript and jQuery, then moving along to AngularJS and perhaps NodeJS aswell, as I think that will benefit you the most in the end. Alot of companies are looking for Angular and Node developers aswell, so you have a market that's not saturated yet.
I am employed as a PHP Developer, however my first assignment was to make an online store in Javascript/jQuery that fetches JSON data from an API. And at this moment, my co-worker's moving me towards AngularJS and NodeJS. So don't make my mistake and go through the trouble of learning PHP. Sure it's a great start, but once you're in the market, you're gonna notice that knowing PHP isn't as appreciated as knowing Javascript.
Don't take me wrong though, I don't regret learning PHP, but if I could reverse the time, I would put alot more effort into Javascript than I did into PHP.
I just deleted my centos home partition, extended my root partition to cover it entirely and restarted, did I fuck up, it feels like I did.
Did you back up the data in your home partition in a way that preserves file permissions/ownership/symlinks?
How does data collection from forms work on websites?
I'm going to be putting a few forms on a website to collect information, but I'm not sure whether I should save it to an existing database or save it in a text file. I'm currently working on the form page now, but I have no experience doing the back-end stuff with this. Also, if I do not currently have access to the database, how can I make it easy for an admin to review the forms submitted by users?
[QUOTE=DerpHurr;45876180]How does data collection from forms work on websites?
I'm going to be putting a few forms on a website to collect information, but I'm not sure whether I should save it to an existing database or save it in a text file. I'm currently working on the form page now, but I have no experience doing the back-end stuff with this. Also, if I do not currently have access to the database, how can I make it easy for an admin to review the forms submitted by users?[/QUOTE]
There are two ways if you're using PHP, direct POST/GET or AJAX (Javascripts sends POST/GET in the background). If you have a form with sensitive data, I suggest using POST, as the GET parameter is shown in the URL. Most forms are POST data.
Let's take this page for example. The URL here contains [B]showthread.php?t=1250244&p=45876180[/B] where [B]showthread.php[/B] is the PHP file where the PHP code is, [B]?[/B] is the file delimiter from the params and [B]&[/B] is the param delimiter. In the [B]showthread.php[/B] file, you can access these GET parameters with this:
[CODE]
$t = $_GET['t']; // Output: 1250244
$p = $_GET['p']; // Output: 45876180
[/CODE]
So the URL is split into: t=1250244 p=45876180
If you were to have a path with: paramname=paramvalue you would be able to get that with:
[CODE]
$var = $_GET['paramname']; // Output: paramvalue
[/CODE]
With POST however, you don't see the parameters in the URL like you do with GET. But if you have a form like this:
[CODE]
<form action="showthread.php" method="POST">
<input type="text" name="paramname">
<input type="submit">
</form>
[/CODE]
(Note the action="showthread.php", method="POST" and name="paramname")
you can get the text input in the showthread.php file with almost identical code:
[CODE]
$text = $_POST['paramname']; // As stated, note the name="paramname" attribute in the text input
[/CODE]
Wow, you're really good at explaining things! I understand it anyway but to someone who doesn't, this would be clear as crystal.
[QUOTE=Svenskunganka;45878785]There are two ways if you're using PHP, direct POST/GET or AJAX (Javascripts sends POST/GET in the background). If you have a form with sensitive data, I suggest using POST, as the GET parameter is shown in the URL. Most forms are POST data.
Let's take this page for example. The URL here contains [B]showthread.php?t=1250244&p=45876180[/B] where [B]showthread.php[/B] is the PHP file where the PHP code is, [B]?[/B] is the file delimiter from the params and [B]&[/B] is the param delimiter. In the [B]showthread.php[/B] file, you can access these GET parameters with this:
[CODE]
$t = $_GET['t']; // Output: 1250244
$p = $_GET['p']; // Output: 45876180
[/CODE]
So the URL is split into: t=1250244 p=45876180
If you were to have a path with: paramname=paramvalue you would be able to get that with:
[CODE]
$var = $_GET['paramname']; // Output: paramvalue
[/CODE]
With POST however, you don't see the parameters in the URL like you do with GET. But if you have a form like this:
[CODE]
<form action="showthread.php" method="POST">
<input type="text" name="paramname">
<input type="submit">
</form>
[/CODE]
(Note the action="showthread.php", method="POST" and name="paramname")
you can get the text input in the showthread.php file with almost identical code:
[CODE]
$text = $_POST['paramname']; // As stated, note the name="paramname" attribute in the text input
[/CODE][/QUOTE]
So in the final screenshot, that code would retrieve whatever the user entered into a text page and store it in the text variable? That is more simple than I thought it would be (if I understood it correctly). I was reading earlier and it said that 'POST' was the safer method to retrieving data (as you said, it is used for sensitive data and it doesn't show in the url). I'm kind of confused on how this is implemented in an HTML file. I know we can write PHP code within an HTML file, and we denote a form by using the tag:
<form action="somefile.php" method="post">
</form>
Within the form, there would be a variety of text boxes/other things that gather information. So to get this information, we use post and reference the ID that we set for each input type, and we can store it in variables. I guess I'm trying to get a bunch of information such as name, email, identification number, etc. If I'm understanding it correctly, we would then use the information submitted by the user from the web form by getting it using the post method, and storing it. Then I suppose it really depends on what we want to do with that information inside the variables. I'm trying to make it so it outputs into a textfile/excel in a neat format, while renaming the file based on the ID.
I guess I can't really do any of this yet because I don't know if I need some database stuff or anything.
Also as always Sven, thanks for coming to the rescue.
[editline]3rd September 2014[/editline]
Huh, gonna have to install PHP first to actually test this stuff.
[QUOTE=DerpHurr;45881917] stuff [/QUOTE]
Here's a typical setup for something very simple: [url]http://codepad.org/Fw3LXGCJ[/url]
This is [B]not[/B] good for form validation since I just die().
Everything that's something() is a PHP function, so for example you see I use empty() - easy way to find instructions on what this does is go to php.net/function-name
[URL="http://php.net/empty"]php.net/empty[/URL]
You can just install something local, try MAMP, XAMPP, WAMP or whatever you prefer.
I know Sven likes to use Vagrant, that's however a bit more complicated. Just Google a bit around.
[QUOTE=Moofy;45887393]Here's a typical setup for something very simple: [url]http://codepad.org/Fw3LXGCJ[/url]
This is [B]not[/B] good for form validation since I just die().
Everything that's something() is a PHP function, so for example you see I use empty() - easy way to find instructions on what this does is go to php.net/function-name
[URL="http://php.net/empty"]php.net/empty[/URL]
You can just install something local, try MAMP, XAMPP, WAMP or whatever you prefer.
I know Sven likes to use Vagrant, that's however a bit more complicated. Just Google a bit around.[/QUOTE]
That code's gonna render an error in case $_POST["username"] or $_POST["password"] isn't set.
Also, isset isn't as good as empty when validating that a POST or GET actually is set to [I]something[/I]. isset only checks if the variable actually exists, but doesn't check if the variable contains something. Empty does both check that the variable is set and that i contains something.
So if I would just send button in the POST, we would wind up with an error.
[url]http://codepad.org/vo1qGgvK[/url]
[QUOTE=Svenskunganka;45890594]That code's gonna render an error in case $_POST["username"] or $_POST["password"] isn't set.
Also, isset isn't as good as empty when validating that a POST or GET actually is set to [I]something[/I]. isset only checks if the variable actually exists, but doesn't check if the variable contains something. Empty does both check that the variable is set and that i contains something.
So if I would just send button in the POST, we would wind up with an error.
[url]http://codepad.org/vo1qGgvK[/url][/QUOTE]
If you're gonna be this picky about it then we can easily go through this together and find bad stuff all over the place, like for instance the $username and $password isn't sanitized, the point is just what the typical set up would look like. I also believe I mentioned he could go read what the functions does, it would take ages if we had to explain every single function.
[editline]4th September 2014[/editline]
Sorry if I am being an asshole, I'm not really having a good day.
All I am trying to say is, the code was an example. Not meant to be copied and used for his own projects or anything like that.
In expressjs, say I have a set of api routes like:
[code]var express = require('express');
var router = express.Router();
router.post('/', function(req, res) {
res.send('hello');
});
router.post('/a', function(req, res) {
res.send('hello a');
});
router.post('/b', function(req, res) {
res.send('hello b');
});
module.exports = router;[/code]
As a very simple example, but I would eventually have many different calls with complex functionality.
How would I separate it so that the routing simply calls a function of a js script in an api folder?
So essentially id like to end up with:
api-routing.js
[code]
var express = require('express');
var router = express.Router();
???? Include api scripts?
router.post('/', Base);
router.post('/a', A );
router.post('/b', B );
module.exports = router;
[/code]
../api/api-base.js
[code]Base = function(req, res) {
res.send('hello');
}[/code]
../api/api-a.js
[code]A = function(req, res) {
res.send('hello a');
}[/code]
../api/api-b.js
[code]B = function(req, res) {
res.send('hello b');
}[/code]
Maybe I need to do something like:
[code]var express = require('express');
var router = express.Router();
???? Include api scripts?
router.post('/', require('../api/Base'));
router.post('/a', require('../api/A'));
router.post('/b', require('../api/B'));
module.exports = router;[/code]
../api/api-base.js
[code]module.exports = function(req, res) {
res.send('hello');
}[/code]
../api/api-a.js
[code]module.exports = function(req, res) {
res.send('hello a');
}[/code]
../api/api-b.js
[code]module.exports = function(req, res) {
res.send('hello b');
}[/code]
seems a bit weird to split the js up that much to me, but if I were to do it I would create a single functions js file that requires all the functions and packages them up into a single object (maybe even just programatically search for all .js's in the folder and add require them all), then require that into your base as 'routes' or something and then do
[code]
router.post('/', routes['base']);
router.post('/whatever', routes['whatever']);
[/code]
you could even do something like
[code]
router.post('/:thing', function(req, res){
if(routes.hasOwnProperty(req.params.thing)){
routes[req.params.thing].apply(this, arguments);
} else {
res.status(404).send('Not found.');
}
});
[/code]
[QUOTE=Moofy;45887393]Here's a typical setup for something very simple: [url]http://codepad.org/Fw3LXGCJ[/url]
This is [B]not[/B] good for form validation since I just die().
Everything that's something() is a PHP function, so for example you see I use empty() - easy way to find instructions on what this does is go to php.net/function-name
[URL="http://php.net/empty"]php.net/empty[/URL]
You can just install something local, try MAMP, XAMPP, WAMP or whatever you prefer.
I know Sven likes to use Vagrant, that's however a bit more complicated. Just Google a bit around.[/QUOTE]
Actually, empty() is a "language construct," and thus not a function ;)
[QUOTE=Ac!dL3ak;45895077]Actually, empty() is a "language construct," and thus not a function ;)[/QUOTE]
"This is due to the fact that the empty() function uses __isset() magic functin in these cases. Although it's noted in the ..."
Well, the docs talks about it as a function yet write it's not, I've picked up the part which I just quoted to you. But yes.
[QUOTE=Moofy;45896034]"This is due to the fact that the empty() function uses __isset() magic functin in these cases. Although it's noted in the ..."
Well, the docs talks about it as a function yet write it's not, I've picked up the part which I just quoted to you. But yes.[/QUOTE]
The docs does contradict themselves
[url]http://php.net/manual/en/reserved.keywords.php[/url]
[QUOTE] These words have special meaning in PHP. Some of them represent things which look like functions, some look like constants, and so on - but they're not, really: they are language constructs [...][/QUOTE]
[QUOTE=gokiyono;45896217]The docs does contradict themselves
[url]http://php.net/manual/en/reserved.keywords.php[/url][/QUOTE]
Splendid, time to go back and read all the stuff I've learned so far and make sure they are what I thought they were :v:
What is the best way to sanitize form data when processing it in PHP? I've been looking at this thread:
[url]http://stackoverflow.com/questions/129677/whats-the-best-method-for-sanitizing-user-input-with-php[/url]
But the answers are leaving me quite confused. The responses that I am gathering through a form are not being stored in any database, so I think I don't have to worry about any SQL injections or things like that (i think).
What does this mean (by user troelskn)?
[quote]Another example is HTML: If you embed strings within HTML markup, you must escape it with htmlspecialchars. This means that every single echo or print statement should use htmlspecialchars.[/quote]
I think this holds my answer, because it seems that htmlspecialchars changes any special characters from input? Why would I have to place it around every echo or print?
[QUOTE=DerpHurr;45899684]What is the best way to sanitize form data when processing it in PHP? I've been looking at this thread:
[url]http://stackoverflow.com/questions/129677/whats-the-best-method-for-sanitizing-user-input-with-php[/url]
But the answers are leaving me quite confused. The responses that I am gathering through a form are not being stored in any database, so I think I don't have to worry about any SQL injections or things like that (i think).
What does this mean (by user troelskn)?
I think this holds my answer, because it seems that htmlspecialchars changes any special characters from input? Why would I have to place it around every echo or print?[/QUOTE]
I don't think there's an one-size-fits-all way to sanitize data. Best you can do is sanitize according to the input (if you expect a number, check that it is one; same with emails, usernames, etc.)
Also, htmlspecialchars replaces things like < & > in a way that the browser will display it as it is (< = < > = >), rather than parsing it as html itself.
Why is my script content policy different if I access a folder via a subdomain or not?
if I access it via the subdomain, everything executes as intended, if I access it via the file structure it throws
[code]Refused to load the script 'http://www.google.com/jsapi' because it violates the following Content Security Policy directive: "script-src 'none'".
limonene.net/:1
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.[/code]
All over the place.
[QUOTE=Coment;45899796]I don't think there's an one-size-fits-all way to sanitize data. Best you can do is sanitize according to the input (if you expect a number, check that it is one; same with emails, usernames, etc.)
Also, htmlspecialchars replaces things like < & > in a way that the browser will display it as it is (< = < > = >), rather than parsing it as html itself.[/QUOTE]
So htmlspecialchars prevents users from entering html into text boxes so the code they entered won't be parsed?
[QUOTE=DerpHurr;45900077]So htmlspecialchars prevents users from entering html into text boxes so the code they entered won't be parsed?[/QUOTE]
No, it converts special characters to a html entity. For example, if I would want a title saying 'Cars & Trucks' in HTML, I wouldn't write it like below, as the & (ampersand) there is not a valid HTML entity due to ASCII and thus has to be escaped.
[code]
<title>Cars & Trucks</title>
[/code]
Instead, I would write it as such:
[code]
<title>Cars & Trucks</title>
[/code]
And as such, this is what htmlspecialchars() does, converts special characters to valid HTML entities.
[code]
$string = "Cars & Trucks";
$valid_html_entity = htmlspecialchars($string); // Outputs "Cars & Trucks"
[/code]
The & displays as a & sign in the HTML output.
[QUOTE=Svenskunganka;45901637]No, it converts special characters to a html entity. For example, if I would want a title saying 'Cars & Trucks' in HTML, I wouldn't write it like below, as the & (ampersand) there is not a valid HTML entity due to ASCII and thus has to be escaped.
[code]
<title>Cars & Trucks</title>
[/code]
Instead, I would write it as such:
[code]
<title>Cars & Trucks</title>
[/code]
And as such, this is what htmlspecialchars() does, converts special characters to valid HTML entities.
[code]
$string = "Cars & Trucks";
$valid_html_entity = htmlspecialchars($string); // Outputs "Cars & Trucks"
[/code]
The & displays as a & sign in the HTML output.[/QUOTE]
Thanks Sven, this cleared it up perfectly.
[QUOTE=DrTaxi;45873626]Did you back up the data in your home partition in a way that preserves file permissions/ownership/symlinks?[/QUOTE]
no and my entire server went into readonly on restart but then I force-wrote and updated symlinks to comment out the home partition and now everything works again.
Now for a heroku question: I keep getting
[code]
Bundle completed (22.17s)
Cleaning up the bundler cache.
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
ActiveRecord::AdapterNotSpecified: 'postgresql' database is not configured. Available: ["development", "adapter", "database", "pool", "username", "password", "timeout", "test", "production"]
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/connection_specification.rb:257:in `resolve_symbol_connection'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/connection_specification.rb:240:in `resolve_string_connection'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/connection_specification.rb:226:in `resolve_connection'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/connection_specification.rb:152:in `resolve'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/connection_specification.rb:164:in `block in resolve_all'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/connection_specification.rb:163:in `each'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/connection_specification.rb:163:in `resolve_all'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/connection_handling.rb:69:in `resolve'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/core.rb:46:in `configurations='
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/railtie.rb:128:in `block (2 levels) in <class:Railtie>'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/railtie.rb:118:in `block in <class:Railtie>'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `run'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0/lib/rails/application.rb:288:in `initialize!'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/config/environment.rb:5:in `<top (required)>'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0/lib/rails/application.rb:264:in `require_environment!'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/railties-4.1.0/lib/rails/application.rb:367:in `block in run_tasks_blocks'
/tmp/build_094fa7cd-c265-41bb-a25e-c16c2f60a731/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.1.4/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
[/code]
I have
gem 'sqlite3', group: :development
gem 'pg', group: :production
in my gemfile.
Any fixes?
Does anyone have any idea as to why this html code wouldnt be displaying the progressbar?
[html]
<!DOCTYPE html>
<html lang="en" ng-app>
<head>
<title>Express</title>
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link href="http://fonts.googleapis.com/css?family=Droid+Serif|Open+Sans:400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="/css/style.css">
<script src="/js/jquery-1.11.1.min.js"></script>
<script src="/js/angular.min.js"></script>
<script src="/js/ui-bootstrap-tpls-0.11.0.min.js"></script>
<script src="/js/controllers/player.js"></script>
</head>
<body>
<header ng-controller="PlayerCtrl">
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-md-1">
<span class="glyphicon glyphicon-play"></span>
</div>
<div class="col-md-8">
<progressbar value="55"></progressbar>
</div>
<div class="col-md-1">
<span class="glyphicon glyphicon-step-forward"></span>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row">
<div class="col-md-offset-2 col-md-8">
<h1>Express</h1>
<p>Welcome to Express</p>
</div>
</div>
</div>
</body>
</html>
[/html]
it looks like you're using bootstrap
[code]<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
<span class="sr-only">60% Complete</span>
</div>
</div>[/code]
[url]http://getbootstrap.com/components/#progress[/url]
[QUOTE=jung3o;45915096]it looks like you're using bootstrap
[code]<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
<span class="sr-only">60% Complete</span>
</div>
</div>[/code]
[url]http://getbootstrap.com/components/#progress[/url][/QUOTE]
Im using the angular bootstrap directives, but I had forgotten to include the module. Derp!
Now I have a different problem, being that CSS is the bane of my life...
[html]
<header ng-controller="PlayerCtrl">
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-md-1">
<span class="glyphicon glyphicon-play clickable"></span>
</div>
<div class="col-md-8">
<span>{{CurrentSong}}</span>
<progress><progressbar value="SongProgress" max="100"></progressbar></progress>
</div>
<div class="col-md-1">
<span class="glyphicon glyphicon-step-forward clickable"></span>
</div>
</div>
</div>
</header>
[/html]
With css:
[css]
header {
text-align: center;
background: #2c2c2c;
color: #7f8c97;
font-size: 3em;
}
.clickable {
cursor: pointer;
cursor: hand;
}
[/css]
Looks like:
[img]http://i.imgur.com/yeYA30e.png[/img]
I want the play and next icons to be vertically alligned
play around with
[css].glyphicon.clickable {
vertical-align: #px;
}[/css]
Okay, I know I've asked this before but I want to ask it one more time and hopefully figure out a solution that works.
How are you supposed to develop a PHP site locally and only push working commits to a git repo?
My laptop is Windows 8.1. I want to develop a site with the Laravel framework using the PHPStorm IDE. The site is running on my Debian 7 VPS. I don't see how I'm supposed to be able to test my site locally before pushing the commit (and therefore removing the need for 20 follow commits to tweak a webpage). I believe I could install PHP locally as well as track down/install the modules I'd need, but that doesn't help that my PHP site would be using a MySQL database. I'm not about to open up my MySQL server to public connections just so I can develop my site.
What am I missing here? Is it possible to have a usable workflow for a PHP site that is deployed remotely? Or do I have to do every change in an editor like vim in SSH right on the server itself?
This is driving me absolutely mad. I want to develop a site but I'm turned off by the workflow here. At least with Java I could test everything locally before pushing a commit, but it seems like there's no winning with PHP.
[QUOTE=Banana Lord.;45919838]Okay, I know I've asked this before but I want to ask it one more time and hopefully figure out a solution that works.
How are you supposed to develop a PHP site locally and only push working commits to a git repo?
My laptop is Windows 8.1. I want to develop a site with the Laravel framework using the PHPStorm IDE. The site is running on my Debian 7 VPS. I don't see how I'm supposed to be able to test my site locally before pushing the commit (and therefore removing the need for 20 follow commits to tweak a webpage). I believe I could install PHP locally as well as track down/install the modules I'd need, but that doesn't help that my PHP site would be using a MySQL database. I'm not about to open up my MySQL server to public connections just so I can develop my site.
What am I missing here? Is it possible to have a usable workflow for a PHP site that is deployed remotely? Or do I have to do every change in an editor like vim in SSH right on the server itself?
This is driving me absolutely mad. I want to develop a site but I'm turned off by the workflow here. At least with Java I could test everything locally before pushing a commit, but it seems like there's no winning with PHP.[/QUOTE]
Well a few things you could do. Set up an SSH tunnel. That would not be considered opening your MySQL to public but it would allow you to access it. You would work with a local PHP installation (development) and a remote PHP installation (production) that define what they are in the php.ini so that you can connect to the database based on which environment it is running. Another example would be is allowing the server to only allow connections to port 3306 through IP tables and set up an extra user that only allows your IP to be used. Then the final thing, but this is tedious, install a local MySQL server, delete it's database before starting work, download the latest dump from the server and import it locally.
Has anyone tried this: [url]http://usetakana.com/[/url] or anything similar? I am trying to find a tool to accomplish this task, not sure exactly what to use yet, just came across this. But if someone has a better tool that they've used I would like to hear about it so I have some options.
Sorry, you need to Log In to post a reply to this thread.