php

multipart PHP mail - accentuations problems![SOLVED]

I'm trying to send a multipart/alternative MIME e-mail via PHP script ... all works fine but I've some problems with the encoding! The accentuated characters, in the e-mail body, are displayed wrongly in the mail client! How can encode the body to solve this problem? ... I've tried to use .. utf8_encode($body) Without good results! I...

How to make a notifiy subscription list?

I have my site under construction, and I want to have a little form (name, email) where people can submit it to be notified when I launch my site. Much like you see on Beta invite sites etc. How would I go about that? ...

Best practises to stop memory leaks and improve performance

To put it simply i am a fairly new PHP coder and i was wondering if anyone could guide me towards the best ways to improve performance in code as well as stopping those pesky memory leaks, my host is one of those that doesn't have APC or the like installed so it would all have to be hand coded -_- ...

Generating XML based on condition in PHP

Is it possible to generate XML based on condition. I am getting the XML output from Database, but i want to display the nodes in such a manner based on the ID. If id of the elements are same, they should come under one node. ...

How to cast a 32-bit integer from unsigned to signed in MySQL or PHP?

Hello, I have a string in PHP (came from some data source), which represents a formatted unsigned 32-bit integer. I need to store it into a MySQL database as a signed 32-bit integer, so that later I can retrieve it from PHP and use it as a (possibly negative) signed integer constant (since PHP doesn't have unsigned integers). So, what ...

Returning unique values of a multi-dimensional array with CodeIgniter PHP

Hi - I'm developing a property rentals website. The search results page will contain a list of property results. It is my intention to redefine the results, say by town, country, property type etc. So let's say for example the user searches 'France'. All of the relative properties will be returned and displayed in a list. However, I al...

[PHP] accessing array from other function in a class

i have 2 functions in a class, in the first one i have something like that: public function func1() { $test = array(1,2,3); return $test; } how to copy the contents from $test in the second function? public function func2() { $newarray = $this->func1->test; print_r($newarray); } Sorry, but i have really no idea, how to make this :...

Update statement not working....

function add_new($father,$chName) // add new category { if($father = "1" ) { $result = mysql_query("INSERT into stinky_menu (title,nest_under) VALUES('".$chName."','1')"); } else { $result = mysql_query("UPDATE stinky_menu SET title = '$chName' nest_under = '$father'"); } } I am getting the value of f...

loaded php.ini file doesn't 'work'

The php.ini file that is loaded (checked through phpinfo) does not seem to have any effect when I change something (after restarting apache). I'm using vista for this (please no answers about use linux, I use that too, I want to have it work on vista also). edit: version 5.3 VC6 x86 Thread Safe, apache 2.2 edit2: version 5.2.10 VC6 x86 ...

How do I determine the extension(s) associated with a MIME type in PHP?

Is there a quick and dirty mapping of MIME types to extensions in PHP that I can make use of? ...

PHP curly brace syntax for member variable

First question on SO and it's a real RTFM candidate. But I promise you I've looked and can't seem to find it. I'll happily do a #headpalm when it turns out to be a simple thing that I missed. Trying to figure out Zend Framework and came across the following syntax: $this->_session->{'user_id'} I have never seen the curly braces synta...

What Should I Learn After PHP?

I am currently pretty experienced at PHP, and have wrote multiple applications in it. I know HTML, CSS, MySQL, and Javascript along with PHP. What is the next step in programming? (I know that there are languages like Perl, C, Python, but don't know exactly if they are Web Based, Desktop based, etc) Updated My Goals are to learn enoug...

SQL Query, within php

I currently have a query $query = "SELECT * FROM routes ORDER BY id DESC LIMIT 8;"; And that works all wonderfully. I have table columns id int(10) name varchar(45) base varchar(16) econ int(6) location varchar(12) x int(2) y int(2) galaxy int(2) planet int(2) comm...

How to avoid using PHP global objects?

I'm currently creating blog system, which I hope to turn into a full CMS in the future. There are two classes/objects that would be useful to have global access to (the mysqli database connection and a custom class which checks whether a user is logged in). I am looking for a way to do this without using global objects, and if possible...

Detect Visitor Browser view port size with Javascript and Save to a PHP variable.

Hi there. I almost sure that PHP can't detect the View port size of a browser right? But since that, can someone teach me how can i do it with Javascript and then gather that size from a Javascript variable to a variable in PHP? Regards PS: Sorry if there is another post with the same question. ...

PHP syntax: constructing a class from a member variable

I am trying to make a class from a member variable like this: <? class A{ private $to_construct = 'B'; function make_class(){ // code to make class goes here } } class B{ function __construct(){ echo 'class constructed'; } } $myA = new A(); $myA->make_class(); ?> I tried using: $myClass = new $this-...

PHP logs - mysql vs file

I am in the process of setting up user action logging for my PHP site. Would you recommend storing them in mysql or in text/log files? ...

How do I display a module in Joomla?

Very simple question. I've written a module for joomla, But how do I get it to display on content pages? Every tutorial seems to gloss over this very simple issue. I can see it in the module manager and it installs properly. Please Help! Edit clarification ...

CRUD for mySQL and PHP

I have to make some database request with php on a mySQL database Question : What is the best (simpliest) framewok to get thing done right CRUD (create read update delete) I also have to populdate the database, what is a good tool to do that. The only one i know is sqlmyadmin, wich does not look good. An online tool will be great Your...

php question checking pics format

I have problem to check picture format the code: // 0 means a successful transfer if ($_FILES["fname"]["error"] > 0) { $_FILES["fname"]["name"] = "holder.jpg"; // line 3 $imgData = $hyperlink.$_FILES["fname"]["name"]; // line 4 } else { $imgData = $hyperlink.$_FILES["fname"]["name"]; } // Only accept files of jpeg fo...