php

How do I convert these coordinates to google map readable coordinates?

Hi guys I need to convert coordinates in the following form: N42-53.9° W072-16.2° INto something thats kinda like the following: -90.7311 0.346944 A php function would be greatly appreciated - or just a formula would also be nice enough :) ...

php dynamic checkboxes

Currently I have a form that submits an image with textfields such as title, description and another field that autoincrements for imageID, another area for the actual file , called vfile, and *** another part that has 3 checkboxes and a text field. Everything works fine, and this is what it does. Submits the data to a database so that i...

Having problems loading PHP Driver for SQL Server 2008 Express

Hello all, I am trying to make use of the PHP driver for MS SQL Server version 1.0. I have everything setup but I think I am having trouble loading up the extension php_sqlsrv_ts.dll. I have gone to the command line and try this: C:\wamp\bin\php\php5.3.0>php.exe --re sqlsrv Exception: Extension sqlsrv does not exist C:\wamp\bin\php\p...

$content variable in node.tpl.php (Drupal 5)

The print $content statement in node.tpl.php is causing my whole layout to break probably due to incorrect nesting of DIVs. I want to check and fix that but I can't figure out what/where is the source of the $content variable in node.tpl.php file. I'd appreciate any help. Thanks. ...

Extract CAB files with PHP

Running PHP on IIS6, how can I open and extract the contents of a CAB-file? Is there any way of doing this witout using exec? I don't have permission to run stuff with exec. ...

Smarty caching components

The Smarty FAQ suggests one way to handle cacheable fragments, but it needs each page controller to do tons of work up-front, instead of encapsulating things properly. We want to get to a stage where we can do something like: <div id="header"> {our_categories} {our_subcategories category=$current_category} </div> The output of th...

If management decided opensource projects could fulfill business requirements. Would you (Java Developer) learn PHP?

I would like to say upfront that i am not a programmer. I'm 1 of 3 partners in a small start up. Two of us have a business and sales background, whilst the third guy is a very experienced Java Programmer/engineer (and a good friend). As with most start ups we believe we'll be the next big website. We have found a opportunity that the "...

Autocommit vs. Single Transactions (Small Project vs. Big Project)

Hi there, I am currently working on a very specialized PHP framework, which might have to handle large database transfers. For example: Take half of the whole user count; this should be every day's workspace for the framework. So, if my framework is required by big projects, is it recommend to use single transactions with multiple qu...

What file types/extensions would you allow in for a document management application?

I am working on a kinda document management system. The end users are business class users. I currently check and allow files to be uploaded only if they are one of the followings: "png|jpe?g|gif|xls|doc|docx|csv|ppt|txt|pdf|rtf" my questions are - If I add "xml" into the list? can they cause any security issue? What other document...

grab current user id - php class

Hello everone, I am buidling a small job application website, and i'm using a the basis of a login system taken from a Nettuts.com tutorial. The logging in works fine, but I am having trouble getting the details for the currently logged in user, for example if a user enters their personal details, i can process the data into the databas...

move object from 1 page to another?

Hay guys. I'm kinda new to OOP in PHP. I've learnt how to write and create objects. Is there a way to take an object and pass it to another script? either using GET or POST or SESSION or whatever. If there isn't how would i assign an object some variables on one page, then assign the same object more variables on another page? Thanks ...

When should variables be set in a class

Hay, when should variables be set within a PHP class? <?php class MyClass { var $my_var; // here? like var $my_var = null; function __construct(){ $this->my_var = null; // or here? } } ?> ...

automatic mysql query in PHP

How do i write a code that builds a mysql query depending on what values drop lists have? If nothing is chosen in a drop list, then the drop list value is 001 so then the query should not include this drop list in the search! Please help... I have this so far: foreach($_GET as $key => $value) { if ($value != '001') { ...

php SimpleXML check if a child exist

A->b->c might exist but c might not exist. How do i check it? ...

PHP ternary operator (short if statement) help

Hay All, I've converting a lot of my code to the short hand IF statement to cut down loading time/code. Most of these have been IF statements with ELSE's. However i can see to get it to work on just plain IF statements ($this->left_eye_sph >= 0) ? $this->transpose_left_eye() Any suggestions? ...

When form validation fails, how to pass error information for new try?

I'm developing a form validation class in PHP. When form validation fails, I can easily redirect again to the form's html page but without error information. I would like to redirect to the form's page with the specific errors about which fields failed and why. How should I do this? Should I send information back via GET or POST? and in...

php how to: save session variable into a static class variable

Below code works fine: <?php session_start(); $_SESSION['color'] = 'blue'; class utilities { public static $color; function display() { echo utilities::$color = $_SESSION['color']; } } utilities::display(); ?> This is what I want but doesn't work: <?php ses...

PHP upgrade problem - Is this an encoding error?

I upgraded php-common and php-devel packages on CentOS 5.3 system. Now, when I try to access any PHP script in a browser I get garbage like this: If I try to CURL GET the page, or try plain HTML, CSS or JS in the browser everything looks OK. Encoding is set to UTF-8 in both PHP itself and the PHP output via "Content-Type: text/html; ...

Looking For Best Practices On Building Feed Reader / Aggregator on a Cron

I have a social networking site which is beginning to gain some momentum and has an expanding user-base. We currently allow the users to import their blog, flickr and twitter feeds. We use the php library simplepie to read the feeds and then we check the DB to make sure we do not have a duplicate entry for each found feed item. If the fe...

How to use external variables (e.g. POST/GET) in PHP with error level E_NOTICE

...