php

cURL , get redirect url to a variable

Hi, I am currently using curl to fill an form, but after completion of the post, the other script which handles the form is redirecting to other url , now I want to get the url , for which the script is redirecting to a variable. Thanks.. ...

How can a webservice be secured with authentication when called from ajax client side ?

How do I protect a webservice if it is called from ajax ? Update: I realize that my question didn't reflect what I intended to ask. I don't want user to be able to do the request by pointing to it with its webbrowser but only in the context of my app. ...

complete example of gettext in php

hi all, i've been googling for the last hour or so trying to find a complete working example of gettext in php - all source files, po files, with proper paths, etc. Just a "hello world" with all the required files. I was wondering if anybody has such a working example. thanks in advance. ...

PHP: JSON like data format, searching parser

Hi, i would like to have an JSON like data format with the following features: support of arrays (ideal with [item; item; item] as notation and [key: value; key2: value2]), also nested string support, ideal with the following: "foo",0x0a,"bar" hex numbers, bin numbers, decimal numbers Does anyone know a parser for such a data format ...

Help required in sending json to php server using POST method.

I am trying to send json data from an HTML form back to php server via a POST method. Here is my code. It goes to fail block in callback function. Firebug console(ctrl+shift+J) displays no error. <script> function ADDLISITEM(form) { var options = form.txtInput.value; options = JSON.stringify(options); var url = "conn_mysql.php" var ...

Can i set which .so to link in php scripts?

I have serveral copies of same ".so" file under different system directory. Can I set link path in my php scripts so that i can link to a certain ".so'? ...

MongoDB: Query by date

In a MongoDB database, I have a collection of items, and each item stores its creation date. I need to query this collection by date. I tried: db.items.findOne({date:{new Date(1285947037*1000)}}) but it isn't returning anything. I got that timestamp using PHP ($date->sec, where $date is a MongoDate object from the database). So wha...

wordpress: use post-thumbnail if set?

hey guys, i hope there are a few wordpress experts out there that can help me with ths. i'm using: the_post_thumbnail('medium'); to view a post-thumbnail that can be set for every post in the backend. however, if there is no postthumbnail set i want to print out a different image. any idea how i can check the function to find out if ...

PHP convert Win-1251 to UTF-8

I'm fetching the contents of a Windows-1251 encoded web site using file_get_html and want to serve it as UTF-8. I set the headers to UTF-8 using: header('Content-type: text/html; charset=UTF-8'); Then i output the data using iconv("cp1252","UTF-8",'"desc":"'.$desc); The output is no longer strange questions marks, but it's still not C...

splitting an array after an SQL query

Hi im totally stuck, could someone help me out? I have done a straight forward MySQL query from a database to return all products. I have used the productGroupDesc to tell me which company and category they belong to. A typical entry looks like Company - Category So what im trying to do is categorise the products by first finding wh...

Mysql structure for something like Facebook

I'm thinking of starting a facebook style website with bio pages, friend requests etc, roughly what sort of database tables would be advisable? Ie. Users, status? A rough list would help? Thanks ...

What is the correct way to retrieve information from two tables using doctrine ORM.

I am trying to perform a simple join on two tables and am having trouble finding the right syntax to use - I know i am missing something simple. From the 'users' table i need the id (working fine) and from the 'meta' table i need the last_name (not working) $q = Doctrine_Query::create() ->from('Users u') ->leftJoin('u.Meta m'); $users...

mysql connection from daemon written in php

i have written a daemon to fetch some stuff from mysql and make some curl requests based on the info from mysql. since i'm fluent in php i've written this daemon in php using System_Daemon from pear. this works fine but i'm curious about the best approach for connecting to mysql. feels weird to create a new mysql connection every coupl...

twitter status update thru api with oauth authentication in php

I was googling around for some time and didn't googled anything... How to, using php, update twitter status thru twitter API with OAuth? Thanks! ...

PDF format, word spacing

Hi I'm implementing a pdf generator in PHP I have problem with word spacing, the option doesn't work or i'm not using word spacing parameter properly. I need this option to render text justified. The character spacing parameter works properly. This is how I'm rendering text: BT /F1 12 Tf 0 829 Td 5 Tw (Hello world) Tj ET Word spa...

i need an internet rich application Idea

hello everyone , i'm taking the " web development " course and the project is worh 40 % of the course i should provide my proposal within 1 week , the problem is that the doctor is very demanding he's expecting nothing less than facebook or WebCT " those were his proposed ideas ". i want to make something special not like others ? so do ...

how to refresh two After Insert process

Hi , After insert successfully i want to refresh the two page which i opened , Example : i have Order view display , in this am displaying the order added items , And another is the pop up window , i want to refresh this window , ...

Algorithm for Room Allocation Using PHP

Hi, I need help with an algorithm to allocate rooms to people. I need to shuffle through a list of rooms to assign a room to a person and after the fourth person is assigned to the room, it should be out of the list(should be unavailable). I have not had any luck with PHP shuffling and sorting functions yet. Any help (pointers, referenc...

Configure PHP to work with MySQL and phpMyAdmin

Hi.. My purpose is to setup a forum in php just locally on my Windows 7 machine to test how it works. I have installed Apache HTTP Server and PHP v5 successfully. Then I downloaded and extracted the phpbb-forum software and put it in my root folder. Then I realized that I needed some kind of database so I downloaded and installed MySQ...

display data one by one page and at once using php

I have two mysql database tables: 1) CARS TABLE: with following columns i)car's name and ii)manufacturer's name. 2) RECORDS TABLE: with the following columns i)name of the user ii)rating given iii)car's name. Now i want the each user to give rating( rating will be a text input box) to each and every car in two ways. 1) ONE BY ONE: ...