Apache lets you set php.ini values for virtual hosts with the php_value directive.
Does nginx have something similar? Is there another way to set the include_path on a per-site basis?
Hello.
I have an array with integers of values from 0 to 100. I wish to remove integers that are less than number X and keep the ones that are equal or greater than number X.
I am using PHP.
Thanks!
I have some strings which contain the words LIMIT 3, 199 or LIMIT 0, 100.
Basically I want to replace the word LIMIT and everything after it in my string.
How do I do this in PHP? str_replace only replaces an item and the LIMIT text after is dynamic/
So it could be
WHEN JOHN WAS TRYING HIS SQL QUERY, HE FOUND THAT LIMIT, 121
// RETURN WOULD BE
WHEN JOHN WAS TRYING HIS SQL QUERY, HE FOUND THAT
WHEN JOHN TRIED LIMIT 343, 333 HE FOUND
// RETURN WOULD BE
WHEN JOHN TRIED
I want to make a little php poll. The script should ask the users a question they can only answer by numbers from 0-999. After pressing the submit button the data should be stored into mysql. So I just want to know how much users choosed the same number (in percent). It's a simple poll but I don't want any output to be shown.
As far as file permissions are concerned, when you use a php script to unzip a tar file, who is the "owner" user of the files created?
I'm wondering if its my ftp user because I uploaded the script file? Or does apache own the file? I know their are flags to be set to preserve the original permissions which I don't want (files where created and archived by someone else). I want my user to be the creater/owner of the files.
Hey guys,
How do I go about setting a string as a literal variable in PHP? Basically I have an array like
$data['setting'] = "thevalue";
and I want to convert that 'setting' to $setting so that $setting becomes "thevalue".
Thanks for any help!
I have a Php script I want to use for creating a new blog in WPMU. I am having trouble calling wordpress functions like "wpmu_create_user" and "wpmu_create_blog".
My hope is to get this script running as a cron job from command line and pick up new blog creation requests from an external db, create a new blog using the wordpress functions and update the db with new blog info.
Any help/suggestions are highly appreciated.
Sid.
Hi ALL~
I'm getting this error while I was implementing and testing PHP webservice using Zend Soap.
I'm testing the same codes under 2 different protocols(http & https) in 2 different web servers.
http site works just fine, but I get "SoapFault exception: [VersionMismatch]..." error in https.
The two web servers almost have the same specs.
Is there anyone who can help me with this?
Hi,
I want to get time zone through IP Address in PHP. Actually i have an application which will run at the client machine. I have IP address of client machine. But not able to get the time zone for each client machine.
Please reply me.
Thanks
Devesh M
Can anybody point me towards a PHP library or script that would allow me to split a pdf consisting of multiple pages into separate files, each containing 1 page. The PDFLib documentation doesn't appear to allow this and Google hasn't been particularly helpful.
I could possibly also use Perl, but it would be very inconvenient to do so.
Hi, I wanted to ask:
when I am using php.net/bzopen, does I need to bzwrite() already compressed by bzcompress() string or it being compressed automatically while writing?
I have a php script that execute a bash script. I try to pass parameters like this:
$script="/opt/lampp/htdocs/adapt.sh"
$file="/opt/lampp/htdocs/videos/video1.mp4"
$prefix="Test"
exec ('.$script.' '.$file.' '.$prefix.');
What's wrong? How can I pass the parameters?
Hi,
Is it possible to have Javascript compute a timestamp returned from php's time() function and present it in a readable format such as "Sun, 18th April 2010 at 4:00 pm"?
Thanks:)
Hi,
I'm sending email with PHP's mail function.
It works just as it should except all email clients show blank From-field.
Here's how i'm using the function:
mail( '[email protected]', "Example subject", $msg,
implode( "\r\n", array( Content-Type: text/html; charset=UTF-8', 'From: [email protected]') ) );
As i said everything works fine except From field is all blank when the message arrives.
Any ideas why this is happening?
I want to write a PHP script to output some data as a plain-text table using spaces to get the data into columns (just like the Linux top command). I can't use a HTML table as the script output will be saved to disk and viewed in a plain-text editor.
Is there anything available that can do this automatically (format the data into columns)?
I have a set of 5 HTML dropdowns that act as filters for narrowing results returned from a mySQL database. The three pertinent filters are for "Province", "Region", and "City" selection, respectively.
I have three functions:
findSchools(), which runs when any of the filters (marked with CSS class .filter) are changed, and fetches the results via AJAX from a PHP script. Once that is done, two other functions are called...
changeRegionOptions(), which, upon changing the "Province" filter, and updates the available options using the same method as the first function, but posting to a different script.
changeCityOptions(), which runs if the "Region" filter was changed, and updates options, again using the same method.
The problem is that since I want these AJAX functions to run simultaneously, and they by nature run asynchronously, I've tried using $.when to control the execution of the functions, but it doesn't fix the problem.
The functions run, but the Region and City filters return blank (no options); the FireBug report shows absolutely no output, even though the POST request went through. The posted parameter for filter_province gets sent normally, but the one for region gets cut off at the end -- it sends as filter_region=, with no value passed. So I'm presuming my logic is wrong somewhere. The code is below:
// When any of the filters are changed, let's query the database...
$("select.filter").change(function() {
findSchools();
});
// First, we see if there are any results...
function findSchools() {
var sch_province = document.filterform.filter_province.value;
var sch_region = document.filterform.filter_region.value;
var sch_city = document.filterform.filter_city.value;
var sch_cat = document.filterform.filter_category.value;
var sch_type = document.filterform.filter_type.value;
$.post("fetch_results.php",
{ filter_province : sch_province,
filter_region : sch_region,
filter_city : sch_city,
filter_category : sch_cat,
filter_type : sch_type },
function(data) {
$("#results").html("");
$("#results").hide();
$("#results").html(data);
$("#results").fadeIn(600);
}
);
// Once the results are fetched, we want to see if the filter they changed
was the one for Province, and if so, update the Region and City options
to match that selection...
$("#filter_province").change(function() {
$.when(findSchools())
.done(changeRegionOptions());
$.when(changeRegionOptions())
.done(changeCityOptions());
});
};
This is just one of the ways I've tried to solve it; I've tried using an IF statement, and tried calling the functions directly inside the general select.filter.change() function (after findSchools(); ), but they all return the same result.
Any help with this would be great!
Can anyone explain if it is possible to have a web server for all of these technologies:
ColdFusion, PHP, MS SQL Server, MySQL
I have a web developer insisting that they require all of the above however it doesn't quite make sense to me.
Any help or clarification is appreciated.
Trying to output the following 5 but not sure how to do it. Any ideas?
<?php
$other='What are you like?';
$content['my_name']=4;
$str=<<<JT
here is some info. $other Do
you like the number {$content['my_name']+1} ?
JT;
echo $str . '<br />';
I am trying to use an update query to change values held in a database, the new values I am trying to store are held in php variables. I'm not sure what it is I'm doing wrong.
mysql_query("UPDATE user SET
status='full' WHERE user_id =
'$user_id'")or die(mysql_error());
thanks in advance
I am looking for the best br2nl function. I would like to replace all instances of <br> and <br /> with newlines \n. Much like the nl2br function but the opposite.
I know there are several solutions in the PHP manual comments but I'm looking for feedback from the SO community on possible solutions.
Does anybody have a PHP (or other language) script for drawing a spiral. A simple (Archimedean spiral) would be just fine. Of course the principle is simple but coding it in SVG or GD would take some time, so I wonder if somebody has one ready :-)