php

datatable:edit and delete data

hi all.. i have a datatable which connected to DB... i want make the data inside datatable can be edit and delete... but of course,,after make change at datatable the data inside DB also change.. what's code to do that...??i've been try like this: $("#datalist tbody").click(function(event) { $(oTable.fnS...

Execute function on session destruction

I am developing a web-based user interface that plots some data from a database and displays it to the user. There are, literally, millions of different graphs that may be generated, so my idea is to dynamically generate the graph, save it to a temporary file, serve the web page and finally remove the image after a certain period of time...

How to check if user is logged in with new facebook php api

I am migrating my old FB app to the new graph API using the PHP API I have two pages: public ones (which require no user login) and private ones (which do) So the code of every single php page in my application works as follows: if (this_page_requires_user_login){ $facebook = new Facebook(...) ; $session = $facebook->getSe...

Smarty array with dot in key

I have an array in PHP that looks like this: $config['detailpage.var1'] $config['detailpage.var2'] $config['otherpage.var2'] $config['otherpage.var2'] ... To access it in Smarty I would do $smarty->assign('config', $config); With this template: {$config.detailpage.var1} Unfortunately this does not work, due to the dot in my arra...

Strange problem of apostrophe in communicating with PHP script from Android

Hi, I am communicating with PHP web services in Android application. All the requests send from android are encoded with UTF-8 and the php scripts decodes it with utf-8. But when any request is send with apostrophe ' the decode function of php doesn't seem to work the way it should. For example, if I send the request as "Today's Hor...

programming an e-book library

what would be the best way to code an e-book library in php? how should the e-books be displayed? should the contents be generated from the database or from sources like txt or pdf? altho i'd prefer the ebooks to be displayed in html format, not pdf. are there any good online tutorials on this? i'd appreciate your thoughts. ...

How to replace Youtube urls in text with embeded code (in PHP)?

This is what I've got so far: <?php $content = "word1 http://www.youtube.com/watch?v=yqfKe-67foQ&amp;feature=related word2 http://www.youtube.com/watch?v=2vq7gDEn99Y&amp;feature=related word3 http://www.youtube.com/watch?v=nW5HxgMYRto\nhttp://www.youtube.com/watch?v=8Uc2lpH0iZ0&amp;feature=fvhl"; $pattern = '/http:\/\/www\.youtube\.c...

Problem with is_page() conditional in WordPress

Hi, can someone tell me why this code doesn't work? The is_page() is not in effect. function tao_scripts() { if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', get_template_directory_uri() . '/js/jquery-1.4.2.min.js', false, '1.4.2'); wp_enqueue_script('jquery'); if ( is_page() ) { ...

Moving from asp.net to php

Hello all, I am an asp.net web developer. Recently I have recieved a job offer to write a website in php (I'll be upgrading an already written code). I wanted to know, how much time will it take me to learn the langauge? How different is it from asp.net? Do people usually go from asp.net to php, or is that the other way around? Thank ...

identifying php unused variables

Hello, I have seen the bellow question and was wondering if there is something like it for eclipse. Also how can I make sure that this kind of errors get's thrown into my trigger error function so that I can write it to a log. Thank you for any help. http://stackoverflow.com/questions/2534176/identifying-php-unused-variables-in-emac...

How does error controller work in zend

hello ! I just want to know how does error controller work for different module ,say its admin and default,in zend framework... because its working fine in default module but not working in admin module ... is there any condition which I have to use? and how ? ...

HOW TO GET: Time Zone Setting of FTP Server?

I'm using PHP's ftp_rawlist function to get a listing of files and their associated last-modified date/time. For my purposes, I need to know the time zone (or offset) of the the last-modified date/time. The dates/times alone are useless to me as I need to convert them to UTC. Is there anyway to figure out what the FTP server's time zone...

Create files in PHP in some other folder

$ourFileName = "testFile.txt"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); fclose($ourFileHandle); The file "testFile.txt" should be created in the same directory where this PHP code resides.Now is there any method to create this file in some other folder. I tried something like this - $ourFileName = "http://a...

How to set $_FILE without html browse button ?

I have a form that contains an html file browse button ( <input type=file /> ). User select a file by clicking browse button and submit the form. On form submission new php script (submitToServer.php) is called that use that file to upload it to the server. Now I want to upload that file without using browse button because file name and...

Should I carry on porting FPDF to .NET?

I've started to port FPDF to .NET, however I was wondering if its worth the effort. Has it already been done? I'm aware of ASP FPDF, but I'm talking about creating a native .NET dll so that any .NET language can use it. I plan to make it public for any one to use. Further I'm not familiar with PHP, what tips/advice can you give (in t...

DB design: one large DB for all customers or many small DBs

Looking for any suggestions or advise or even best practices. I have developed an online database using php and mysql. It allows companies to log complaints and resolutions etc. There is a user database for login and a cip database for logging the main data. 2 companies are trialing and testing the database. At the moment each compan...

is there a faster way to get a YouTube clip's title than this?

Currently i'm using the following, which seems quite slow for multiple clips: static function get_yt_title($clip_id){ $feedURL = 'http://gdata.youtube.com/feeds/api/videos/' . $clip_id; $entry = @simplexml_load_file($feedURL); if($entry){ $video= new stdClass; $media = $entry->children('http://search.yaho...

PHP Checking variables isset, empty, defined etc.

i was looking at a tutorial from ZendCasts where i wondered about the code he used. a simplified version below class TestClass { private $_var; private static function getDefaultView() { if (self::$_var === null) { ... } // this is the line in question } } i wonder why is something like isset(self::$_var) not used ...

Cakephp isUnique validation is not triggered on one field, but works on another

When I save the information from a registration form I have some validation rules on the username and email fields (I've pasted the rules below). Validation is called automatically with the saveAll() function. The problem is that the isUnique rule on the username field doesn't work at all (doesn't return any error). The other rules for ...

Looking for another Framework.. Which one should I pick?

I have been using CodeIgniter for about a year now, but I feel that I have spent too much time building things that should be native. My own version of it is pretty cool and has almost everything I have ever used to build a web, in a way that it is reusable, but still lacks power and every time I learn something new (like TDD, or ORM), I...