php

How to create a "pending" order in authorize.net?

I'm a web developer looking to move a lot of clients to use authorize.net for their CC processing. I have used authorize.net once in PHP doing SIM integration for a simple site. Now the problem is, some of our clients have established processes that takes the CC info from our site, and it goes through a fulfillment process outside th...

Best Practice : Import CSV to MYSQL Database using PHP 5.x

Howdy Folks, what is the best solution to import large amounts of records into an MySQL or Oracle Database. I Think there are two ways : Insert every record with an persistent connection Create on BIG SQL-Statement and query the Database Iam not sure wich is performing better ? Is there any Best Practice Solutions for this kind of o...

How do you build a web based email client using PHP?

I would like to learn how to build a web-based email client in PHP (similar to yahoo and gmail). Does anyone know how I can get started with this? I would like my system to be able to send and receive email. ...

Two seemingly identical CSV files, only one works

After updating to php 5.3 one of our systems has developed an interesting bug. It parses csv files and the first step is to show the user what they have uploaded to check it over before confirming. However we have run into a bug where some files upload, but aren't read. The weird thing is if we take the data from those files, copy and p...

Weird stuff when outputing XHTML using SimpleXML

Hi, I'm trying to use SimpleXML to output a well-formed XHTML document. I'm doing it like this: $pbDoc = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; ...

Translucent Image Reflection in PHP GD

Alright, I've been hacking around with GD Image for a couple of months, and a task that I wanted to accomplish with it was to create a script that takes an existing image, and then creates a reflection that fades out to translucent beneath it. The following guide shows how to do it with an opaque color : TalkPHP Forums Link In that fo...

Php array post values dificulties

Hello, I cant seem to understand why I cant pass any values with the following code: <div class="menu"> Por favor seleccione os conteúdos: <form name="Categorias" action="Elementos_Descritivos.php" method="post"> <?php $Categorias = array ("Nome", "Data", "Cliente", "Observacoes"); foreach( $Categorias as $key => $value){ echo "<di...

Passing Captivate Parameters

I want to track when users have viewed a Captivate (Flash 10.0) video tutorial. In order to do this I need to pass two parameters (employee ID and which tutorial) and have the video call a url with the passed values when it's done. I think I can pass the parameters to the turorial when it starts but I'm not sure how to get them back out ...

How to minimize the load in queries that need grouping with different invervals?

I'm looking for a best practice advice how to speed up queries and at the same time to minimize the overhead needed to invoke date/mktime functions. To trivialize the problem I'm dealing with the following table layout: CREATE TABLE my_table( id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT, important_data INTEGER, date INTEGER);...

URL segment - User Profiles - Codeigniter

Hey guys, I'm trying to create user profiles for my site where the url is something like mysite.com/user/ChrisSalij Currently my controller looks like so: <?php class User extends Controller { function user(){ parent::Controller(); } function index(){ $data['username'] = $this->uri->segment(2); if(...

Support for IMAP IDLE in PHP

I have read through all PHP documentation on IMAP functions (www.php.net/imap), but didn't find anything on issueing an IDLE command over an IMAP connection. I want to establish an IMAP connection between my server and GMail, and be notified instantly that a new message has arrived. It's kind of GMail PUSH to my server. The way mobile d...

best php config / ini class?

Hi, I'm looking for an alternave to the parse_ini_file() function in php. I want a simple way to store config settings, but want the flexibility to store unlimited levels of multiple arrays, special characters, etc. Any ideas? ...

PHP Classes: get access to the calling instance from the called method

Hi, sorry for that weird subject but I don't know how to express it in an other way. I'm trying to access a method from a calling class. Like in this example: class normalClass { public function someMethod() { [...] //this method shall access the doSomething method from superClass } } class superClass ...

KCachegrind interpretation confusion

Hey! I am trying to understand the values shown in Kcachegrind in the left panel I have Incl. (which I read in the manual is inclusive), Self, Called an Function Now I am analyzing this cachegrind file and I have Incl. ---- Self ---- Called ---- Function 100.05 ---- 0.04 ---- (0) ---- {main} 83.38 ---- 0.07 ---- 250 --- item->close...

How are PHP sessions saved by default?

I have not changed any of the configuration options for sessions in my php.ini. session.save_handler = "files" session.save_path = "" session_save_path() = "" From what I read, if I change php.ini to something like, session.save_path = "c:\tmp\", all the session will be stored as files in c:\tmp. My question is, how/where are t...

div not inserting correctly problem jquery

I seem to be having a problem inserting a <div> element in the correct area. I want to push a button, in this case "more info" and display more information under the first div area using jquery. example: <div id="Main-info"> <div id="more-info"> </div> </div> The problem I'm having is the "Main-info" area is calling a php...

simple preg_replace() that I can't get working (i suck at regex)

$count_sql = preg_replace("/SELECT(.+?)FROM/", "SELECT COUNT(*) FROM", $sql); It's probably pretty obvious what I'm trying to do, but I am terrible with regex. I need to replace anything between SELECT and FROM with COUNT(*). Tried using (.+), (.+?), (.*), and (.*?). ...

PHP/MYSQL AJAX Chat

Looking for an open source php/mysql ajax chat room (not 1-to-1 private chat). What would you guys recommend? I am going to need to make hundreds of instances of the chat room (eg. each user group has their own exclusive chat room) ...

How do I install/use the phpize command?

I am intending to use SQLite 3 with PHP 5. I found this: http://packages.debian.org/etch/web/php5-sqlite3 but I am having problems with installation: unzip & untar the package run "phpize" run "./configure --with-sqlite3=/path/to/your/sqlite3/install make && make install (optionally) copy DB/sqlite3.php to /path/to/php/lib/php/DB/sqlit...

Doctrine raw sql and prepared statements

I've got a Doctrine_RawSql query using prepared statements. However, they seem to get ignored when the SQL query is generated. But If I leave out the token values, I get an exception about number of bound variables not matching (so it's at least trying to sub them in). If I include these values inline, is Doctrine doing anything behind ...