php

Codeigniter Character Encoding Issues

Dear StackOverflow Community, I am running Codeigniter. I have a few simple pages which have no DB data, are just static loaded as following from the controller. I have set everything possible to UTF-8 - I have checked headers which result to UTF8 - however it still parses wrong (these characters: ���). function index(){ $this->l...

PHP object keeping

Let's say that in my app I have an object instance created on page 1. The user then goes to some other part of app and I want the instance to remain. How can I 'save' the instance? Sessions? ...

Stop people uploading malicious PHP files via forms

I have an upload form created in php on my website where people are able to upload a zip file. The zip file is then extracted and all file locations are added to a database. The upload form is for people to upload pictures only, obviously, with the files being inside the zip folder i cant check what files are being uploaded untill the fi...

Design Tips for PHP Function Include Files

Good design dictates only writing each function once. In PHP I'm doing this by using include files (like Utils.php and Authenticate.php), with the PHP command include_once. However I haven't been able to find any standards or best practices for PHP include files. What would you at StackOverflow suggest? I'm looking for: Naming St...

How can I get Flash to share the browser cookies/session?

I'm building a PHP-based web app and am integrating a Flash-based charting engine. The Flash chart needs to make a AJAX request for its data. This request fails because it is seen as a new user agent and doesn't contain the PHP session cookie to identify it. So, it gets redirected to the login page. I've read a few hacks to make this...

PHP client calling .net 3.5 sp1 web service

I need to create a web service that a PHP client can call. The service needs to accept 1 or many integers, provide security, and does not need to return any data (though other similar services may need to). This particular service will is intended to trigger a data extract that will be picked up later. My manager believes that creating ...

"infinite" sql statement?

Hi there, I've got a very strange sql-related problem. I'm accessing a MSSQL Server 2005 with PHP (odbc), when I profile the sql statement the following is executed: declare @p1 int set @p1=180150003 declare @p3 int set @p3=2 declare @p4 int set @p4=1 declare @p5 int set @p5=-1 exec sp_cursoropen @p1 output,N'SELECT fieldA, fieldB,...

How to implement chat using jQuery, PHP, and MySQL?

I have made a chat script using php, mysql and jquery. It uses json to get data from the server. It makes fixed interval requests to the server with the lastly fetched message id to get new messages from the server. But when multiple users will be chatting then thousands and crores of requests will be made to the server within an hour an...

How to group similar News

I'm trying to build a rss-news fetching server to collect all news of a few sites about a topic. Often these sites have similar news with nearly the same information. How would it be possible to group such news. For example display the first and then a summary of other links? Does anybody have experince with this? ...

Using comet with PHP?

I was thinking of implementing real time chat using a PHP backend, but I ran across this comment on a site discussing comet: My understanding is that PHP is a terrible language for Comet, because Comet requires you to keep a persistent connection open to each browser client. Using mod_php this means tying up an Apache child...

Choosing a Platform C#/MsSql or Php/Mysql or JSP or what?

Hi all, It seems like there are an inordinate number of really intelligent people here, so I thought it was the best place to ask a couple involved questions (shameless flattery). Your feedback on any item would be so appreciated. I am about to develop a very large web based operations, inventory, sales management system. I had inten...

PHP/HTML - isset function

Hi I'm fairly new to PHP and am creating a website for my company. I am using some existing code that I have obtained but can't seem to make it work properly - any help would be much appreciated! I have a variable, $id, which identifies the product category type to display on the page. I first need to check that the id variable has bee...

How can I apply jQuery statements to elements that are loaded in runtime?

I have a web page with one button and one div If you click this button that will load another button into the div using jQuery I found that the new button -which is loaded in runtime - will not be effected by other jQuery statements. how can I apply jQuery statements to elements that are loaded in runtime? I wish It is clear! if not ...

Why can't I store a PHP class instance as a SESSION variable

I have a PHP script that is called in 2 ways from a Dojo Ajax xhrGet call. The first time it is called with an "init" argument which causes the script to create an instance of the StateList class and read in a file of state names. session_start(); @include('StateList.php'); require_once('phplog.php'); //start executing here $comd=$_GET...

PHP Parse error (Beginner)

<?php #Console Application #Öppnar Fil. $file = fopen("words.txt","r") #Finns Filen? if(file_exists("words.txt")) { echo "Filen Finns"; } ?> Gives me error PHP Parse error: parse error in C:\main.php on line 7 What im going wrong? do you see the problem? ...

How do I embed Google Map (or other GIS mapping) output in a PDF as I generate it?

I need to generate PDF documents server-side that include a map, with markers and the like, but to my knowledge this isn't possible with Google Maps because of JavaScript reliance. Is there some way to use the Google Maps API for this, or is there some other free (or cheap) alternative with this capability and comparable functionality? ...

How to browse results with php mssql ?

I'm working with php and I want to do a next button that's step to the next 10 records (like when you browse question with stackoverflow) I don't know how to do that but I'm thinking to do it with Top n record ? Do you think that's a good idea ? Any suggestion? ...

PHP File Operations list

I'm looking for a list of each file operation. I Googled on http://www.google.se/search?q=Php+File+Operations, but didn't found anything. Do you know a where I could find a list of PHP file operations? $file = fopen("words.txt","**r**"); the r is once File Operation ...

Hiring PHP developers: Are PHP skills alone sufficient?

We are looking for people with decent PHP skills. Even though they are intended to program most of the time in PHP, I'm not sure that php experience alone is enough. Maybe I'm wrong but I cannot resist to hold that any good php developer eventually have become proficient in php programming because he learnt a more fundamental language li...

Zend Framework: Using Models and Views, best practices

I'm relatively new to Object Oriented Programming. I pretty much understand the concepts, but practically speaking, I am having a really hard time finding information about how to best use Models in my Zend Framework applications. Specifically, I have a Model (that doesn't extend anything) that doesn't use a Database Table. It uses gett...