I'm using gzip with PHP to zip up some log files. My development machine is windows, and as you all know, a windows the path are sometimes separated by a space which makes it difficult because I have to wrap everything in quotes to get to the logs.
I'd like to keep my code as clean as I can and was wondering if there is a compression ut...
Hello
I am a newbie
I want to know
is there a way to have a text area which allows html where users can paste their html codes ?
...
I am experimenting with differnt API's of websites right now because I am building my own API for site, On bebo.com through there API they have a php cient which passes a key and secret that the owner of the app has. you then have a client library with a bunch of methods/functions you can call, all of the methods work like this:
pub...
I want to open a popup window on client PC where I will show records. The user will click on the selected row, and the popup window will disappear, but the parent Form on my page must get filled with the DB values related to the clicked row on the popup.
This is what I want to do. What is the right approach?
...
I'm having a problem with this spl_autoload and a static method. The constructor in this class requires two params to function. I'm new to autoload and static classes so I'm out of my league a bit here. Hopefully someone can shed some light on this for me.
Here is the call:
if(captcha::validate($post))...
If I require the class apart...
Hi,
i have a php file on the server, it just prints random numbers.
And i want to get this numbers by using XMLHttpRequest from another domain.
how can i do this?
thanks
...
How can i remove a new line character from a string using php.
...
Why is it when i use scandir using PHP i get extra values
$portID = $this->id;
$dir = '/home/sites/mydomain.com/public_html/public/images/'.$portID;
$contents = scandir($dir);
Is there something i dont know about the function which produces more values than are actually in the folder?
...
This is part observation, part question.
First the observation:
While everyone talks of modular programming, OOP, procedural done right, aspect oriented, design patterns, etc., several popular opensource PHP apps are plain script files with the structure being controlled by includes and requires.
This looked stupid to me till I faced a ...
In the below code i have an array arrSGoal. On Click of RemoveGoal i need to delete or set the value to 0 for the the id in the array.
Array is in php. dont know how to use in the jquery.
<SCRIPT LANGUAGE="JavaScript">
$(document).ready(function() {
$('a.removegoal').click(function(e)
{
e.preventDefault();
//Getting the TR...
Hi,
I have a common script which Im including in my php cron files and the files which are accessing through the browser. Some part of the code, I need only for non cron files. How can I detect whether the execution is from CLI or through browser (I know it can be done by passing some arguments with the cron files but I dont have access...
Using JsonEncode i got the php array in javascript. How i can get the modified array back to php.?
...
i try to install moodle web software...i m using wamp server and sqlserver 2005 version.
i install php driver for php5.3.0 thread safe version..i just paste that php_sqlsrv_ts.dll driver file
into my php ext directory...i include this line extension=php_sqlsrv_ts.dll in my php.ini file...
now i restart my wampserver...i m getting this er...
I'm searching for a website where I can test python scripts within a simple form (so I don't need to install python on my local machine). I know there is a site that can do it (also other script languages like javascript, php are supported...) but I forget the name.
Anyone can help me? Thanks!
...
Im currently outputting all text files held in a directory:
$directory = "polls/";
$dir = opendir($directory);
while (($file = readdir($dir)) !== false) {
$filename = $directory . $file;
$type = filetype($filename);
if ($type == 'file') {
$contents = file_get_contents($filename);
list($tag, $name, $description, $text1, $text...
I have the following which replace all of å, ø, æ .... etc to just _.
$string = strtolower($string);
$regexp = '/( |å|ø|æ|Å|Ø|Æ|Ã¥|ø|æ|Ã…|Ø|Æ)/iU';
$replace_char = '_';
$data = preg_replace($regexp, $replace_char, $string);
Now I want to change them to according to the followings.
Replace,
space to _
å, Å, Ã¥ and Ã… to a,
ø,...
Hello,
Is storing username & password of the user in a cookie a good practice? I really want to know how big websites like (Facebook, digg, twitter) handle this. My code is like that:
<?php
$username = mysql_real_escape_string($_POST['username']);
$password = md5($_POST['password']);
?>
After every successful login i store the $use...
Hi, I would like know if it is possible to create embedding of audio message to audio files?
For example, on playing every 10 sec of an audio, it would be interrupted with an audio message "You are currently listening to an audio by XYZ band" and then the audio continues. And even if someone were to download the mp3 file, the audio mes...
I have the following code which outputs the contents of text files held in a directory.
Ive been looking at the sort command in PHP but cant get it to work with the following code, I usually get an error about the input being a string and not an array.
How can I sort the directory of file before they are output?
$directory = "polls...
How would you convert a string like that to an associative array in PHP?
key1="value" key2="2nd value" key3="3rd value"
...