php

MySQL PHP incompatibility.

Ok maybe I've overlooked something really simple here, but I can't seem to figure this out. I'm running WAMP locally, but connecting to a remote MySQL database. The local version of PHP is the latest 5.3.0. One of the remote databases, being version 5.0.45 works fine. However, the other remote database I'm trying to connect to, which...

Linux: Library to write ID3v2 data and cover art

I need to locate a command line tool that would allow me to write (read is not required) ID3v2 and album art to an MP3 file. Command line is required as it will be executed from PHP, so no graphical interface. Searches of Google have proved fruitless, so perhaps there is a tool available that will enable me to do this? ...

Norwegian characters

I have the following php in my contact form. // Ensure a message was entered, then sanitize it if(!empty($_POST['cf_m']) && $_POST['cf_m']!='Enter Your Message Here') { $message = strip_tags($_POST['cf_m']); } When I receive a message by email, Norwegian characters, å, ø and æ becomes Ã¥, ø, æ What can I do in order to show correc...

Which is better: mysql_connect or mysql_pconnect

I'm a PHP newbie working a some scripts to display some news articles from a databse and wanted to find out a couple of things. For opening a connection to a MySQL database, which is a better option mysql_connect or mysql_pconnect? What are the advantages or drawbacks of using a persistent connection to the database? And in what kind ...

Develop a facebook app tutorial.

Hi im pretty new to php but i would like to make a facebook app, for a competition where the participants can send in their ideas. Does anyone know a good tutorial och something like that? thanx in advance ...

Get an html page as image in php from an url (like printscreen)

I need to get a "thumbnail" of a web page which I know the url and save it to a file. At the moment i'm stuck at "conversion" from html to image: i can get the html via curl. How can i do to achieve this in php? It's possible? ...

Problem with PHP DOM thing

Hi i have problem with this code, i found it on the internet and when i tested it it gave me the following errorcode: Parse error: parse error, unexpected $end on line 52 Here is the script: <?php function walkDom($node, $level = 0) { $indent ="; for ($i = 0; $i nodeType != XML_TEXT_NODE) { echo $indent.''.$node->nodeName.'...

php script that runs on the server without a client request

I am working on a site that require a php script running on a server without any request, it is a bot script that keeps (not full time but at least once a day) checking client accounts and send alert messages to clients when something happens. any ideas are appreciated. ...

Add To Basket Script - some design help, please

I'm writing a script to let users place items in their baskets. It is very complex so far, and I would like to talk it through with someone to see if they can suggest better design or tidy the current design up. Here is the code I have, which doesn't work very well (i.e. has errors that I haven't yet resolved), with comments to show my i...

Using a WSDL with abstract types in PHP

I'm working on an integration between our web application and Microsoft Exchange 2007. I am using Exchange Web Services (EWS) to communicate to the Exchange Server. However, I am running into some issues with the WSDL. There are several types defined in the WSDL that have elements of abstract types. For example: <xs:complexType name...

PHP / TCPDF library - Size an image in a PDF to a specific number of inches?

Does anyone know how to get TCPDF to output a .GIF file with a specific number of inches width x height? I am trying to get a GIF embedded in a PDF so that it will print at exactly 4x6 inches. I tried this: $this->setpageUnit('in'); $this->Image($tmp, 0, 0, 4, 6, 'gif', '', '', true); But that only seemed to result in a blank page....

How to create a backup of a postgres database to a sql file using a PHP script?

I have the following situation. I have a PHP script that imports a CSV file and then updates the postgres database Now I need to create a backup of the database before the importing occurs The PHP files are running on one server and the postgres database on another server I tried exec(pg_dump db_name -CdiOv > /tmp/db_name_backup.sql)...

What could cause a failure in PHP serialize function?

I have some serverside PHP code that attempts persist a data object (essentially an multi-dimensional array) to a backend database. This data object originally comes in as AMF actionscript object sent from a flex application. I want persist the object in whole for later use so I have used the php serialize function and encode the object ...

magento blocks postion

hi i want to replace a module with another in magento how can i do this (means i want to put Community Poll module to the left ) is there anything like joomla im a newbie in magento so plz be descriptive with your answer ...

Get files form dir with glob and check if it is in array then include?

How could I use the php function glob to get files from a directory and put them in an array and then include them with index.php?file=filename if it exists? This is what I came up with so far but it doesn't work. $files = glob("files/*.php"); $file = array($files); if (in_array(.. OR is there a smarter way to do this without having...

CURL and HTTPS, "Cannot resolve host"

I'm trying to fetch the contents of a page using CURL. The page that is doing the fetching is https and the page it is trying to fetch is also https. I'm getting an error "Couldn't resolve host" with all of the settings I try. $c=curl_init(); curl_setopt($c, CURLOPT_URL,$url); //curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows...

handling a dual function form

I have a a form on my site that handles employee details. If there are no associated values in the DB then the form function as a create details form. If there are associated values in the DB then the form is populated with those values and the form functions as a update/edit form. Assuming the form is functioning in it's update/edit ...

PHP - Too many ways to skin a cat?

I just started another new job in a PHP LAMP role, and once again I am faced with a steep learning curve. As great and as useful as PHP is, I'm starting to feel that it's a little too flexible. Unlike Ruby, which has the single accepted Rails framework, us PHP developers have a plethora of possibilities to be thrown at us such as code ...

htaccess rewrite rules

Hello, I've currently got a web application that I need optimizing, and one of methods or something I'm trying to achieve is such: http://myweb/dept/app from http://myweb/?dept=dept&amp;app=app I've currently this as the PHP code for it: if(empty($_REQUEST['dept'])) { $folder = "apps/"; } else { $folder = str_replace("/"...

PHP/MySQL isolating database access in a class - how to handle multiple row result set in an OOP manner

PHP/MySQLisolating database access in class - how to handle multiple row Selects Here’s a coding question. I isolated all DB access functions in a class <?php class DB { var $conn; function DBClass () { @$this-> conn = mysqli_connect (DB_SERVER, DB_USER, DB_PASS, DB_NAME); } function validateUse...