php

PHPMailer problem

Hi guys, I am new to php. Trying to send confirmation about user upload. I am trying to use PHP Mailer for this. And have the following code but it doesn't work. Any help would be appreciated. <?php if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder']...

PHP login, getting wrong count value from query / fetch array

Hello, *EDIT*Thanks to the comments below it has been figured out that the problem lies with the md5, without everything works as it should. But how do i implent the md5 then? I am having some troubles with the following code below to login. The database and register system are already working. The problem lies that it does not find an...

Portable Contacts for PHP?

I can see Google is implementing the Portable Contacts API for developers to fetch a user's contacts. That seems like exactly what I want to do and I especially like the fact that the protocol is open and through it I can support more than just Google. What I'd like to know is whether there is a library for PHP that implements this prot...

PHP rerouting temporarily store the previous output

I have output from a page (Uploader.php). Now i go to some other page and have a button on that page to reroute to this page (Uploader.php). I want the input of the page to be seen rather than reprocessing the page. ...

A good ecommerce alternative to Magento?

I been dealing with Magneto for the last 6 months now and its a real headache, always some type of error, slow, bloated, dead community and overly complex to customize (and im a designer...) I look at others like zencart but seem kinda dated compared to magento, but are their any other solutions to replace magento thats better and with ...

get date from string php - UK date

Hi-- I have a UK date in the format "06/Apr/2010 13:24" that I need to insert into a mysql db date field. The PHP strtotime function can't handle this string-- has anyone got any ideas other than writing a custom function? Thanks! ...

Search for values in nested array

I have an array as follows array(2) { ["operator"] => array(2) { ["qty"] => int(2) ["id"] => int(251) } ["accessory209"] => array(2) { ["qty"] => int(1) ["id"] => int(209) } ["accessory211"] => array(2) { ["qty"] => int(1) ["id"] => int(211) } } I'm trying to find a way to verify an id value exists ...

In PHP how do you format a number as currency handling cases such as 10 cents equaling "$.1";

I currently do: $totalBill = number_format($totalBill, 2); $totalBill = '$'.$totalBill; This does not handle cases though where the total is say 10 cents. It returns "$0.1" which I do not want. Does anyone have a better way? ...

html/php: how to handle absolute url's?

Is the html <base> tag safe to use in terms of browser support? Or should I generate a root path with PHP which i then add like this <a href="<?=BASE?>somepage.html">somepage</a> which makes up a absolute url. using the base tag like this <base href="<?=BASE?>" /> I am then able to use links like this <a href="somepage.html">somepage<...

get the records for the latest timestamp mysql

how do I get all the records for latest date. The date filed in my db is called recordEntryDate and it is in this form 2010-01-26 13:28:35 Lang: php DB: mysql ...

pathinfo vs fnmatch

There was a small debate regarding the speed of fnmatch over pathinfo here : http://stackoverflow.com/questions/2692536/how-to-check-if-file-is-php I wasn't totally convinced so decided to benchmark the two functions. Using dynamic and static paths showed that pathinfo was faster. Is my benchmarking logic and conclusion valid? EDI...

Read file as its being uploaded

By default you cannot access a file that is uploaded until it has been fully transferred to the server. What is the best way to get round this and be able to access the 'byte stream' as the file upload is in progress? ...

[PHP-GD] Background transperancy in imagerotate()

Hello people, Since last 2 days, I was trying to add transperancy to the background after rotating an image using imagerotate() PHP-GD function. But, to my great disappointment, it's not working at all. It's just giving out a black background behind it. Here's my code - $patchImageS = 'image.png'; // the image to be patched o...

How to save content uploaded by user?

I am planning to start a site in which the content is generated by the users. What is the best method to save the data submitted by user? Is the method of saving the data in phpmyadmin database a good idea considering that the data submitted by users is large similar to a blog post. Btw I'm good in working with php and mysql but I'm no...

Accessing current class through $this-> from a function called statically. [PHP]

This feels a bit messy, but I'd like to be able to call a member function statically, yet have the rest of the class behave normally... Example: <?php class Email { private $username = 'user'; private $password = 'password'; private $from = '[email protected]'; public $to; public function SendMsg($to, $body) ...

Easiest RPC client method in PHP

I've been asked to help a friend's company to bring up a web application. I have very limited time and I reluctantly accepted the request, at one condition. As most of the logic goes on in the back-end, I suggested that I would finish the complete back-end only, allowing a front-end developer to simply interface with my backend. I pl...

Parsing a list of values of the form `{value}` with regular expressions

I have one string like the following (the number of the {} is unknown): {test}{test1}{test2}{test3}{test4} Now I like to get the content in {} out and put them into array. How can I do this? I tried: preg_match( "/(\{{\S}+\}*/)*") But the result is wrong. Thanks so much for anyone's help. ...

Adding code to plugin that only executes the first time its activated?

Is it possible to wrap code in a special function that only executes the first time the plugin is activated? I have some database code I need to run on plugin activation, but the code need not run again after that. ...

possible to make codeigniter work with another framework?

the situation is this. my client (who also is a programmer) asks me to develop an address book (with mysql database) with a lot of functions. then he can interact with some class methods i provide for him. kinda like an API. the situation is that the address book application is getting bigger and bigger, and i feel like its way better ...

where id = multiple artists

Any time there is an update within my music community (song comment, artist update, new song added, yadda yadda yadda), a new row is inserted in my "updates" table. The row houses the artist id involved along with other information (what type of change, time and date, etc). My users have a "favorite artists" section where they can do...