php

Export XML with only one MySQL request ?

I want to export in XML format some data from 7 tables (MySQL database), and then I want to import in another database. And I have a update or insert rule for data. I already have a SQL query retrieving all data, with JOINs on my 7 tables. But...when I try to put data in XML format, I reach a limit. My PHP loop can catch each row, but I...

How do I use PHP to grab the name of the file?

Hi, what I want to do is PHP to look at the url and just grab the name of the file, without me needing to enter a path or anything (which would be dynamic anyway). E.G. http://google.com/info/hello.php, I want to get the 'hello' bit. Help? Thanks. ...

PHP Variable to JQuery function?

Hi, I need a relative path in this function: $(function() { $("#searchbox").autocomplete({ minLength : 2, source : function (request, response){ $.ajax({ url : "http://linux/project/index.php/main/search/", ...

Passing data to notification page

I'm not sure what the best way of populating a notification page is. I've been using sessions to populate it with information, but this falls short if the user is blocking cookies. I've considered passing it in HTTP GET variables, but I'm unsure whether it's a good alternative since its length is limited by some browsers. Which method d...

unable to login using myspaceid on Android browser?

I am trying to login on my website using MyspaceId running on Android web browser. It works fine on iphone browser but fails on Android browser and following error occurs: ErrorCode: -6 Description: The connection to the server was unsuccessful. FailingURL: https://secure.myspace.com/index.cfm?fuseaction=login.simpleform&featureNa...

PHP API for dictionary

Hi, Iam looking for a good PHP web api for Dictionary. ...

how do you install a PEAR package on WAMP, Windows 7?

I've no idea with command line stuff! What i've done: changed my php.ini to phar.require_hash -> off ran go-pear.bat so i'm pretty sure i've got PEAR installed, now I'd like to install this package I've tried following the instructions but I really don't know how to do things with cmd.exe, would love some help! ...

display HTML content from database with formatting in it

Hi all, I have used wmd-editor in my cakephp v1.3 application. The config which I have written is as follows: wmd_options = { output: "HTML", lineLength: 40, buttons: "bold italic | link blockquote code image | ol ul heading hr", autostart: true }; When I submit the form ...

How to replace {tag_INDEX} with array[INDEX] element

Hi, I have string like this; "String {tag_0} text {tag_2} and {tag_1}" Now i need to replace all {tag_INDEX} with elements from array $myArray = array('a','b','c'); so after replacement it should looks like: "String a text c and b" What is the best way to do this? I'm trying with preg_replace and preg_replace_call...

javascript validation on tiny mce text editor

Hai I want to validate (empty check) a tiny mce text editor using JavaScript. Does any one know this? I have used the normal empty check function. But it's not working. Does any one help me? also I want to know how validate empty check in FCk editor. ...

page not show after issuing zf command

hello guys, just simple question, recently i have setup a web server to build project using zend framework, after setup and see those welcome page saying that you are creating websites powered by zendframework, then i try issuing command, $ zf create controller alert i get the message that saying that i've successfully create control...

PHP preg_replace oddity with £ pound sign and ã

Hello I am applying the following function <?php function replaceChar($string){ $new_string = preg_replace("/[^a-zA-Z0-9\sçéèêëñòóôõöàáâäåìíîïùúûüýÿ]/", "", $string); return $new_string; } $string = "This is some text and numbers 12345 and symbols !£%^#&$ and foreign letters éèêëñòóôõöàáâäåìíîïùúûüýÿ"; echo replaceChar($stri...

How to change the elements in the page base on user who is logged in

Please give me an idea on how to display elements in a page depending on who is logged in. For example, a user or an administrator. I'm thinking of something like this but I get a parse error, what do I lack in this code?: EDIT: <?php session_start(); if (!(isset($_SESSION['loginAdmin']) && $_SESSION['loginAdmin'] != '')) { heade...

Background upload in PHP

I am working with a form that allows me to upload files via a local folder and FTP. So I want to move files over ftp (which already works) Because of performance reasons I chose this process to run in the background so I use nfcftpput (linux) In CLI the following command works perfectly: ncftpput-b-u name -p password -P 1980 127.0.0.1 ...

How to avoid notice in php when one of the conditions is not true

I've notice that when one of the two conditions in a php if statement is not true. You get an undefined index notice for the statement that is not true. And the result in my case is a distorted web page. For example, this code: <?php session_start(); if (!isset($_SESSION['loginAdmin']) && ($_SESSION['loginAdmin'] != '')) { header ...

Sharing a session between vBulletin forum and status.net microblogging platform

Hello, I need to integrate vBulletin 4.0.3 Publishing Suite with status.net microblogging platform. The first thing I need to do is make these 2 to share 1 session so a user logged in vBulletin forums will also be logged in to status.net and vice versa. I have installed different vBulletin components under different subdomains: forum...

Send xml from ActionScript to PHP

Hi, I have values inside an XMLList in Actionscript. Need to send these values to the DB and update it. My actionscript code is as follows: public static function saveUserPermList():void { var ht:HTTPService = new HTTPService(); ht.url = Config.getServerURL(); ht.method = URLRequestMethod.POST; //ht.resu...

Image decoration

How can we do image decoration in PHP, e.g. adding text or an image to it? ...

query excuting problem

hi, i tried to execute following query in php script. $db_selected = mysql_select_db("lumiinc1_sndemo1", $con); if ($db_selected) { echo "database connected"; } else { die ("Can\'t use db : " . mysql_error()); } $sql = "INSERT INTO `markers` ( `name`, `address`, `lat`, `lng`, `id` ) SELECT `name`, `street`, `latitude`, `longi...

Mail function issue

Hi, I am using mail function as i want to send message in a format for that i have used '\n' but it is showing as \n , the text does not comes in the second line. My code is : $to = '[email protected]'; $from='[email protected]'; $sendername='user'; $replyto='[email protected]'; $subject='Enrollment in Course'; $message='Please enro...