php

Zend_Pdf table?

Is it possible to create a table in Zend_Pdf? If yes, could you give me some code snippet? I've tried searching documentation and devzone but I couldn't find anything about adding tables to pdf. ...

Web Programming language for very large lists?

Hello, In your experience, what is the best web programming language used to handle sorting and comparison of very large lists (ie tens of thousands of email addresses)? I am most familiar with PHP. I think that it could get the job done, but I'm unsure of other languages and if there might be a bettor suitor. Thanks! ...

Issue with post data not received in a php page

hi, I created a page in Wordpress (http://www.exam-vision.com/testmail) that sends POST data to itself in order to send an email. The code is shown below. While it seems that data are sent properly, it seems that they are not received since isset($_REQUEST['email']) is always false. Anybody could help? UPDATE: it seems it has something...

php: showing my country based on my IP, mysql optimized

I've downloaded WIPmania's worldip table from http://www.wipmania.com/en/base/ -- the table has 3 fields and around 79k rows: startip // example: 3363110912 endip // example: 3363112063 country // example: AR (Argentina) So, lets suppose i'm in Argentina and my IP address is: 200.117.248.17 1) I use this function to convert my ip to...

Problem getting real IP in php

I am using this to get real IP but I take empty from $_SERVER['HTTP_CLIENT_IP'], I take not empty only from $_SERVER['REMOTE_ADDR'] .But I dont need the IP of proxy, I need the real ip of computers using some intranet. Can I get it? When $_SERVER['HTTP_CLIENT_IP'] does not return empty? function getRealIpAddr() { if (!empty($_SERVER...

LOAD DATA INFILE not working with FIELDS TERMINATED BY

I'm using the sql below in a php script: $sql1 = "LOAD DATA LOCAL INFILE 'test1.csv' INTO TABLE number1 (order_num,pname)"; $sql2 = "LOAD DATA LOCAL INFILE 'test1.csv' INTO TABLE number1 (order_num,pname) FIELDS TERMINATED BY ':'"; if ($result = $mysqli->query($sql)) { printf("<br>Section 4: %s",$mysqli->error); printf("|$result...

Secure PHP authentication system

This has been asked many times, but none of the answers are satisfying, I looked online for secure tutorials but I have not found something good enough you would want to use in an important website. It just seems like there are so many ways to get around security. Does anyone know of a GOOD one? What do you guys do when you build a webs...

OOP 101 - quick question.

I've used procedural for sometime now and trying to get a better understanding of OOP in Php. Starting at square 1 and I have a quick question ot get this to gel. Many of the basic examples show static values ( $bob->name = "Robert";) when assigning a value, but I want to pass values... say from a form ( $name = $_POST['name']; ) clas...

Running javascript in AJAX loaded DIV

I have page loading, via AJAX a PHP page into a div. In turn, this loaded page has it's own javascript and AJAX loaded div. Reason is to allow user to select data > alter data within loaded data. I'm trying to do this without the help of JSON or such to communicate between JS and PHP. I'm guessing the parent calling page has already l...

Paginating data, has to be a better way

I've read like 10 or so "tutorials", and they all involve the same thing: Pull a count of the data set Pull the relevant data set (LIMIT, OFFSET) IE: SELECT COUNT(*) FROM table WHERE something = ? SELECT * FROM table WHERE something =? LIMIT ? offset ?` Two very similar queries, no? There has to be a better way to d...

Php exec() return code is -1 when in a forked process, but 0 in a normal script

I am using exec() inside a a script that runs as a daemon and forks child processes using the pear class Net_Server. I am getting a strange issue whereby the return code (the third param of of exec) comes back as -1. When I run the command on the command line, or with exec in a normal php script the return code is 0 as it should be. An...

PHP & JavaScript source code formatters (prettifiers) - NATIVE only apps!

Hi, I know at least two PHP source prettifiers and one for JavaScript, but all of them are written in those languages - PHP prettifiers in PHP, JavaScript in JS ;] Now what I'm looking for is a prettifier for those languages which is a native application - can be C/C++ or Pascal, so that I can run it from commandline. Possibly open so...

iDev's PhpFormMail script

I'm using iDevSpot's PHPFORMMAIL Script (http://www.idevspot.com/PhpFormMail.php) and having trouble. I've edited the correct things, however, when it says "Email Sent" nothing is received by the recipient or the sender...don't know what's wrong...any ideas? Here's the code that I'm using. <?PHP if ($_GET[send] < 1) { ?> <?php include...

PHP or C# script to parse CSV table values to fill in one-to-many table

I'm looking for an example of how to split-out comma-delimited data in a field of one table, and fill in a second table with those individual elements, in order to make a one-to-many relational database schema. This is probably really simple, but let me give an example: I'll start with everything in one table, Widgets, which has a "stat...

Get all text between tags with preg_match_all() or better function?

2010-June-11 <remove>2010-June-2</remove> <remove>2010-June-3</remove> 2010-June-15 2010-June-16 2010-June-17 2010-June-3 2010-June-2 2010-June-1 I'm trying to find all instances that are between the <remove> tags This is what I have: $pattern = "/<remove>(.*?)<\/remove>/"; preg_match_all($pattern, $_POST['exclude'], $matches); fore...

handle json request in PHP

When making an ajax call, when contentType is set to application/json instead of the default x-www-form-urlencoded, server side (in PHP) can't get the post parameters. in the following working example, if I set the contentType to "application/json" in the ajax request, PHP $_POST would be empty. why does this happen? How can I handle a ...

[PHP] access array element by value

array( [0] name => 'joe' size => 'large' [1] name => 'bill' size => 'small' ) I think i'm being thick, but to get the attributes of an array element if I know the value of one of the keys, I'm first looping through the elements to find the right one. foreach($array as $item){ if ($item['name'...

Zend Form: How to pass parameters into the constructor?

I'm trying to test my form. It will be constructing other objects, so I need a way to mock them. I tried passing them into the constructor... class Form_Event extends Zend_Form { public function __construct($options = null, $regionMapper = null) { $this->_regionMapper = $regionMapper; parent::__construct($options...

Doctrine 1.2 Column Naming Conventions for Many To Many Relationships

I'm working with an existing database schema, and trying to setup two Doctrine models with a Many to Many relationship, as described in this document When creating tables from scratch, I have no trouble getting this working. However, the existing join tables use a different naming convention that what's described in the Doctrine docume...

print_r() and mail() in PHP outputs something different, why?

I have a html form where visitors can fill and send me some information, as an e-mail. It sends like this: $body = print_r($_POST, true); mail ($to, $subject, $body, $headers); When they write abc'def I get abc\'def What is this additional \? How I can prevent it? ...