I am doing a beauty salons website for my client using WordPress. I have created custom post type for beauty salons. Now I need to create a page where user can enter a place for example a city and select number of results or a radius in terms of Kilometers. Once we have the results we need to show all
Tag: php
PDO cannot connect remote mysql server
server A(192.168.1.3) mysql server(5.6.12) port 6603,socket /var/run/mysql/mysql.sock php(5.5.0) php.ini pdo_mysql.default_socket = /var/run/mysql/mysql.sock server B(192.168.1.4) mysql server(5.5….
What’s the best way to validate numbers with comma as decimal separator?
In a Laravel app, I have a form on which I need to validate numbers with a comma as the decimal separator. For the moment, it only works with a point because my validation rule is: What’s the best method : Keep the rule and replace comma with point before validation ? Is there a before_validation observer or …
netbeans shows “Waiting For Connection (netbeans-xdebug)”
need help to configure xdebug, for debugging projects from IDE netbeans. These are the features of my components: XAMPP 1.8.2 PHP: 5.4.16 netbeans: 7.3.1 Apache: 2.4.4 (Win32) this is the …
Laravel: belongsTo() relation assume one-to-many relationship instead of one-to-one
I’m having a tedious problem with Laravel’s ORM. I have a model with multiple relationships, like this: Now I can access the template related item in a simple way, like this: And it works out of the bat, because Laravel’s ORM assumes it is a one-to-one relationship and internally calls the f…
Secure image upload in php
I am making an image upload function which I can re-use in my code, which has to be 100% secure. Please tell me if you can spot and security holes in my initial code; UPDATE This is how far I’ve gotten with your help and some research, please tell me what you think. I don’t mind much about the spe…
PHP Check if variable is contained in an array
I have a numeric variable $i. This is a while loop, and $i increments after each iteration. How can a conditional statement be made as to not be necessary to write such a long statement if($i == 1 || $i == 2 || $i == 25 […])? Thanks in advance! Answer Use php in_array.
jQuery not working when I echo it from PHP
I need only some js to run during some parts of a php script, for testing purposes I commented out the php so I am not going to show it here. The line I have labeled 1B works fine, the background image displays. The section labeled not working seems to have no effect but when I run it separately in
redirecting to another page through php if error is Occurred?
i have to check weather the page is having error,if error is there i have to redirect to one default page like error.php I have tried with the following link but i cannot get the result changes in my .htaccess my errors.php code suggest me any idea,Thanks in advance.. Answer Are you working on a local server/…
Causes of MySQL error 2014 Cannot execute queries while other unbuffered queries are active
My server runs CentOS 6.4 with MySQL 5.1.69 installed using yum with CentOS’s repos, and PHP 5.4.16 installed using yum with ius’s repos. Edit3 Upgraded to MySQL Server version: 5.5.31 Distributed by The IUS Community Project, and error still exists. Then changed library to mysqlnd, and seems to e…