php

Getting the results of pdftotext into a php variable, not a text file

pdftotext takes a PDF file and converts the text into a .txt file. How would I go about getting pdftotext to send the results to a php variable instead of a text file? I'm assuming I have to run exec('pdftotext /path/file.pdf') but how do I get the results back? ...

PHP mail() attachment not opening in Mac mail

I am sending an email using PHP mail() and I can successfully receive and open the attachment (in this case a pdf) in almost every program i have access to. Except in mac mail where I am told that the file is corrupt. Has anyone else run into this problem before? Below is the script I am using: //define the receiver of the email $to = '...

Drupal Registration: Avoiding A Password

I'm not new to Drupal module development, but am new to the security system. Our users authenticate via a system-wide NetID, so we don't need or want a password. We do, however, still need a local user account so users can post, change their profile, etc. Because we needed this change fairly quickly, I've modified the /modules/user/user...

custom reports for ilias LMS

I am working with a Learning Management system called Ilias (http://www.ilias.de/). I have a request from to generate a custom report that will break down all the users and the scores for each question. Does any one know where I can find this information in the data base? There is currently no database models built, so its difficult ...

Vacuum PostgreSQL DB from PHP

I want to vacuum a PostgreSQL database from PHP. I have tried this: pg_query($conn,"vacuum analyse;"); How can I tell if this works? ...

Echo/print a jpg-image with php, for safety?

Because of safety (check if user are logged in), I call a php-document when showing images. <html>... <img src="showImage.php?id=455" /> ...</html> showImage.php: <?php... if($_SESSION['user']){ //Get the src to the image $_GET[$id] = mysql_real_escape_string($_GET['id']); $result = mysql_query(" SELECT src ...

preg match for nested tags

I would like to catch all "dev" tags and their respective content, through php preg_match_all() but can't get the nested ones. data: <dev>aaa</dev> <dev>bbb</dev> <dev> ccc <dev>ddd</dev> </dev> my expression so far: |<dev>(.*)</dev>|Uis thanks, for your help, b. ...

javascript with XMLHttpRequest's open method: using post and its parameters

Users of my website will, ideally, be sending a few hundred posts to a db server over the course of about an hour (basically its an online-experiment). The experiment is implemented in js, so I'm trying to use an XMLHttpRequest object to post the data the script collects. The thing I'm uncertain about is how to use the POST parameter. I...

How to pass variable number of arguments to a PHP function

I have a PHP function that takes a variable number of arguments (using func_num_args() and func_get_args()), but the number of arguments I want to pass the function depends on the length of an array. Is there a way to call a PHP function with a variable number of arguments? ...

HTTP Post fields are not received by PHP script

I feel stupid asking this question, but I've been wrestling with it for hours and I don't know where else to turn. I have a flash form that is making a POST request to a php script, and then displays the output of the said script. For the sake of simplicity, let's say this is the php script: echo 'Mail sent to: ' . $_POST['recipientEm...

Represent MD5 hash as an integer

Hello! In my user database table, I take the MD5 hash of the email address of a user as the id. Example: email([email protected]) = id(d41d8cd98f00b204e9800998ecf8427e) Unfortunately, I have to represent the ids as integer values now - in order to be able to use an API where the id can only be an integer. Now I'm looking for a way ...

need help creating urls with year and month

I need to create next and previous link urls here's a sample <a href="/calendar/2009/10/">previous</a> <? echo $_GET['month'].', '.$_GET['year']; // shows 11, 2009 <a href="/calendar/2009/12/">next</a> where the 2nd segment is the year and the first segment is the month I've got the month and the year in the GET array, but any ideas...

Why won't eclipse run my php file?

I'm running eclipse galileo (5.5) with PDT 2.1.2. I have "PHP Executables" pointed to /usr/bin/php, which outputs: $:/usr/bin$ php -version PHP 5.2.6-3ubuntu4.2 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21 2009 19:14:44) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies I have crea...

Generating PHP/MySQL Reference ID

In PHP/MySQL, what's the best way to generate a unique reference ID so that when a person submits his info to the database, he gets a reference number to follow up with his request? I am already using the auto-increment feature from the database since the data needs to be unique every time a user submits information, but then I need to ...

Convincing Coworkers To Use MVC

I'm about to start working on a new project at a somewhat new job, and I've run into a bit of a problem. They're not big fans of MVC. The reason why this bugs me is that they claim they're currently using the Zend Framework when they're really not. They're barely using the DB model classes, and that's about it. No MVC, no extending of Z...

Print PHP Call Stack

I'm looking for a way to print the call stack in PHP. Bonus points if the function flushes the IO buffer. ...

PHP function name on the fly

Hi guys, I have a rather stupid PHP question :D! I would like to simplify the following statement: function hello_input() { return 'Hello World'; } $helper = 'hello'; $helper = $helper . '_input'; $data = $helperinput(); The specific part I want to simplify is the adding of the _input to the $helper so it calls the right functi...

What is WebORB for PHP?

What is the WebORB for PHP runtime environment? It supposedly connects Flex, Flash, AJAX and Silverlight clients with PHP classes and data from relational databases. It seems to support AMF (Flash<>PHP data exchange), is the entire product built around this? Does it use sockets? or is it just an AMF service? Does it run as a backgroun...

How do I use PHP to send users to specific pages based on where they are coming from.

Hey everyone. What I want to do, is use PHP to forward users to specific pages based on where they are coming from on my site.(basically this is a next button functionality) So what I'd like to do is have PHP check the referring url and then forward based on that value. Something like this:(note I can't post multiple urls, so imagine ...

Platform-independent permalinks - best practices?

I'm trying to figure out a generic permalinks structure for blogging, in order to be platform-independent. I know that Wordpress supports permalinks, and has some plugins for various permalinks style migration, but I also have to get it working in FlatPress and PivotX, and I don't have URL rewriting support in every place. So far, I wil...