php

foreach problem in PHP

Hi, I have a array like i.e its $_FILES in am printing. Array ( [ANTI-HAV__TOTAL] => Array ( [name] => Array ( [0] => Firefox_wallpaper1.png [1] => Firefox_wallpaper2.png ) [type] => Array ( [0] => image/png [1] => image/png ) [tmp_name] => Array ( [0] => /tmp/phpr92AvZ [1] => /tmp/phpxmzia3 ) [error] => Array ( [0] => 0 [1] => 0 )...

How to store and retrieve date values

Please i want to Insert data date in "textbox" with PHP to myssql. But i can't do it. And show it with format "dd/mm/yyyy" in table ...

PHP website down 15 minutes at a time: "The connection was reset"

I've just started out coding in PHP but there is something stopping me from enjoying this experience. I have intermittent problems connecting to my website when I click any link. I'm currently using the following php as a test at http://mysite.com: <ul> <li><a href="./">Home</a></li> <li><a href="./index.php?nav=testone">Test 1</a></li>...

Dojo : Unable to stop "onClick" dijit event

I could not stop the "onClick" event ? If i just use the dom node with the "onclick" event then dojo.stopEvent() works but not with the widget's "onClick". I am getting the error "Unable to load page ......status 0". I found out that this happens when the page refreshes while the Ajax call is being executed. I am posting my code. Any he...

how to insert value in a particular location in csv file using php

Is it possible to write at a particular location in a CSV file using PHP? I don't want to append data at the end of the CSV file. But I want to add data at the end of a row already having values in the CSV. thanks in advance ...

google buzz php api to store multiple buzz accounts and post to all accounts

I have an application where i want to integrate multiple buzz accounts to the one site. So that when i publish something on the site i want it to go to all the buzz accounts. Is this possible?? If possible then can anybody provide some example code. ...

exporting php output as excel

include_once 'mysqlconn.php'; include_once "functions.php"; $filename = $_GET['par'].".xls"; header("Content-type: application/x-msexcel"); header('Content-Disposition: attachment; filename="'.basename($filename).'"'); if ($_GET['i'] == "par1") { func1(); } else if ($_GET['i'] == "par2") { echo "şşşıııİİİ"; func2(); } else if (...

Working with images

Is there some script (better if php), which can do some operations like? resizing reduce/increase lightness change contrast change quality Or some api's, which can help. Thanks. ...

Fake array slicing operator: Make it shorter

Is there some innovative way to make the "print" shorter without too much confusion? And which of the "print" do you like most? define('_','_'); function _j($a, $b) { return $a._.$b; } // Output 0_0 print (0)._.(0); print _j(0,0); Update What I want to do is to have slice syntax that are in Python/Ruby into PHP eg. a[1:3] a[1,3...

PHP setting Etag reliably

Hi there, im having trouble setting the Etag on a user's browser reliably. When a user clicks on one of my external links, i would like to set the article id into their Etag (i use cookies too, but id like to experiment with Etag specifically to test its reliability). When the same user returns to my site a few hours/days later, i woul...

Minimise / maximise a div

I ve created a chat appliction in one DIV. Now i need it to be placed in the bottom of page, which should be minimised & maximized Can any one help me <div style="height:40px; width:300px; background-color:#CC66FF; position:absolute;bottom:15px;" > <div id="vithu" style="height:40px; width:200px;"></div> <span id="error_msg"></spa...

Popping the IDE cherry

Although I've been a developer for years I've never used a PHP IDE - I've always just used a decent editor. What am I missing? I generally code on local servers so I can debug as if my code were running on my own machine, I have code highlighting, I have shortcuts set up to look up function names and so on. Is it worth investing the time...

How to skip invalid characters in XML file using PHP

I'm trying to parse an XML file using PHP, but I get an error message: parser error : Char 0x0 out of allowed range in I think it's because of the content of the XML, I think there is a speical symbol "☆", any ideas what I can do to fix it? I also get: parser error : Premature end of data in tag item line What might be caus...

add space before a numbers in php

How can I add space before numbers in php, to get output like this:  9   10 100 i m using str_pad($k,3,'',STR_PAD_LEFT) but blank space is not working and i don't want leading zero but i want blank spaces ...

from php to jquery

hi, i have array in php, and i need work with this array in jQuery. What best way send array( or variable ) from php to jQuery? Thanks ...

Dynamic Dropdown List from SQL with JS

Hi All, Please help, I have a dynamic JS table, so you can add and delete rows by clicking a button. One field that I need to add within the row is a select box, no problem so for and I use the following: var cell2 = row.insertCell(1); var sel = document.createElement('select'); sel.name = 'selRow' + rowCount; sel.options[0] = new Opti...

need some simple help understanding a bit of pre-PHP5 code

I was turned on to nstrees from another question, and have been working through the script. It was last updated in 2005 and relied on some stuff that has since apparently been deprecated like HTTP_POST_VARS which I wasn't immediately familiar with since I've been doing PHP for only a little less than a year. Anyways, the coding style se...

mysqli_real_connect() often takes around 5 seconds,even on developing environment

mysqli_real_connect($connection, $url['host'], $url['user'], $url['pass'], substr($url['path'], 1), $url['port'], NULL, MYSQLI_CLIENT_FOUND_ROWS); What's the reason that it can take much time to make a connection? Now about 3 out of 8 connections will hang for 5 seconds or even more. ...

Best lightweight RESTful framework for PHP 5.3

Is there any really lightweight RESTful frameworks around that assumes its users to be not newbies? I am looking for something that is based on the below criteria One that models resources ( for RESTful-ness ) Object oriented ( not just for the sake of it ) Not one that forces to use MVC No unnecessary fat ( strange database layers an...

admin area in sub directory

I have a system that has both a front end and an administration area. currently i am giving the admin area a subdomain. what i'd like to do it have it as a sub directory, e.g http://domain.com/admin but the admin area is set up to be placed in root. can i put something in my .htaccess to make the sub directory "/admin" think its the ...