I am now running my code on a web hosting service http://xtreemhost.com/
<?php
function updateTwitter($status)
{
$username = 'xxxxxx';
$password = 'xxxx';
$url = 'http://api.twitter.com/1/statuses/update.xml';
$postargs = 'status='.urlencode($status);
$responseInfo=array();
$ch = curl_init($url);
curl_...
I created a virtual directory for my php app.
Now I get the "Directory Listing Denied
This Virtual Directory does not allow contents to be listed."
Do I need to make some kind of dummy index.asp file that redirects (OR PREFERRED: just displays index.php) or how to solve this?
I have restricted access to webserver, but index.php is set...
Hi Everyone....
I have a script that runs for quite a while and i am using ob_start() to buffer the output and print the result after the script finishes executing...
I need to show some loading animation while the script executes and replace it with the output when the script finishes executing...
I know that it can be done quite bea...
I using url to request remote urls that sometimes may very slow or just down.
In this case, my php scripts still waiting for the response, it makes apache has to many requests stay in memory and then overload.
I need a way to stop curl requesting or stop running php script when specified time passed.
I'd tried declare(), it makes no sens...
I have XAMPP 1.7.3 installed on Windows 7. The PHP version is 5.3.1. I have successfully installed memcache for win32 from http://www.splinedancer.com/memcached-win32.
I got PHP extension php_memcache.dll from http://downloads.php.net/pierre.
Restarting apache and checking phpinfo() shows memcache is OK.
When I test it with below PHP...
I have a form which contains a lot of elements, my DB guy has generated an SP and now i need to call that stored procedure. My form has twenty elements, when i click on submit the data must be saved in database. I know how to do this on insert query, but how to call an SP and perform this operation.
There are 10 tables where the data is...
I am having a php file which executes some code to generate a html file.Its like I m having a form from which some data will be posted to x.php file, which gives a output(a webpage). I want to save that output in a html file.What the most efficient way of doing this.?
EDIT
I want to save it on sever side. Actually the thing is i want to...
hy, i need a little help here:
i use SWFupload to upload images!
in the upload function i make a folder call $_SESSION['folder'] and all the files i upload are in 1 array call $_SESSION['files'] after uploads finish i print_r($_SESSION) but the array is empty? why that?
this is my upload.php:
if($_FILES['image']['name']) {
list(...
Maybe something like this exists already?
...
Hi guys,
I'm working on a WebDAV implementation for PHP. In order to make it easier for Windows and other operating systems to work together, I need jump through some character encoding hoops.
Windows uses ISO-8859-1 in it's HTTP request, while most other clients encode anything beyond ascii as UTF-8.
My first approach was to ignore t...
Hi guys,
I need to save files with non-latin filenames on a filesytem, using PHP.
I want to make this work cross-platform. How do I know what encoding I can use to write the file? I understand many modern filesystems are UTF-8 based (is this correct?), but I doubt Windows XP is (for instance).
So, is there a robust detection mechanism...
Would what mentioned in the title be possible? Python module style that is. See this example for what I exactly mean.
index.php
<?php
use Hello\World;
World::greet();
Hello/World.php
<?php
namespace Hello\World;
function greet() { echo 'Hello, World!'; }
Would this be possible?
...
I'm still new to Unit testing, and specifically PHPUnit as the testing framework.
Suppose I'm building a unit test for a resource loader class. The class looks for resources to load in two directories (a global and a user-specific one).
To test the class, I would like to set up a mock testing directory containing some resource files. I...
Hi everyone,
I am setting up a github account, to work on a small project with some friends.
I would like to have my home machine able to do a git pull via php, so that we just have to call this small php file for the machine to be up to date.
As of right now :
<?php
$output = shell_exec('git help');
echo "<pre>$output</pre>";
?>
T...
I am working on shopping cart. pls follow the link www.photohaat.com
In the mug section whenever the user upload the image i want to wrap the complete image onto the mug so that he/she will saw the final output immediately.
we develop this shopping cart on PHP language.
I am trying to resolve this problem but unfortunately can't get a...
How can I screen scrape a website using cURL and show the data within a specific div?
...
Hi
My web hosting provider does not permit to use curl FOLLOWLOCATION option so I'm trying to
do it manually by using the header function.
My problem is that I need to keep my PHP script running and to be able to get the redirected URL data for parsing.
How do I do that?
...
I'm planning to build a CMS in PHP and MySQL, mainly for my own amusement and education. (Though who knows, I may come up with something useful and cool. Anything's possible.) I'll be asking questions about code architecture etc. later. For now, I'm more interested in development tools.
So far, all my playing with code has been done on ...
i have two foreach loop to display some data,
but i want to use a single foreach on basis of database result.
means if there is any row returns from database then
forach($first as $fk=>$fv) should execute otherwise
foreach($other as $ok) should execute.
i m unsing below ternary operator which gives parse error
$n=$db->numRows($task...
Hi i am doing internal mail service application ,
i have the field called datetime in my table,
i want to show the mail datetim in the inbox view somthing like gmail inbox,
i want to show if the mail came just 10 min aga means , i want to show 10min ago,
if mail came around 2 days back means i want to show the DATE-Time ,
Thing ke...