php

Are SAP's BAPI APIs propritary, or just a wrapper for something else?

So, I've just been dumped into the middle of a project involving SAP. Specifically, I need to use SAPs BAPI APIs to pull a bunch of information out of "The Client's" SAP system. Given that SAP is a closed platform, I've been having trouble finding a high level overview of the who/what/where/when/how of SAP and BAPI. Specifically Is B...

mssql_bind empty string converting to NULL

I am currently using SQL Server 2000 Stored Procedures with PHP. Following the PHP doc, I use mssql_bind to assign value of parameters and then execute the Stored Procedure. The problem is that I got this bug which prevents me to bind empty strings to parameters (they are converted to NULL when the Stored Proc gets called) I dont't wan...

Saving the State of a System

A very flowery title indeed. I have a PHP web application that is in the form of a web based wizard. A user can run through the wizard and select options, run process (DB queries) etc. They can go backwards and forwards and run process again and again. I am trying to work out how to best save the state of what users do/did, what proces...

Is it possible to extend a class dynamically?

I have a class which I need to use to extend different classes (up to hundreds) depending on criteria. Is there a way in PHP to extend a class by a dynamic class name? I assume it would require a method to specify extension with instantiation. Ideas? ...

How to get the highest and lowest value items of an array?

In an array like this: $array['abc'] = 10; $array['foo'] = 90; $array['bar'] = 0; $array['baz'] = 50; How can I retrieve the highest value item (90 in the above example) and the lowest value (0 in above example)? ...

Building a CodeIgniter GUI Installer

I'm building a self-hosted web app using CodeIgniter and I need a nice GUI-ified installer which will present the user with a form for database info, validate and test the info, write that info to the database.php config file, and then set up the DB structure. Any tips for this? Should it be inside of CodeIgniter (as a Controller perhap...

MYSQL table structure

I am trying to decide whether to create a global view table or 1 for each section. for example, Lets say I have products, categories and pages. Do I have 3 tables e.g: CREATE TABLE `tbl_products` ( `p_id` INT NOT NULL , `p_views` INT NOT NULL , INDEX ( `p_id` ) ) ENGINE = MYISAM CREATE TABLE `tbl_categories` ( `c_id` INT NOT NULL , ...

Function does not return correct resource.

Guys, hi. I have this fuctions: function query_dp($sql){ $link = mysql_connect('localhost', $bd_id, $bd_pass); mysql_select_db("$bd"); if (!$link) { die('Could not connect: ' . mysql_error()); } return mysql_query($sql) or die(mysql_error()); mysql_close($link); } ?> In the main program, when i t...

Doing serverside validation then posting to remote script

Hi folks, I had thought I would use curl for this but it looks like I was mistaken. What I need to do is catch a post and do some database lookups for validation purposes and then post the validated data to a remote URL. I have done this by populating an html form and submitting it using javascript but this has obvious flaws. I want ...

How do you setup Codeigniter to handle multiple projects with shared ci base?

Hello, I've seen several CI implementation examples that claim you can put project folders under the "applications" folder for Codeigniter. However I've not been able to see this work as promised. Here is what I have done and what I would like to do - maybe you can help out. For the sake of argument my document root is /www/(It's not,...

How to get nodes in first level using PHP DOMDocument?

I'm new to PHP DOM object and have a problem I can't find a solution. I have a DOMDocument with following HTML: <div id="header"> </div> <div id="content"> <div id="sidebar"> </div> <div id="info"> </div> </div> <div id="footer"> </div> I need to get all nodes that are on first level (header, content, footer). hasChild...

php: timing a script

When running a micro time and catching it at the start of the a script then at the end of a script why does the time change every time you run the script? Does it have to do with other items running? How it was processed? ...

Validate URL in PHP using ereg

I am validating URL using ereg method. Here is my code: function validationURL($URL) { if (ereg("^(http://www|www)[.]([a-z,A-Z,0-9]+)([-,_])([a-z,A-Z,0-9]+)[.]([a-z,A-Z]){2,3}[.]?(([a-z,A-Z]){2,3})[/]?[~]?([/,a-z,A-Z,0-9]+)?$",$URL)){ return true; } else { return false; } } if ($website !="" && $website !=N...

Inserting something at a particular line in a text file using PHP

I have a file called config.php, I want it to remain exactly as is, however on Line # 4 there is a line saying: $config['url'] = '...could be anything here'; I'd like to only replace the contents of line # 4 with my own url provided for $config['ur'], is there a way to do this in PHP? ...

Determining Smartphone / Non-Smartphone for php

It seems like facebook has this mastered, I've checked a bit into WURFL but this seems like an extremely expensive process. I've also checked out: url link. While it has a good list of user agents, I'm trying to identify which are smart phones and which are not. facebook pushes the non-smart phones to a different site than their smart ...

PHP imagegrabwindow GD Library returns only black images...

Hi There I am hoping that there is someone that can help me and many others with this problem... I want to create a screenshot of a website using the imagegrabwindow function part of php and the GD library After spending the whole day implementing the code I finally can capture the image and save it to a file, but the image is black a...

basic question about php multiple FOREACH loops

Hello! I have few FOREACH loops in php; $c1 = 1; $c2 = 1; $c3 = 1; foreach ($someArray as $a){ echo $a; if (sizeof($someArray != $c1){ echo " / "; } $c1++; } foreach ($otherArray as $b){ echo $b; if (sizeof($otherArray != $c2){ echo ", "; } $c2++; } // etc. This seems somehow stupid, of cou...

How to "fork" a video conversion process into background, in php?

I have a batch flash upload script, that uploads video files to a dir. Simple. After the upload completes, it creates a mysql record for that file, and moves on to the next file in the queue. Just before it does that, I want it invoke a background process that will convert the uploaded avi avi file to an ipod compatible mp4 file, as wel...

editing mysql table with html form

My aim is to have a simple, form based CMS so the client can log in and edit the MySQL table data via an html form. The login is working, but the edit page isn't returning the values from the MySQL table, nor am I getting any errors. I'm still amateur, and I first started the following code for a class project, but now plan to implement...

jquery & php poll in Blogger

Would it be possible to use a poll like this in Blogger? Link: http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-dynamic-poll-with-jquery-and-php/ ...