Center-align a HTML table

For your design, it is common practice to use divs rather than a table. This way, your layout will be more maintainable and changeable through proper styling. It does take some getting used to, but it will help you a ton in the long run and you will learn a lot about how styling works. … Read more

Net 2.0 Framework Service Pack 2 Issue

I’m trying to install .Net 2.0 Framework Service Pack 2 on a Win 2k8 server which currently has .Net Framework 2.0 SP1, .Net Framework 3.0 SP 2 and .Net Framework 3.5 SP1 installed. The reason for installing SP2 is that I need to install a hotfix for this issue (hanselman.com/blog/…). When I attempt to install … Read more

How to Set Category Page as Home Page in Prestashop

You are doing it the wrong way. Do it as followed: A) Easy but not recommended Way: 1) Open Controllers/IndexController.php 2) Modify function initContent as below : B) Recommended Way: 1) Copy Controllers/IndexController.php to override/Controllers/ folder 2) Open the copied file and edit as below: 3) Save the file and go to cache folder. Find class_index.php , … Read more

Centering a background image, using CSS

That should work. If not, why not make a div with the image and use z-index to make it the background? This would be much easier to center than a background image on the body. Other than that try: background-position: 0 100px;/*use a pixel value that will center it*/ Or I think you can use 50% if you have set … Read more

How do I get a file extension in PHP?

People from other scripting languages always think theirs is better because they have a built-in function to do that and not PHP (I am looking at Pythonistas right now :-)). In fact, it does exist, but few people know it. Meet pathinfo(): This is fast and built-in. pathinfo() can give you other information, such as canonical path, depending … Read more

“Multiple definition of” C++ compiler error

Why do you #include lines.cpp in ThreeD.cpp? This is very unusual. Your makefile wants lines.o, so you’re going to compile lines.cpp. Anything defined in lines.cpp will be in lines.o and also in ThreeD.o. There is an intriguing comment in lines.cpp: I think the instructor wants you to break lines.cpp into a .h and a .cpp. … Read more

How to force file download with PHP

I want to require a file to be downloaded upon the user visiting a web page with PHP. I think it has something to do with file_get_contents, but am not sure how to execute it. After downloading a file with header(location) it is not redirecting to another page. It just stops.