php

Problem with PEAR Auth on linux machine

Hello, I am having problems with PEAR Auth on a linux machine. On the windows machine where development took place there is no problem. Users get the invalid username/password message which is displayed whenever the auth fails. Did anyone had the same problem ? Using MDB2 for the database connection. Regards, ...

simple way to store parameters in php cms

I am working on a cms and there are some simple parameters like number of posts per page, default color and style sheet, that are customizable by the user trough an UI. So what is the best way to store this settings in simple and secure way? Help is very appreciated. ...

CustomerReferences entry not included in FedEx web service request geberated via PHP

I am working on this FedEx web service integration project for some time. I am using PHP to make calls to the FedEx server. Everything seems to be working properly. But I am having problems with CustomerReferences fields appearing in the original fedex request that is sent to the server. I am using the ShipService_v7.wsdl. I asked FedE...

Why does ColorBox does not appear in Internet Explorer?

I am using ColorBox to show details of events on a calendar. The address to view it is http://www.idea-palette.com/greatoppseventcal/calendar6.php In firefox, when the user clicks on a day with an event, the lightbox opens and displays the event information from the database. In Internet explorer, when the user clicks on a day with a...

Preg Replace / Preg Match for href in html link?

Anybody have a regular expression to replace the following code: <a href="originalLink">hi</a> with: <a href="newLink">hi</a> ...

Passing Array using GET with PHP/jQuery

Hello, I'm currently using $.getJSON to pass an array of ids. It basically constructs a URL like this: http://domain.com/json.php?id=1&amp;id=2&amp;id=4 My question is: How can I take these ids that are passed (1,2,4) and place them in my where clause? Something like: $id = $_GET['id']; $sql = SELECT * FROM table WHERE usrID ...

class method inheritance question

Can anyone recommend good tutorial or a book on topics : class, methods, inheritance OOP etc .. to get general ideas .. and with some examples .. programming language is not important. tnx ...

Integrating WordPress Authorization/User Sign-On w/ a Ruby on Rails App

We have an existing WordPress install with a thriving user base. There are also some new Web applications being built in Rails to cover some new functionality. Any suggestions or tips on integrating sign-on between WP and a Rails app? Anyone done anything like this before? ...

Php mail() email sendouts arriving in gmail account but not in regular email accounts

I have a php script that sends out emails with attachments once people have submitted some information. I receive these emails in my gmail inbox with no problem. However, when I use my personal email address or my work email address the email is never delivered. Is this a problem with my script (below) or some setting I have on the serve...

include and require problem when I use it with file out of the folder

hi I usually use this line to import file from out of the current folder and it's work fine on my local host server require("../DataBase.class.php"); but when I upload the script on my website I get this Warning Warning: include(../DataBase.class.php) [function.include]: failed to open stream: No such file or directory ...

json messing up when data returned has html tags

I have a php page that is returning a json object like this: header('Content-Type:application/json'); echo <<<HERE_DOC [ {content: '{row2[contentFull]}', bigimages: '{$row3['catalogFileID']}'}] HERE_DOC; } In my main page I have the following jQuery code: jQuery(function(){ jQuery("select#rooms").change(function(){ var optio...

Converting timestamp to time ago in php e.g 1 day ago, 2 days ago...

hi everyone, i am trying to convert a timestamp of the format: 2009-09-12 20:57:19 and turn it into something like '3 minutes ago' with php. I found a useful script to do this, but I think its looking for a different format to be used as the time variable. The script I'm wanting to modify to work with this format is: function _ago($tm...

Best practices for taking and storing credit card information with PHP

Should I use sessions for the first few steps (validation, review purchase) then input the information into the database in the final submit? Could the cookies get jacked and transform into a lawsuit? Is it too risky? Would I need to protect my db any special way if storing credit card numbers? Any and all recommendation and personal ...

how to find out the rank of a row based on a mysql sum?

Hi there, I'm wanting to find the ranking / number of a row. I'm not sure if I'm explaining this well so I'll try. I have the query $sql = 'SELECT SUM(amount) AS total FROM sales ORDER BY total DESC'; $res = mysql_query($sql); while($row = mysql_fetch_array($res)) { // go through and print each row biggest 'total' first echo $row['...

How can I populate a javascript array with values from a database using PHP?

I have to create a javascript array whose elements are fetched by php from a database. Is it possible? If so, how? (I dont want to use ajax to do that) ...

PHP Search Title and Tags

Greetings, I'm thinking about the best way to implement a search on my website. I know about Sphinx and MySQL Full-text searches, however I'm not just searching a single field. I have two things that I want to search: the title of an article and the tags associated with that article. What I was thinking of doing is defining another col...

How to fetch result from MySQL row with multiple same-name columns with PHP?

select * from A left join B on A.columnc=B.columnd results returned by above SQL will include both columns of A and B. And what if A and B have some columns with the same name? How to retrieve the value from PHP? ...

How to recursively create a multidimensional array?

I am trying to create a multi-dimensional array whose parts are determined by a string. I'm using . as the delimiter, and each part (except for the last) should be an array ex: config.debug.router.strictMode = true I want the same results as if I were to type: $arr = array('config' => array('debug' => array('router' => array('strictM...

making IPTC data searchable

I have a question about IPTC metadata. Is it possible to search images that aren't in a database by their IPTC metadata (keywords) and show them and how would I go about doing this? I just need a basic idea. I know there is the iptcparse() function for PHP. I have already written a function to grab the image name, location, and exten...

php - copying some part of string

Hi guys, how can i get some part of string (in symbols). For example: $string = 'one two three'; $numSymbols = 7; %what should I do% $res_string = 'one two'; Help, please. ...