php

Drop list options and submitting php page to self...

I have a php "add classified" page where users may fill in details in several drop-lists. At the bottom, I have a picture upload tool, which requires the page to submit to itself, and then preview that image. Problem is, whenever this is done the drop lists values are resetted, so the users have to re-select everything. I have asked th...

PHP Validation - passing http POST values forwards to a 3rd party checkout

I don't know whether this is possible, I can't seem to find any other help guides so this may not be possible... I have a checkout page which POSTs a load of variables forwards to a 3rd party payment processor (WorldPay). I want to know if it is possible to put a PHP script of some sort inbetween the two pages for validation purposes. ...

Require constant-defining files at once or by utilisation in PHP?

I have about 20 files containing 10-15 times this: define('someConstantName','stringBetween10and200Chars'); those are all critical for the app, but each constants-file is parallel to an app page. For example, index.php will require index_constants.php so on so forth. The question is, should I make one file of all constant-definition...

Integrating Python or Perl with PHP

I'm going to help my friend in a improve of his phpBB board, but I want to make somethings there in Python or Perl. But it's possible to integrate these languages with PHP? ...

How to I use ajax and PHP to create and populate div elements?

Hello, I asked a similar question earlier here, and it got me down the right track, but I am little stumped still. However, now I know how to ask a more educated question. I have a database I connect to, with a table name of PRODUCTS. Within PRODUCTS are the columns ID, STOCK, SHORTNAME, DESCRIPTION, PRICE and SHIPPING. If the user cl...

htaccess mod_rewrite

I'm trying to put something with this, whenever I go to a page like: www.site.com/character.php?id=3 I want the mod rewrite to change it to: www.site.com/character/Jim_Carrey Which of course, the ID is the row of the character name... For that kind of example... I've tried to work with it, but don't seem to get most of the productio...

How to write "if something -> print" "else if nothing -> print nothing"

I am writing a php function for wordpress that is executed through an XML feed. Therefore we are excepting a feed and then based on the nodes placing those in our website. What I need help with is we have a bunch of different images of credentials (i.e BBB, chamber of commerce etc) What I need therefore is when there is a link to a BB...

Illegal offset type

Hello, I am having trouble uploading a file through php. I check the file type at the beginning of the process and I get an error. This is the error I am getting: Warning: Illegal offset type in /balblabla/DBfunctions.inc.php on line 183 This is the printed out $_FILES var Array ( [Picture] => Array ( [name] => ...

PHP: How to chain method on a newly created object?

I would like to know whether there's a way to chain methods on a newly created object in PHP? Something like: class Foo { public function xyz() { ... return $this; } } $my_foo = new Foo()->xyz(); Anyone know of a way to achieve this? ...

PHP check if variable is a whole number

I have this PHP code: $entityElementCount = (-($highScore-$totalKeywordCount))/0.29; What i want to know is, how to check whether $entityElementCount is a whole number (2, 6, ...) or partial (2.33, 6.2, ...). Thank you! ...

php: usage of define

in Yii they use this code: defined('YII_DEBUG') or define('YII_DEBUG',true); i've never seen anyone write like this before (or). is this real php code or some syntax of yii? ...

php + jqgrid + export to excel

Somebody knows a way to export the data from a jqgrid to excel? I want to do a report using this jqgrid that i think is awsome. But i need to save or print this report somehow, because is information to be keeped. Somebody knows any way?? ...

Trying to insert IP address but get an error.

I'm trying to insert IP addresses into LastIP(An unsigned integer) INSERT INTO user_entry (UPC, StateID, StoreID,CityID,Price,Count,LastIP) VALUES (885909301378,1,1,1,170,0,INET_ATON(127.0.0.1)) Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to...

Learn Very Fast The PHP Basics

I'm needing to help my friend with his big phpBB board, but I want first to learn the basics of PHP very very fast. I just want to learn the basics to go and improving with some more time. In the books you need to take time to read, but I need to learn more faster, there is any suggestion? ...

Parse whole html document and replace specific parts of it automatically PHP

Greetings, Iv'e made a rapid search in the previous questions but did not find an adequate answer for my question. I have create a function that finds words in an array library and replace these by links to the description of the word. Example : $words = array("ANTIM","APDIV","APVEG","ARCHE","ARFEU","ARMUR", "ARSUP","ARTHE","ARTIL","...

What'd be a good pattern on Doctrine to have multiple languages

Hi! I have this challenge which consist in having a system that offers it's content in multiple languages, however a part of the data contained in the system is not translatable such as dates, ints and such. I mean if I have a content on the following YAML Corporativos: columns: nombre: type: string(254) notnull: tr...

How would I translate this C# code into PHP? Solve the mystery of someone's crappy API doc!!

I was handed an software doc (or what passes for proper documentation nowadays). Much to my chagrin, it might as well have been gently used piece of toilet paper from the men's room. Needless to say, the contents of said doc left much to be desired. So, I am left with a great mystery. This doc describes some sort of API; or so I'm to...

postgresql nextval question on sequences

Hi, I am trying to work with postgresql 'nextval' in PHP. How can I fill in the parenthesis in the third line in order to replace TXN_ID with the value of nextval('schemadb.audit_txn_seq')? $DB->query("SELECT nextval('schemadb.audit_txn_seq')"); $DB->query('SET CONSTRAINTS ALL DEFERRED'); $DB->query('SELECT schemadb.undo_transaction(TX...

Problem with CodeIgniter. DX_Auth not working when deployed...

So we're currently using CodeIgniter + DataMapper OverZealous Edition + DX Auth. It is working on our local machines, as well as our staging server. As soon as we push to their server though, the login doesn't work at all. Upon further investigation, the data from the form is not coming in to the controller where we do our authenticat...

Is there a better way to include() a PHP loop that depends on a varying MySQL query?

I have a large PHP loop that I'm re-using in multiple spots on multiple pages of my site. I'd normally just use an include() to set that PHP loop wherever it's needed, but the PHP loop in question makes use of a MySQL query in which I need to change variables (different filters and different LIMITs) for different instances of this PHP l...