Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=Svenskunganka;47062003]Any reason for the unlimited bandwidth? How much do you normally use?
You're better off buying a VPS over shared website hosting nowadays. It's both cheaper and brings more performance.
With what you're trying to do the #1 package [URL="https://hosthatch.com/openvz-ssd-vps"]here[/URL] will probably give you all the resources you need. It's $8 quarterly (~$2.6 / month) and gives you 30GB SSD space under RAID10. I noticed you wanted UK-based - unfortunately they don't have any servers in that area, but they do have in Dronten, Netherlands which is just off-shore for you. Otherwise Stockholm, Sweden is also not too far and pings really nice.[/QUOTE]
I'll be hosting a lot of PDF files, around 2,000 or more up to 4MB each, I expect there will be some demand for them so bandwidth is perhaps the most important thing, hard to say really for sure.
[QUOTE=Chryseus;47062473]I'll be hosting a lot of PDF files, around 2,000 or more up to 4MB each, I expect there will be some demand for them so bandwidth is perhaps the most important thing, hard to say really for sure.[/QUOTE]
You got over 250,000 downloads each month? Otherwise 1TB of bandwidth is enough, and if you need more you can just upgrade the package to get another 1TB (250,000 downloads) each level. When the point comes you need a ton of bandwidth (now I'm talking about +6TB / month), you should really utilize a CDN like CloudFlare's.
[QUOTE=Svenskunganka;47063105]You got over 250,000 downloads each month? Otherwise 1TB of bandwidth is enough, and if you need more you can just upgrade the package to get another 1TB (250,000 downloads) each level. When the point comes you need a ton of bandwidth (now I'm talking about +6TB / month), you should really utilize a CDN like CloudFlare's.[/QUOTE]
Hmm good point, I can always use other storage solutions as well.
I'll give hosthatch a go.
[QUOTE=Moofy;47060198]If you use Wordpress you should really make your own theme, I'm not a huge fan of Wordpress anymore personally. I used to like it but it felt like a big pile of things I didn't need.[/QUOTE]
Of course. But when desigining your own theme and plugins you can do anything with it. Absolutely anything.
So i just started learning php in college and i have a couple of ( probably dumb ) questions.
What does '->' do? I did look around and googled some stuff and that gave me two examples that brought me to two conclusions, either like it's this:
[code]
Thing.hasthisfunction ()
[/code]
So basically calling a function on that element ( please do correct me if i'm wrong ) or, maybe like it's like inserting the object into the function as a value?
Again, i searched across the internet and asked some questions and the best explanation that i got was this:
[code]
penis-> penis->penis-> penis-> penis-> penis ()
[/code]
So a good explanation or some good wiki/tutorial would really help! Thanks!
Im pulling my hair out here
Im trying to implement a sticky footer in bootstrap on a page that contains only a tabset, but I cant get it to respond to a tab change that makes the page higher
If you resize the plunker view panel so that it simulates a xs device you should see how the button on tab 2 goes behind the footer!
[url]http://plnkr.co/edit/GsK1VWffuErpIDKQ5xmc?p=preview[/url]
Changed it to use twitters navbar-fixed-bottom but still the same issue
[url]http://plnkr.co/edit/GsK1VWffuErpIDKQ5xmc?p=preview[/url]
[QUOTE=robbert^^;47069466]ooo[/QUOTE]
They are for using an objects methods in PHP.
[url]http://php.net/manual/en/language.oop5.php[/url]
[url]http://code.tutsplus.com/tutorials/object-oriented-php-for-beginners--net-12762[/url]
If you had a class which was called thing, it would look like
[code]
$thing = new Thing(); // New object
$thing->hasThisFunction(); // Using the method (like functions in classes)
[/code]
Inside the class could look like this
[code]
class Thing{
public function hasThisFunction(){
echo "Foo";
}
}
[/code]
[QUOTE=robbert^^;47069466]So i just started learning php in college and i have a couple of ( probably dumb ) questions.
What does '->' do? [..]
So a good explanation or some good wiki/tutorial would really help! Thanks![/QUOTE]
[code]thing::function() // static function of class thing
thing::var // static var of class thing
thing->function() // instanced function
thing->var // instanced variable
thing.var // string value of thing concatenated with string value of var[/code]
if you want to know what any other tokens are used for then use this: [url]http://php.net/manual/en/tokens.php[/url]
if you want to know more about the different of static and non-static: [url]http://php.net/manual/en/language.oop5.static.php[/url]
Thanks allot guys! Really appreciate it! I'll be toying around with this for the next couple a days and i wilp report back if i have questions!
[QUOTE=Richy19;47069501]Im pulling my hair out here
Im trying to implement a sticky footer in bootstrap on a page that contains only a tabset, but I cant get it to respond to a tab change that makes the page higher
If you resize the plunker view panel so that it simulates a xs device you should see how the button on tab 2 goes behind the footer!
[url]http://plnkr.co/edit/GsK1VWffuErpIDKQ5xmc?p=preview[/url]
Changed it to use twitters navbar-fixed-bottom but still the same issue
[url]http://plnkr.co/edit/GsK1VWffuErpIDKQ5xmc?p=preview[/url][/QUOTE]
Add a padding-bottom to the <body> that is at least as high as the sticky footer?
[QUOTE=HeroicPillow;47069732][code]thing::var // static var of class thing[/code]
[/QUOTE]
Correction:
[code]Thing::$var[/code]
If you're using [B]Thing::var[/B] it's a constant.
[QUOTE=Moofy;47073179]Correction:
[code]Thing::$var[/code]
If you're using [B]Thing::var[/B] it's a constant.[/QUOTE]
i didn't bother putting $ in any of the places it was supposed to be in that code block, so not entirely sure why you only singled out that one line tbh
the correct code block would be:
[code]$thing::function() // static function of class thing
$thing::$var // static var of class thing
$thing->function() // instanced function
$thing->$var // instanced variable
$thing.$var // string value of thing concatenated with string value of var[/code]
but the pages i linked have more in-depth explanations, and the very first thing anyone learns with PHP is that variables are prefixed with $ so it's pointless using it when you're simply explaining what the various tokens do
[QUOTE=HeroicPillow;47073830]i didn't bother putting $ in any of the places it was supposed to be in that code block, so not entirely sure why you only singled out that one line tbh
the correct code block would be:
[code]$thing::function() // static function of class thing
$thing::$var // static var of class thing
$thing->function() // instanced function
$thing->$var // instanced variable
$thing.$var // string value of thing concatenated with string value of var[/code]
but the pages i linked have more in-depth explanations, and the very first thing anyone learns with PHP is that variables are prefixed with $ so it's pointless using it when you're simply explaining what the various tokens do[/QUOTE]
Uhm you don't call a instanced variable like:
[code]
$thing->$var;
[/code]
It's still
[code]
$thing->var;
[/code]
Also you didn't even mention constants, that's why I corrected it in the first place.
[editline]4th February 2015[/editline]
This would be a 100% working example:
[code]
<?php
class Thing
{
const HAM = 'ham';
public $cheese = 'cheese';
public static $milk = 'milk';
public function donut()
{
return 'donut';
}
public static function soup()
{
return 'soup';
}
}
// Class constant call
echo Thing::HAM;
// Static variable call
echo Thing::$milk;
// Static function call
echo Thing::soup();
// Instance
$thing = new Thing;
// Instance variable call
echo $thing->cheese;
// Instance function call
echo $thing->donut();
[/code]
Anyone had any real use for PHP Sockets?
[QUOTE=Neophyte;47086325]Anyone had any real use for PHP Sockets?[/QUOTE]
Yes, loads of people have real uses for it. For example [URL="https://github.com/xPaw/PHP-Source-Query-Class"]https://github.com/xPaw/PHP-Source-Query-Class[/URL].
Is it possible to force a server to display certain files like webm and mp4 instead of making them download you?
So far I found .htaccess examples preventing a download or displaying, but not forcing it to display.
I just started learning jQuery and I still don't know the difference between $('.div') and $('div')
Basically why some classes or id or whatever are using the . and inside and some not.
[QUOTE=BoowmanTech;47099638]I just started learning jQuery and I still don't know the difference between $('.div') and $('div')
Basically why some classes or id or whatever are using the . and inside and some not.[/QUOTE]
Thinking of it like CSS helps
When you use .div you are selecting all classes that are called .div, and if you just use div you select all elements called div. The same if it was #div
[QUOTE=BoowmanTech;47099638]I just started learning jQuery and I still don't know the difference between $('.div') and $('div')
Basically why some classes or id or whatever are using the . and inside and some not.[/QUOTE]
$("div") selects div elements <div>, [URL="http://api.jquery.com/element-selector/"]Element selector[/URL]
$(".div") selects elements with the div class <span class="div">, [URL="http://api.jquery.com/class-selector/"]Class selector[/URL]
It might be that ".div" is a synonym for "div".
Here is a full list of all JQuery selectors [url]http://api.jquery.com/category/selectors/[/url]
Thanks for the quick response.
[QUOTE=BoowmanTech;47099711]Thanks for the quick response.[/QUOTE]
And thank you for not creating a separate thread for this :v:
Hey, I have a server running Linux Ubuntu, I have terminal access to it.
I also have domain name purchased, I am running my website on that server and all works good, but:
Is there any quick and easy way to setup proxy service on my server without fucking up my website?
Like create a subdomain like:
proxy.myhost.com
and when I enter that address it would have address field which I enter and I get redirected to the website I entered and be able to browse it without any script limitations or glitches BUT using servers IP instead of mine, is that possible?
I've tried using free proxy services but they are shit (probably because they are being used by thousands at same time).
Also just tried installing virtual desktop on my linux server and connecting to it using desktop remote connection and it fucking sucks, now I am stuck with some shit packages on server that I cannot remove (like xfce), so proxy option is better probably.
[QUOTE=KinderBueno;47100780]
Is there any quick and easy way to setup proxy service on my server without fucking up my website[/QUOTE]
Unless the proxy server uses the same port as your webserver (80/443) it shouldn't conflict. The other option is setting up something like a php proxy script
[QUOTE=Goz3rr;47101110]Unless the proxy server uses the same port as your webserver (80/443) it shouldn't conflict. The other option is setting up something like a php proxy script[/QUOTE]
I was thinking of creating a new folder/website and assigning subdomain to it, but from that I don't know what the next step is, I never worked with creating proxies etc..
I have a small favor to ask. I want to learn jQuery and JavaScript and how to use them on making website. My main problem is that I can't learn just by reading or watching tutorials, I learn by making website and failing.
So what I want to ask is does anyone one of you have a design for a website in which I would use jQuery or/and JavaScript. I was going to make one but I don't have any ideas and unless I have some I can't do anything.
[QUOTE=BoowmanTech;47101495]I have a small favor to ask. I want to learn jQuery and JavaScript and how to use them on making website. My main problem is that I can't learn just by reading or watching tutorials, I learn by making website and failing.
So what I want to ask is does anyone one of you have a design for a website in which I would use jQuery or/and JavaScript. I was going to make one but I don't have any ideas and unless I have some I can't do anything.[/QUOTE]
Start small maybe? A simple todo app is usually a good starter. Adding, removing todos. Maybe some nice JQ animations
[QUOTE=Cuel;47102051]Start small maybe? A simple todo app is usually a good starter. Adding, removing todos. Maybe some nice JQ animations[/QUOTE]
Well that's the problem, I lack imaginations. I never managed to finish anything because of the design. Even now I am still working on my portfolio and I changed it like 5 times already because of the design.
What the heck am I doing wrong here?
[code]
Redirect permanent / https://josm.uk/
[/code]
In my httpd.conf which is included in apache2.conf.
But gives me a "The page isn't redirecting properly" error when I try and visit via http rather than https.
Is there a better way of redirecting http trafftic to https?
[QUOTE=josm;47105488]What the heck am I doing wrong here?
[code]
Redirect permanent / https://josm.uk/
[/code]
In my httpd.conf which is included in apache2.conf.
But gives me a "The page isn't redirecting properly" error when I try and visit via http rather than https.
Is there a better way of redirecting http trafftic to https?[/QUOTE]
Could you show your entire virtual host config? Seems to me like you're redirecting forth and back
Sorry, you need to Log In to post a reply to this thread.