php

Embedded Web Server in .NET

I would like to embed a light weight web server in a Windows application developed in .NET. The web server has to support PHP. I have looked at Cassini, but it seems it is ASP.NET only. Any idea? ...

How do I get PHP to work with ADOdb and MySQL?

I'm trying to get a PHP site working in IIS on Windows Server with MySQL. I'm getting this error Fatal error: Call to undefined function mysql_connect() in C:\inetpub...\adodb\drivers\adodb-mysql.inc.php on line 363 Update This link outlines the steps I followed to install PHP on my server: How do I get PHP and MySQL working on IIS...

How to convert a utf-8 string to a utf-16 string in PHP

How do I convert a utf-8 string to a utf-16 string in PHP? ...

Displaying whitespace in HTML when pulling from MySQL TEXT column

I have saved input from a textarea element to a TEXT column in MySQL. I'm using PHP to pull that data out of the database and want to display it in a p element while still showing the whitespace that the user entered (e.g. multiple spaces and newlines). I've tried a pre tag but it doesn't obey the width set in the containing div elemen...

What are good tools/frameworks for i18n of a php codebase?

I have been looking at a few options for enabling localization and internationalization of a dynamic php application. There appears to be a variety of tools available such as gettext and Yahoo's R3 and I am interested in hearing from both developers and translators about which tools are good to use and what functionality is important in ...

Checking for and not printing javascript in generated data?

In my php web app, suppose I want to go the extra mile and in addition to going gangbusters and being anal-retentive about sanitizing my inputs, I also want to ensure that no javascript is being output in strings I am inserting into templated html. Is there a standard way to make sure I don't put javascript in the generated html conten...

Anyone have issues going from ColdFusion's serializeJSON method to PHP's json_decode?

The Interwebs are no help on this one. We're encoding data in ColdFusion using serializeJSON and trying to decode it in PHP using json_decode. Most of the time, this is working fine, but in some cases, json_decode returns NULL. We've looked for the obvious culprits, but serializeJSON seems to be formatting things as expected. What else c...

PHP Session data not being saved

I have one of those "I swear I didn't touch the server" situations. I honestly didn't touch any of the php scripts. The problem I am having is that php data is not being saved across different pages or page refreshes. I know a new session is being created correctly because I can set a session variable (e.g. $_SESSION['foo'] = "foo" and p...

In Facebook app, is there a way to link directly to "join a group"

I'd like to have a link for a user to join a Facebook group from within my Facebook application. Here is the link on Facebook's "display a group" page (minus a longer referrer part), but the group id is encrypted: http://www.new.facebook.com/group.php?sid=c431b3cfc02765def331081f8b71ffbd Anyone know how to either encrypt a group id th...

Best way to get result count before LIMIT was applied in PHP/postgres

When paging through data that comes from a DB, you need to know how many pages there will be to render the page jump controls. Currently I do that by running the query twice, once wrapped in a count() to determine the total results, and a second time with a limit applied to get back just the results I need for the current page. This se...

PHP page caching

Right now each time the page is loaded the php script is run regenerating the page. For pages like search this is fine, because most searches are different, but for other pages such as the index this is virtually the same for each hit, yet generates a large number of queries and is quite a long script. The problem is some parts of the p...

PHP : What is the default lifetime of a session

If i hit a page which calls session_start(). How long would I have to wait, so that if i was to refresh the page, I was issued a new session ID? ...

Saving a web development project from disaster

I have seen the idea at HashRocket for their Rescue Mission that is designed to step in and recover from a failing Rails development project (whether timeline, or budget, or something else will not be met). I was wondering if other people offer this service for PHP projects, or web development projects in general. Ideally, they would b...

Undefined Variable in php

I have inherited some code for a custom CMS that is a little out of my league and keep stumbling over the same errors, Notice: Undefined variable: media in /Applications/MAMP/htdocs/Chapman/Chapman_cms/admin/team-2.php on line 48. This is supposed to create new users and edit old users. However, it does not work when I try and add a new ...

How would you transform a pre-existing web app in a multilingual one?

I am going to work on a project where a fairly large web app needs to tweaked to handle several languages. The thing runs with a hand crafted PHP code but it's pretty clean. I was wondering what would be the best way to do that? Making something on my own, trying to fit the actual architecture. Rewriting a good part of it using a fram...

PHP Development - lot of (newbie) questions

Hi! I'm a Engineering student and I'm attending a Database and Information Systems class this semester. It's required that I produce a website/application that uses a database, using PHP/PGSQL. My questions are: which IDE would you recommend? does anyone have good tips and advices for a new developer? it would help me (a lot) to devel...

how to send email with graphic via php

Hi, i would like to send html email with graphic elements included i have no idea to attach garaphics to this email please help ...

How to 3270 screen-scrape from a Linux-based web app

I have a LAMP (PHP) web app which need to interface with programs on an IBM 3270 mainframe (via Microsoft SNA Server). One solution I'm looking at is screen-scraping via 3270. (I'm integrating the present with the past!) Many years ago, I wrote C code which used HLLAPI as the basis for such a task. Is HLLAPI still the best way to ap...

Resumable downloads when using PHP to send the file?

We are using a PHP scripting for tunneling file downloads, since we don't want to expose the absolute path of downloadable file: header("Content-Type: $ctype"); header("Content-Length: " . filesize($file)); header("Content-Disposition: attachment; filename=\"$fileName\""); readfile($file); Unfourtunately we noticed that downloads pass...

What's the difference between SHA and MD5 (in PHP)?

When you're hashing a password (or anything else) in PHP, does it make any difference if you use SHA or MD5? ...