php

How do I retain uploaded files after POsting a form with a file upload?

Hi guys is it possible to be able to retain an uploaded file AFTER its been uploaded I mean I'm building a compose email application. Users can upload files as attachments. AT times out of 10 uploaded files one of them isn't uploaded correctly or the submitted form is invalid the compose page would be displayed again however the user wou...

What's a common practice of completing abstract class?

You have a class, that perfectly fits to be an abstract, but this class cannot work normally without data supplied from derived class. It's not convenient to pass all data to constructor because not all of it may be needed, and many of them can be dynamic (result from child function). What are the best practices to compose such structur...

how to iterate over non-English file names in PHP

I have a directory which contains several files, many of which has non-english name. I am using PHP in Windows 7. I want to list the filename and their content using PHP. Currently I am using DirectoryIterator and file_get_contents. This works for English files names but not for non-English (chinese) file names. For example, I have fi...

php code for receiving data from pdf forms

In my project,i'm using pdf forms for application form from clients......... How i can receive data from pdf after clicking submit ....Can u help me? ...

CodeIgniter library multiple instances

Hey guys, I have got a problem with my codeigniter library. To transform database data into a navigation and have active elements and such like I build a library class CI_Navigation(). It works perfectly fine, I just have one problem. Often on webpages one has corresponding but separated navigations e.g. a main navigation at the top a...

what is other option for HTTP_REFERER in php?

Hi all, I want to know is there any option/work sround for $_SERVER['HTTP_REFERER']. Because 'HTTP_REFERER' can not be trusted. Then What is other way to know that from which url the request has came from?. Here is the situation - http:// abc.com/one.htmlwill have an iframe having src=http:// xyz.com/giv.php?param=1. How giv.php on xy...

how to change the date format in jquery date picker?

Hi Hi i am using an date picker on selecting a date the date is displayed in this format month/date/year .... How to convert the date to this format year-month-date in date picker js itself ...

Zend_Services_Twitter, change the API Source name

Hi, I am sending tweets to Twitter via Zend_Service_Twitter. The tweets appear with a note "via API". I want to set the API Source with a different name, is there already a functionality within the Zend Framework to change it? Or do I need to subclass to get this functionality? Thanks! ...

php simplexml xpath question

Hey, I'm very newbie to xPath and time is against me, I don't have the time right now to learn a lot about it, so I hope you guys can help me with this! :) Here is my xml format: <Filme> <Film> <filmid>13497</filmid> <originaltitel>Bird</originaltitel> <originaluntertitel></originaluntertitel> <titel>Bird (OmU)</titel> <unte...

How to increase my "advanced" knowledge of PHP further? (quickly)

I have been working with PHP for years and gotten a very good grasp of the language, created many advanced and not-so-advanced systems that are working very well. The problem I'm running into is that I only learn when I find a need for something that I haven't learned before. This causes me to look up solutions and other code that handl...

Display calculating result in the same page

Hello, I have a table in my php code. In the second column of the table, normally it displays "---", and after i click the submit button, it will display the calculating result in the same page. For example, <table> <tr><td>1</td><td>---</td></tr> <tr><td>2</td><td>---</td></tr> <tr><td>3</td><td>---</td></tr> </table> And in the s...

php convert special character to ascii

Is there a built in function in php to convert special characters to it's ascii code? ...

PHP: how can I display the properties of my object ?

Hi, I have an object $rows If I use echo $rows the content is displayed in my html page, however I would like to select only some parts of the content but I cannot see inside the variable how it is structured... thanks ...

php regex - can't find the error

Just one simple, specific question: I've got the string {var1}12345{var2}, and I want to get the variable names used. if (preg_match("/{([a-zA-Z0-9]*)}/g", $url, $matches)) { print_r($matches); } If I remove the global flag, it works, but I only get the first variable, as expected. Why isn't it working with a global flag? It works...

Unix timestamp VS datetime

I have a Mysql table, which has a column add_date. It tracks the date/time when the record was added to the database. Queries based on this table: Display when the record was added in the format: 2 hours ago, 4 weeks ago, 1 year ago etc Allow users to search records inserted in any day/month/year. So the user may be allowed to choose...

Call PHP Function in jQuery (var)

Hello, I'm facing a small problem that I can't solve by myself. I have this php function: function intervalo_manha(){ $que="select id_intervalo,data_15 from intervalo_manha order by id_intervalo"; $re=mysql_query($que); $object.="<select>"; $object.="<option></option>"; while(list($i...

How to pass parameters from one controller to another in CakePHP?

Can anyone tell me how to pass parameters to a function in another controller in cakephp? ...

MySQL - Add Values In Query And Return As Single Value

I'm trying to query a database, and return a set of values. Part of the data i'm trying to return is an insurance premium breakdown. Is it possible to run a query, that selects multiple fields, then adds then and returns them as a single value? I've seen SUM() but the examples i've seen show it as adding up the results of an entire fi...

How to send the my sql result to controller in codeigniter as a variable

Hi In my mode I am selecting a field as $query1 = $this->db->query("SELECT dPassword FROM tbl_login WHERE dEmailID='[email protected]'"); How to return dpassword as a variable to my controller I tried this way return dpassword; ...

Set the current date in PHP

I'm currently working on my company's in-house CMS and wish to add the ability for an admin to view the site on a specific date. This will allow admins to preview the site with archived or scheduled posts. I'd like to avoid finding all mentions of date() or time() and offsetting them. Is there a way of making PHP think it's a specific d...