php

ajax dropdown(country, state, city)

Hi friends, I need some ajax code to do some functions with drop down. I have three table of values one for country, then state and city. And i have three dropdown to show these values first it should show select country select state select city in that drop downs(slect) respectively. when i select united states from the firs...

Mysqli statement parameter not found running PHPunit test under Eclipse

Hi, I run PHPunit tests via Apache, ou directly in Eclipse (ZendStudio in fact). All run well via Apache, but under Eclipse i have this error : zend mysqli statement execute error no data supplied parameters prepared statement The php version is the same (5.2.10), ZendFramework is 1.9 and here is the code function isValidPr...

session id in php

hi every one i am trying to echo session id i saw that each time refreshing the page it chang thats why i cant login . please any one suggest wht prob should be there ...

PHP: Get primary key of table?

Hello! Is there a way to get the name of primary key field from mysql-database? For example: I have a table like this: +----+------+ | id | name | +----+------+ | 1 | Foo1 | | 2 | Foo2 | | 3 | Foo3 | +----+------+ Where the field id is primary key (it has auto increment but I can't use that). How can I retrieve fields name "id" i...

itterate through range of numbers to add as keys

I have a range of 67 numbers, something like 256 through to 323, which i want to add to an existing array. it doesnt matter what the values are. looking for code to itterate through those numbers to add them as keys to the array without adding each one at a time ...

Which free/open source CMS ( PHP/My Sql) would be good to make and manage daily news based website of one city?

Which free/open source CMS would be good to make and manage daily news based website of one city? Site will be made by my team then it will be handled by non-technical client to add, manage and remove content. ...

How can I write a leap-year program in one line using PHP?

How can I write a leap-year program in one line using PHP? ...

Can we fetch fans of a particular page on Facebook?

Can we fetch fans of a particular page on Facebook? through PHP? if not is there any hack like, by becoming a fan of that page via PHP? ...

PHP DOM Get Tag Before N-th Table

Let's say the HTML contains 15 table tags, before each table there is a div tag with some text inside. I need to get the text from the div tag that is directly before the 10th table tag in the HTML markup. How would I do that? The only way I can think of is to use explode('<table', $html) to split the HTML into parts and then get the la...

mysql_fetch assoc refuses to return password row. Help needed.

The username row comes out perfectly but the password row refuses to come through. I am at a loss here. Does anybody know what the solution is? here is my code:: <?php //Mass include file include ("includes/mass.php"); //This is the login script //Grabbing the login values and storing them $username = $_POST['username']; $passwor...

Getting the contents of a file with PHP FTP

I am trying to get the contents of a file on a remote FTP server through PHP. Looking at all the docs though it doesn't appear possible to do this without first saving the transferred file to disk and then opening it. Is there any way of reading the file straight into a variable or buffer without having to save it to disk first? Thank...

Set up a login form in php and the first admin login

Hi everybody, I would like to setp up a login form that will included in certain pages. I found many tutorials that talk about it but, how can I add the "admin" account for the first time ?! In phpmyadmin directly? I can do it but, want it to be encoded with the md5 algorithm. Does anybody know where can I find a ready login system wit...

ajax rating script - avoid voting again

What's the best approach to achieve this? With cookies or with IP control? ...

PEAR/PHPUnit installation on shared hosting

I’ve installed a local (per-account) PEAR instance on shared web-hosting. After that I’ve installed PHPUnit. It doesn’t work in command-line mode because PHPUnit classes are not under default include_path that is ".:/usr/local/lib/php". The same, I think, would happen with local phing and other command-line tools installed via PEAR. Is...

Simple PHP opcode caching solution which does not need compilation?

I have a PHP site where all pages include an 57K generated PHP file. I'm thinking of using an opcode cache, so the file doesn't need to be parsed for every time a page is loaded (I assume loading the already parsed file would be faster than reading the 57K source file). APC seems to be good candidate for this, but according to phpinfo m...

cURL login problem

Using cURL to scrape a secure (i.e. login) page, and I'm at my wits' end. I managed to successfully scrape two sites with little or no problems, and now I just can't log into this one. cURL gets all the pages I ask it to, but they're all not logged in, which doesn't help. So maybe someone could spot a mistake I've missed? The code is: ...

PHP SoapClient: Problems with Distributed WSDL File

Hello, I have a problem using a distributed WSDL File ( scheme / other definitions are declared outside the actual wsdl) with php's SoapClient. This is the Fault Message I get: SOAP-ERROR: Parsing WSDL: 'getSomeInfo' already defined. After some googling , it seems to be a bug inside php as someone else discovered exactly the same pr...

Getting checkbox-selected data from Table A inserted into Table B

[Status: Learner] I have a Table A with thousands of records. On each displayed page, only 20 rows are showing, with the following fields: check last_name first_name gr eth sex id_num (a unique value) reason start_date The "check" field indicates a checkbox that the user can tick. At the bottom of each page of 20 records is t...

antiword is not picking any character when i use it to read uploaded doc file

I have a sign-up page in which i am asking username,password,confirm password and upload ur resume from user.Now i am storing this resume on hard disk in a folder /htdocs/uplaodedresume/. Now i want that if user want to see his resume like naukri.com and monster.com he can see it properly in same format as he uploaded.. In starting i u...

Looking for best CMS for MySQL Document based project, with CSS, PHP and Javascript

New project, to transfer existing Windows App to Web, Document based database with Report query and generator. What CMS sytem would be best? ...