php

preg_replace not working for charachter \

I'm trying to replace \' with ' but it won't work This is the text I want to replace from Using Twitter\'s @Anywhere Service in 6 Steps and this is the code $tutorial = "Using Twitter\'s @Anywhere Service in 6 Steps "; echo $tutorial."<br /><br />"; $tut_title = preg_replace("/\\'/", "'", $tutorial); echo $tut_title; ...

substitute string in php from another file

i have some old php files which i'd like to convert to use gettext. those files have a content like this : $LD = 'Some String'; $Another = 'some other ~n~ string'; i have to substitute all the $LD, $Another in the files where they are declared with something like : _('Some string'); hacking a bit a created some sort of regexp to f...

JSON schema validation with PHP

Is there any PHP library that validates a JSON object against a JSON Schema? ...

How to get the dynamic generated content of an external ASP file using PhP?

This is the situation: I've a PhP login page that check is an external ASP page has generated something (nickname). For example: i'm logged? So opening directly the asp page will display "nickname:thecrius" and nothing more. I'm not logged? So opening the ASP page will display nothing. Now i've to catch the "thecrius" string with a Ph...

How to do a geometric search using latitude and longitude using php and mysql

Hi all, Did any know about how to search using latitude and longitude using latitude and longitude using php and mysql as back-end. I am having zip-code and latitude and longitude for the corresponding city. If i enter for a search with latitude i need to know the name of the city with that corresponding latitude and longitude. With ...

mysqli bind_result/fetch problem

I am learning how to use prepared statements with php 5 mysqli objects and I am having trouble getting the basic result binding to work. I am following the example code from php.net but something isn't working, the bound results are always NULL. Here is what I have /* prepare statement */ if ($stmt = $DB->mysqli->prepare("SELECT `alias...

How to create a webservice for the conversion rate

Hi Friends, I would like to create a SOAP Web service for the followıng wsld http://www.webservicex.com/CurrencyConvertor.asmx?WSDL Could you please explain how to do this? The following code is not working... Please help me.. ini_set("soap.wsdl_cache_enabled", "0"); $client = new SoapClient("http://www.webservicex.com/CurrencyConvertor...

Imitating Multiple Inheritance in PHP

I am working on my own MVC framework and found myself stuck. I need the following construction: Controller --> Backend_Controller --> Backend_Crud_Controller --> Frontend_Controller --> Frontend_Crud_Controller Both 'Backend_Crud_Controller' and 'Frontend_Crud_Controller' have the same functionali...

Read files via php

You all know about restrictions that exist in shared environment, so with that in mind, please suggest me a php function or something with the help of which I could stream my videos and other files. I have a lot of videos on the server, unlimited bandwidth and disk space, but I am limited in ram and cpu. ...

using joins or multiple queries in php/mysql

Here i need help with joins. I have two tables say articles and users. while displaying articles i need to display also the user info like username, etc. So will it be better if i just use joins to join the articles and user tables to fetch the user info while displaying articles like below. SELECT a.*,u.username,u.id FROM articles a JO...

How to decode the url in php where url is encoded with encodeURIComponent()

Hey Guys, How to decode the url in php where url is encoded with encodeURIComponent()? I have tried the urldecode() but then also..i don't the url which i have encoded... I have to do this in php.. ...

How to load data on option box in php

I'm having trouble loading the mysql data to the option box using php. Here's my code: <?php $con = mysql_connect("localhost","myuname","mypassword"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("school", $con); $idnum= mysql_real_escape_string($_POST['idnum']); $result = mysql_query("SELEC...

Selecting two field in MySQL with PHP

Hi guys, i'm relatively new to php and mysql and would like to know how to select two value in mysql with php. What i have is $query = sprintf("SELECT COUNT(id) FROM table WHERE UPPER(username) = UPPER('%s') AND password='%s'"... in this case, i'm only selecting and count if the id exist and i use list($count) = mysql_fetch_row($res...

session management: problem displaying username in the header

hi, I am working on a simple login and logout module for my website without any security. I am using wamp on a windows xp machine. I am creating session when a user submits the login informaton it redirects to a process.php file which creates the session variables and starts session. Now if the login is successful user is redirected to ...

How do I log into a google apps account associated with my custom application without prompting the user?

Hi guys, I'm working on a google apps based application - its a project management system and I'm setting it such that it requires a single google apps account to be used for all users of a particular installed instance. I.E someone installs it using a google apps account he/she can create users who can log in from a separate login scree...

How to read email attachment

What I have: A person daily sends to me an email, which has a zip'ed XML attachment. What I do: I save that attachment, unpack it and import via XML importerer to my web site. What I need: Automatic script, what I can automatically forward my email to ex.: [email protected] and read that attachment via some php file in my website, ...

Find actual value of PHP variable

Hi all. I am having a real headache with reading in a tab delimited text file and inserting it into a MySQL Database. The tab delimited text file was generated (I think) from a MS SQL Database, and I have written a simple script to read in the file and insert it into an existing table in my MySQL database. However, there seems to be so...

What is the point of interfaces in a weakly-typed language like PHP?

I've never been able to figure this out. If your language doesn't type-check, what benefits do interfaces provide you? ...

Form Arrays support across browsers

I'm not even sure if form arrays is the proper term, but it looks a bit like this: <input name='element[]' type='text' /> <input name='element[]' type='text' /> Which is then retrieved in PHP as an array stored in $_POST['element'] -- in this case with 2 values. I've tested it in the browsers I have available to me, but I've never se...

i want to creating image tag system in cakephp?

I want to create image taging system in cakephp can any one say how i create data dictionary and how i handle relationship in cake ? ...