php

Session variables can be fooled (login)?

IN PHP: Is there a way for the user to fake a session variable? Is it secure to trust in the value of a session variable for a login system? ...

php form submit and the resend infromation screen

Hello, I want to ask a best practice question. Suppose I have a form in php with 3 fields say name, email and comment. I submit the form via POST. In PHP I try and insert the date into the database. Suppose the insertion fails. I should now show the user an error and display the form filled in with the data he previously inserted so he...

Get expiration time of a memcache item in php?

Hey. I'm caching tweets on my site (with 30 min expiration time). When the cache is empty, the first user to find out will repopulate it. However, at that time the Twitter API may return a 200. In that case I'd like to prolong the previous data for another 30 mins. But the previous data will already be lost. So instead I'd like to loo...

Video player plugin in wordpress

Hai, I would like to have a post thumbnail in the index page of wordpress site. And when you click on the post thumbnail, it opens the specific post page to play the video attached in that post. basically the post is a video. can u guys help in finding some good plugin to perform this task ...

how can I reset field after check it with php

Hi all, I have a html form that sends the data from 2 fields (memer no. , pw) via axaj (getElementById)to php file to check them with database info. . I did every thing well but I want to reset both fields if one of them is incorrect . How can I send reset order back to html form ? notice - I didn't use submit button just normal butt...

How to use PHPunit's Database Test Case Methods of Query to compare with doctrine query

How to use PHPunit's Database Test Case Methods of Query to compare with doctrine query i m using phpunit with doctrine framework .. i want to test my doctrine query with phpunit query with using phpunit framework methods.. any buddy with Doctrine Query and PhpUnit Query plz Contact... //Bhavin Rana. ...

Pagebreak (or table break?) to obtain a good formated PDF

Hi! I had develop an intranet on CakePHP witch in one part generates a custom PDF using DOMPDF. The problem is that i have a memo field (mysql text) witch i print after getting the result from PHP nl2br function. The problems is that in some ocasions, this text is too long (even on font-size: 6px) and i need some way to make a page brea...

Web-based user manual

I have completed one of my projects in PHP. Now I want make a web based user manual. How can I do that? ...

Best practice zend framework + faceBook Api

What is better way to integrate facebook api, in zend framework, for login I can implement Zend_Auth_Adapter_Interface but I found something like Zend_Service_Twitter, and thinking if I should implement Zend_Service_interface and what are the odds, sorry haven't looked at the architecture of Zend_Service yet, but any advice would be ap...

Reading multiple json values with php

I am trying to read certain values from a json string in php, I am able to do a simple json string with only one value such as $json = '{"value":"somevalue"}'; Using this: <?php $json = '{"value":"somevalue"}'; $obj = json_decode(json_encode($json)); print $obj->{'value'}; ?> But when i try an get a value from t...

Hide form forever once submitted

Hi Is it possible to create a form that only displays if the user hasn't ever completed it? Once it has been completed, the form should never display again. Thanks ...

shorten a word in a block of text

I have a block of text which occasionally has a really long word/web address which breaks out of my site's layout. What is the best way to go through this block of text and shorten the words? EXAMPLE: this is some text and this a long word appears like this fkdfjdksodifjdisosdidjsosdifosdfiosdfoisjdfoijsdfoijsdfoijsdfoijsdfoijsdfoisj...

Server-side web browser for PHP?

If you wanted to re-create the DOM server-side and manipulate it in PHP, how would you choose to go about it? I'm looking for a fast, multi-user complete server-side web browser that can interface with PHP and run complete Javascript. Like Jaxer but something I can use with PHP... an extension would be fine, or even an Apache mod. Ide...

HTTP Authentication with PHP's Zend XML RPC Client

I am using the Zend library's XML RPC Client in a PHP application to pull data from another server over XML RPC. However the other server is using HTTP basic authentication. How can I tell the XMLRPC client to use authentication for the requests? ...

Forum board example schema in YAML format - modify for Nested set?

I have created a forum board app, based on YAML schema found in 'real world examples' of Doctrine Manual, which looks similar to this: --- Forum_Category: columns: root_category_id: integer(10) parent_category_id: integer(10) name: string(50) description: string(99999) relations: Subcategory: class: Forum_C...

Finding and marking the largest of three values in a two dimensional array

I am working on a display screen for our office, and I can't seem to think of a good way to find the largest numerical value in a set of data in a two dimensional array. I've looked at using max() and also asort() but they don't seem to cope with a two dimensional array. I'm returning my data through our mysql class, so the rows are ret...

Is there a tool like phpMyAdmin which can be configured to access just a single database?

Is there a tool like phpMyAdmin which can be configured to access only a single MySQL database in a server? I cannot use phpMyAdmin because it allows access to all databases. A view that can allow a user to create/delete/insert/update tables should do. I remember using a software similar to this but dont remember what it was. It would a...

problem with setcookie

there is one think, i can't understand anyway:((( when i try to set cookie(it is on line 28 in login.php), browser returns me an error!!! Cannot modify header information - headers already sent by (output started at C:\xampp2\htdocs\video\index.php:9) in C:\xampp2\htdocs\video\login.php on line 28 but on line 9 in index php, i ha...

About Php development

hi actually i m new in programming and i have developed two projects one in osdate and other is my own code >and i am just 6 months older in PHP as developer >i am not happy with my code standard i want to improve that plz anyone can suggest me about standard and how to organized your project before starting ??i know its funny but i don...

using a href (html)tag along with PHP

i have tried: <?php include("delete.php") ?> <?php .... .... .... if($result=mysql_query($sql)) { echo "<table><th>Id</th><th>Name</th><th>Description</th><th>Unit Price</th>"; while($row = mysql_fetch_array($result)) { echo ...