php

webcamcapture + photoupload (like Facebook) for PHP

On my PHP-based (Joomla!) site users should be able to provide a photo of themselfes and provide some comments to it (e.g. Name). This file along with the comment should then be stored on the server. The user should simply be able to do this either by uploading a file or by taking a picture with their webcam directly on my site. I like t...

How to push information from a PHP proxy to a Flex application

So I have a PHP proxy that gets information from a website. Let's say the proxy gets the information from (www.example.com). It checks if the number of lines returned is the same as before, if not then there are more lines, it counts the difference then it need to push this information to the Flex client saying that it has new informatio...

So what really happens when we use 'new' in PHP

So what really happens when someone say 'new' in PHP I believe in C/Java, when new is called, memory is allocated for each instance variables that are needed for an object? (correct me if i am wrong) Is this the same with PHP? ...

How to change the style of fck editor

Hi i have php site. And iam using a style_client.css for client side. Suppose,in this , for '<h1>' tag i have given red color. In admin side , i have integrated fckeditor, Suppose if i put a content containing '<h1>test</h1>' in fckeditor, In fckeditor, it shows in red. That means fckeditor has another style sheet with diffeent style...

mysql:show date from datetime

hello all... i have a field inside table inspection,it is inspection_datetime. the type of field is datetime, so that make the data like yy/mm/dd hh:mm:ss. my question is how do i do if i want to show date only from the data? ...

Simple versioning (in PHP/Zend Framework)?

i am wondering how can i have simple versioning, say i want to be able to undo past edits (just up to 3 will do) to a post. maybe because the app allows other user to edit a post. but i may want the owner to restore the post for example. do i just store the full post in another field? ...

Postgres connection is slow from PHP

Hello, I have a little trouble with the Postgres server connection from php. I just started working with Postgres + PHP combo, and I realized that the connection establishment is really slow. It usually takes 1s or sometimes more than 2 seconds to make a simple connection. And it's only a development server, so there is no real traffic....

How to switch PHP version back and forth?

Hi, I installed LAMP manually on Ubuntu, let's say my current version of PHP is 5.2 and I want to switch to PHP 5.3 for awhile, is that possible? No xampp solution please. Thanks ...

count and search string from data array

Hello.. I have a database table as follows: line model serial range serial fa01 kd-g335ud 105x0001 105x0001-105x0200 fa01 kd-g335ud 105x0002 105x0001-105x0200 fa01 kd-g335ud 105x0003 105x0001-105x0200 fa02 kd-r311ed 105x0001 105x0001-105x0500 fa02 kd-r311ed 105x0002 105x0...

MySQL autoincrement problem

I have a table with autoincrement field, I have for example 1,2,3 values, when I insert 4 and delete it the next will normally be 5. I delete 5 and after a long time , say 1 week when I insert new record the next is again 4. Can somebody tell me why this happen , why when I insert a new record after a long time its getting the last inse...

SQL Server - Special characters not recognise by PHP (ODBC)

Hello, I am trying to display some information from SQL Server to my PHP site. I am using ODBC connection for that one. My Issue is : Special characters are not recognised and it is displaying "question mark (?)" in my site. (This works in my other ASP site) What I am missing here ? Please help me. Thanks in advance. ...

PHP / Scope / Callback

Hello, my code is : class myClass { $myVariable = 'myCallback'; function myFunction() { $body = false; $callback = $this->myVariable; function test($handle, $line) { global $body, $callback; if ($body) { call_user_func($callback, $line); } ...

PHP reqular expression: extracting title of img tag

I'm trying to learn reg exp, i want to get title of <img only from the text the text is differ and basically look like this <a href="http://abcde.com" target="_blank"><img src="http://abcde.com/img/aa.jpg" title="img title" id="img id" class="img class" /> any guidance and advise are appreciated.. ...

How to implement search on a gettext driven multi language site?

I'm setting up a multi-language using gettext. Since all text from other languages are in the compiled .mo files. How should I attack the search function of the site? Any help or point of direction would be appreciated. Note, I have not coded a search enigine before… ...

Zend_Form::populate() error

Ive got some kind of a problem here. When I try this function, it return this error: Catchable fatal error: Argument 1 passed to Zend_Form::populate() must be an array, object given, called in [..] When I used print_r() to find the values of the 1st argument, the output was this: Zend_Db_Table_Row Object ( [_data:protected] => Array ...

Cannot modify header information Warning message in PHP?

my index.php page code is- <?php if(!$_COOKIE['authorized'] == 1) { header("Location: login.php"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <title>My Photo Website</title> <script src="js/j...

Else statement for Login Function not Always Working Correctly

Hello, The code below is part of a PHP / MySQL login system that I am using. It determines whether or not the login fields are displayed, and it is supposed to only display them when the user is not logged in. Sometimes it displays them when is user is logged in, logging the user out. Any ideas on what I should look for to trouble ...

Slow server script makes IE stall

I am working on a php web application which involves calls to 3rd party web services. Recently I've run into problems because some of the web services are slow and/or time out. (When this happens the service throws an error after 5-6 minutes, which is handled by the web application) However, the problem arise that while waiting for the...

is multiple sitemaps receommendable to a web portal

I have a cricket based portal check here cricket scores This site has near to millions pages. But is it advisable to have a multiple sitemaps in the website or not? if Yes, what Name shall we give for the second site map? sitemap2.xml does this work? Some where in the blog i have read that each sitemap should not have more than 1000 l...

how to show alert "data already exists"

hello.i newbie this my first project,I don't know how to resolve any problems about the repetition of data i have an input page. it consist of 2 textfield: Model, Serial, and one combobox: 1. line. i want if there is input twice, I mean here is a double input data, will be out warning "data already exists". how do i do that?i ...