php

submit file via form and handle it in a php function

I need to upload a file (in this case a csv file) and load the contents of it into the following function: function csv2xml($file, $container = 'data', $rows = 'row') { $r = "<{$container}>\n"; $row = 0; $cols = 0; $titles = array(); while (($data = fgetcsv($file, 1000, ',')) !== FALSE) ...

postgres update through php

I am a complete novice at php and postgres. I have been searching all over the net for an answer but no joy! I have a postgres table called workorders. It has a primary key (ident). I am trying to up date it using a php script/program. Basically the ident is the workorder number. I have written a php script where i type in the workorder ...

How to use ssl with codeigniter?

How can I have CodeIgniter load certain pages using ssl? I have an apache2/mode_ssl server. I only want certain pages to use ssl. mod_ssl uses a different document root than non-secure pages. For example: https (port 443) would serve pages out of /var/www/ssl_html/ And http (port 80) serves pages out of /var/www/html/. How would I get co...

Q & A site similar to stackoverflow in PHP

I am developing a Q & A Site for my students. I find stackoverflow an amazing example and would like to have something similar(if not this feature rich) for my course. I am a sytem programmer not much familiar with web-application development. How do I begin. Database scheme, features, AJAXness etc. Can I get some existing codebase I ca...

Extracting Creator information embedded in files from OS X using PHP?

In OS X, if I use Photoshop (for instance) to create a PNG file, I have the option to save the file without an extension and OS X still recognizes what type of file it is and what application to open it with. Is there any way for me to extract that information from a physical file using PHP? Thanks in advance. ...

For Loop do action every 5 results

can someone tell me the logic (in any language ) including pseudo code. on how to create a for loop an have it fire an action every 5 results it spits out. basically I'm just trying to emulate a table with 5 columns. Thanks! ...

PHP Send UTF-8 mail without PEAR::Mail PEAR::Mail_Mime

I would like to be able to send e-mails with PHP mail() containing the 8-bit characters åäö. They will be used in the subject, the message and in the "From:"-header. How can I do this without using the PEAR packages? ...

Wordpress with JQuery with PHP Service Endpoint with SQLite

I am using Wordpress with JQuery to create a vehicle selection form. Vehicle information is retrieved by JQuery Ajax calls to a PHP backend script. The PHP scripts query an SQLite database for vehicle information. Wordpress form -> JQuery get -> PHP script -> SQLite DB I have three distinct queries that need to be executed: Vehicle...

Trouble getting simple php mail script to work on OSX

I am trying to get this simple php mail script to send mail to my email addres ([email protected]) and I cannot get it to work. I set my sendmail_path in php.ini to the right folder (/etc/sbin/sendmail) but that did not seem to help. What else could I be missing? The script always returns failure. <?php $to = "mike_minerva@yahoo...

User management, authentication and acl plugin for CakePHP?

Hi, I am pretty new to CakePHP, having been using rails for a little while. My question is, can anyone recommend a good user management, authentication and acl plugin or component for Cake? I have come across this one, but it has not been updated since 2008. If not can anyone recommend a good book/tutorial site for this kind of set up?...

Steps to setting up my first eCommerce site

I'm about set up my first eCommerce site. I was hoping you could recommend some shopping cart software. What are the perks of using pre-built software rather than developing some simple solution catered to my needs. Also, are there pre-written Terms and conditions for sites? Or templates that outline what aspects need to be addressed? Wh...

Let apache handle 404 error when deemed appropriate by PHP?

I perfectly know how to create a custom 404 page in PHP, however I'm wondering if there's a way to give back control to to apache and let it produce the proper 404 page, sending right headers, etc. when my logic says so? I'm looking at some apache specific functions but can't seem to find anything appropriate. Is that really just not po...

Trouble passing slider value to php mail script

I want to email the value of the slider along with some things they entered into my form to my php email script. This is how the form looks that will pass data to the POST method of mailer.php: <form method="POST" action="mailer.php"> Name: <input type="text" name="name" size="19"><br> <br> E-Mail: <input type="text" nam...

php rand() array

I need to be able to pull a random value out of my array, let's assume i have array with 100 values, how can i pull randomly 5 values out of this array? ...

How would I perhaps reduce the processor footprint of a php script?

I'm attempting to make a php script that can load the current weather forecast and it uses a bit of XML pre-processing to digest the input, however it is accessed quite often and reloaded. The problem begins with my current host, which yes I do understand why, limits the amount of processing power a script takes up. Currently takes an e...

How to distribute a PHP extension for use in a Shared Hosting Environment

I have a library written in C that gets distributed as a PHP extension, and my users are having problems accessing the library when running in a Shared Hosting environment. Previously (In PHP versions less that 5.2.5) our customers could simply use the dl() function and the full path to the library to access it. Since PHP 5.2.5 the dl(...

get array of rows with mysqli result

Hi there i'm trying to check if a string match one of the fields in a certain column in a table for this i need to get all the rows from result object i'm using php 5.2.x so can't use fetch_row_all method instead i'm tring to build a new array that will hold all rows here is my code: $sql = new mysqli($config['host'],$config['user'],$co...

Scripting (with PHP) in Java?

I'm trying to write a simple Java game. I have a NPC class, with a function Dialog which returns what the npc would say, which would depend on various conditions. I'm thinking that it would probably make sense to offload the logic of deciding what each npc would say to a scripting language, so that it could be changed updated easily. Th...

Rewrite index.php in Wordpress

I started a blog and when I changed my permalink structure to /%postname%/ I get a Page Not Found error. I want my url to look like this: http://bobbybeckner.com/sharepoint-list-and-linq-using-jquery-and-ihttphandler/ not this: http://bobbybeckner.com/index.php/sharepoint-list-and-linq-using-jquery-and-ihttphandler/ I read a few pos...

Writing an RSS feed to MySQL using PHP

Basically I need to create a PHP document that will read an RSS feed and the write the information to a MySQL document. However I have very little experience in this area and I was wondering if someone would be able to provide an example of how to do this? I was thinking about something that incorperated MagpieRSS, however the documentat...