Get the full URL in PHP

Have a look at $_SERVER[‘REQUEST_URI’], i.e. (Note that the double quoted string syntax is perfectly correct) If you want to support both HTTP and HTTPS, you can use Editor’s note: using this code has security implications. The client can set HTTP_HOST and REQUEST_URI to any arbitrary value it wants.

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

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

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.

xajax expanding list query

I think you should look into jQuery as your default javascript library, it’s used by many web professionals and is very good. There you will find the Accordion control, which I think will suite this need very well. Good luck!

PDOException: SQLSTATE[HY000] [2002] No such file or directory

I have put PushChatServer dir in htdocs folder and create database puschat try to run @”http://localhost/PushChatServer/api/test/database.php“ Then I got following exception. I want do same thing to explain this link http://www.raywenderlich.com/32963/apple-push-notification-services-in-ios-6-tutorial-part-2 I have done all that but I got this exception Could not connect to the database. Reason: exception ‘PDOException’ with message ‘SQLSTATE[HY000] [2002] No such … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)