php

Using foreach to create grid

Hello, I am creating a grid in GD and was wondering if this is the right way to do it. I have 2 arrays. One contains all X values, the other contains all Y values. foreach ($xpointsArray as $xvalue) { foreach ($ypointsArray as $yvalue) { // Draw point at coordinates $xvalue, $yvalue } } I just think there must be a more el...

Is referencing and calling methods via strings in PHP a bad idea?

I've always worry about calling methods by referencing them via strings. Basically in my current scenario, I use static data mapper methods to create and return an array of data model objects (eg. SomeDataMapper::getAll(1234)). Models follow the Active Record design pattern. In some cases, there could be hundreds of records returned, an...

How to make a static URL point to different servers?

Im building multi-server support for a file upload site Im running. When images are uploaded.... they are thumbnailed and stored on the main front-end server, until cron executes (every 10 mins) and moves them to storage servers, so for the first 10 mins, they will reside, and be served off the main front-end server. When a file is uplo...

PHP login class

I'm looking for a good PHP login class via MySQL, and I'm not yet completely satisfied with anything I've found. This prior SO question doesn't really address my needs, as I'd prefer to stay away from PEAR and CodeIgniter, and just have a simple and small PHP class to do the job. There's a TalkPHP forum that has several to choose from, ...

Friends Invitation Plugin - Hosted or PHP

I'm wondering if there's a good "hosted" solution for managing friend invites (ala LinkedIn) I know of AddThis, but unless I'm mistaken that looks geared towards sharing specific articles/content. I'm looking for something that could be integrated neatly into the sign up process, with minimal added coding effort. Just need simple gra...

Is there an easy way to programmatically list all the message IDs in a .MO file?

I have a big ol' .po file containing all the user-facing strings I need for my PHP app. I'd like to know if there's a PHP function I can use to get a list of all the msgid strings stored in the .po or the .mo. I didn't see a published PHP function that does this. Anyone know of something similar, or will I have to manually parse my ...

Parsing a string within a string?

I have a function which accepts a string parameter such as: "var1=val1 var2=val2 var3='a list of vals'"; I need to parse this string and pick out the var/val combination's. That is easy enough until introducing something like var3='a list of vals'. Obviously I can't explode the string into an array using a white space delimiter which ...

Big problem with wordpress pages, will not scroll in IE7

Ok guys, this is re-visited, Ive rescued my website from the hackers and now its virus and malware free, thank you to all who pointed me in the right direction to fix it. However my first problem still remains, the page in question is http://www.whatcouldicook.com/wordpress Ive removed the extra quick search at the top including the RS...

PHP +redirecting with sessions

Hello, i'm trying to make my site with a few languages. Every page includes config-file, wich checks variable 'lang' in session. If it doesn't exist, wi'll be redirected to the page of lang choosing. After choosing u'll come to the page before. But it works only in Mozilla Firefox. In other browser after language checking i always get th...

What happens to the Zend Framework routing tables when you change the site to a subfolder?

Does anyone know exactly what happens when you change your Zend site at, say, foo.com/ to foo.com/subfolder/ ? I notice that routing breaks and either I am not using front_controller.setBaseUrl() properly or it has no effect. I am unable to find any formal documentation at the Zend site about this issue. ...

Single Autonumber Instead of Multiple Key

Is there a reason to use a single incrementing field for a primary key instead of multiple fields that actually represent the unique record? I'm working on an existing php application, and the tables all seem to have a single 'id' key instead of using the 2 or more fields that are actually unique to the record (like user, auction, bid)...

How can I do some server-side processing after a button click and then redirect user to a page and POST variables to that page?

I've got a product page set up where you click a product (radio button) and click checkout with Paypal. What I'd like at this point is to create the purchase in the database (add the table row with purchase details, minus the Paypal receipt id), then send the user to Paypal to pay. When user returns to the site the receipt id will be add...

AIR: sync gui with data-base?

I am going to be building an AIR application that shows a list (about 1-25 rows of data) from a data-base. The data-base is on the web. I want the list to be as accurate as possible, meaning as soon as the data-base data changes, the list displayed in the app should update asap. I do not know of anyway that the air application could be n...

php variable inside another variable

I have a variable that im define with another variable and some text. $title = "New Amsbrook School" //demo text $message = "$title just added, Congrats!"; Echoing of $message returns New just added, Contrats! Problem is if there is a space in $title, it breaks and doesnt show the rest of the contents. ...

Why would IE/Fiddler see different cookie setting/deletion from Chrome and FF/Live HTTP Headers?

I have a partly inherited web application in PHP and after poking around with Fiddler I have a little more data than before. The problem I'm trying to solve is unwanted logouts on IE6/8 but not FF/Chrome. If a user clicks between different pages, the login data cookies vanish. The behavior is different in FF vs. IE, and the reported inf...

What is the easiest way to turn a mysql result variable into a multidimensional array in php?

What is the easiest way to turn a mysql result variable into a multidimensional array in php? Thanks ...

How to capture a website API traffic data with Google Analytics?

I have a website where most of the traffic comes from the API (http://untiny.com/api/). I use Google Analytics to collect traffic data, however, the statistics do not include the API traffic because I couldn't include the Google Analytics javascript code into the API pages, and including it will affect the API results. (example: http://u...

Retrieve text from TextArea!

Hello again and thanks for your effort! Since my previous question wasn't successful I thought I'd give it another approach.So the basic idea is to update my calendar event on mysql: $eventQuery = mysql_query("SELECT id, body FROM tblCalEvent WHERE id= '$eid'", $conn); which sits separately on a PHP file and works fine by returning...

Settings for uploading large files (video/mp4)?

Background: I'm planning on using the JW FLV Media Player for streaming some videos: http://www.longtailvideo.com/players/jw-flv-player/ Question: What settings, both PHP globals and php.ini, would I need to change in order to handle the uploading of large video files? Sub-question: Is there anyway, through maybe the .htaccess file, th...

How would I use an audit trail to display which fields have ever been edited?

For a project I am working on, I have been asked to create an audit trail of all changes that have been made to records. This is the first time I have had to create an audit trail, so I have been doing a lot of research on the subject. The application will be developed in PHP/MSSQL, and will be low-traffic. From my reading, I have pre...