PHP MySQL select random rows

PHP
I have a problem selecting 6 random friends This is the query I've got so far: $result = num_rows("SELECT * FROM friends WHERE member_id = '".$_...
3 years ago

How to get the object or class name?

PHP
Right now, I have this code where $obj_arr maybe contain array and an object. $obj_temp = array ($obj_identity, $arr_user, $obj_locale, $arr_query);...
3 years ago

How to embed codeigniter script into external php script

PHP
l have a index file of my website in localhost-->mywebsite-->index.php (this is my external script) and i have build a registration form with...
3 years ago

Nginx serves .php files as downloads, instead of executing them

PHP
I am installing a website in a droplet (Digital Ocean). I have a issue for install NGINX with PHP properly. I did a tutorial https://www.digitalocean....
3 years ago

Login to remote site with PHP cURL

PHP
I'm new to using cURL and its hard to find good resources for it. What I'm trying to do is login to a remote site, by having curl do the login form an...
3 years ago

jquery, json and success function

PHP
I have written this code, but I am not able to make it works as it should..: <script> $(document).ready(function(){ $(document).on('click',...
3 years ago

Complex sed Command for Insert Command

PHP
I have a bunch of php files, which have many insert commands. In each query, I want to insert a column variable admin_id = '$admin_id', i.e., if the ...
3 years ago

creating a classified - stuck

PHP
I am a beginner in web designing (php, mysql). I am creating a classified similar to Craigslist but not as complex. I managed to get the user ad inp...
3 years ago

How can the document root be changed in web server behavior?

PHP
I'd like to know if there is a way of changing the relative document root for extra security. I'll try to explain myself through the following example...
3 years ago

Get fragment (value after hash '#') from a URL in php

PHP
How can I get the fragment (value after hash '#') from a URL in php? Say from http://domain.com/site/gallery/1#photo45 I want photo45 ...
3 years ago

Where is my php.ini?

PHP
A few years ago I installed Apache 2.2x and PHP 5.3.1 on a Linux server I maintain. I used .tar.gz's and built them as instructed (instead of rpms an...
3 years ago

Can you include HTML within PHP define()?

PHP
I want to know if it is possible to include HTML code within PHP define(). I use define() for emailing purposes. I use it to send a verification ema...
3 years ago

PHP: embed text in image when uploading it

PHP
I followed this example to embed text in image while uploading it but it's not working. This is my code: header('Content-type: image/jpeg'); $img = ...
3 years ago

How to load a controller from another controller in codeigniter?

PHP
I want to load a controller from a function in another controller because the library I integrated to my project I don't want to load it to the contro...
3 years ago

Insert PHP form data not sending to MySQL Server

PHP
I am a amateur web developer learning php and mysql so I may send php/html form data to the sql server. unfortunately, when I run the program on the w...
3 years ago

Why is this php code not working? (500 - Internal server error)

PHP
I do not know php at all. I have used the following code in a wordpress theme and it does not work. What's wrong with it? ICL_LANGUAGE_CODE - return...
3 years ago

Need ctype_digit to return true for negative numbers also

PHP
I need to take a string and return true if only positive OR negative numbers are in the string. Is there a way to do this? $rating = "-25"; if (!cty...
3 years ago

Ajax Not Working on new Apache Server

PHP
I have just set up a new Apache2 server on my Raspberry Pi, but I seem to not be able to run Ajax. I think my code might be wrong, but that's why I am...
3 years ago

retrieve value from item from object with a number as key name

PHP
I got this result: Array ( [author] => stdClass Object ( [0] => stdClass Object ( ...
3 years ago

PHP: insert query result inside array elements

PHP
function standard_deviation_population ($a) { //variable and initializations $the_standard_deviation = 0.0; $the_variance = 0.0; $the_mean = 0...
3 years ago