php

Using SimpleXML to loop through muliple entries

Hi Im trying to parse an xml feed using simplexml in php. The xml feed is laid out as follows: <Member> <MemberType>Full</MemberType> <JoinDate>2010-06-12</JoinDate> <DataType>A</DataType> <Data> <FirstName>Ted</FirstName> <LasttName>Smith</LasttName> <Data1>56</Data1> <Data2>100</Data2> ...

how can i send emails including html to using php and gmail smtp?

im using phpmailer ...

Alternative for 'eval() uating' a condition

In the legacy codebase that I am working on, there is a condition evaluator which accepts user input to build a condition. This condition is then evaluated at run-time using php eval(). What is the best way to resolve this without using eval. For e.g. I have a condition "1>0" entered by the user in the UI. This has to evaluated and the ...

Provisioning a wordpress user/blog

I have a wordpress blog inside the company where I write blogs. I want the people inside the organization to comment on the blogs. I was able to grok through the authentication inside the company and get the person's username. I want to auto register a user if he/she doesn't already exist in the system based on their username. Can someon...

MySQL Stored Procedures

Hi, I have a few questions regarding stored procedures. After hours of googling, I really can't find any really simple query examples. CREATE PROCEDURE test1(IN uid INT) BEGIN SELECT USER_NAME FROM USERS WHERE USER_ID = uid; END // this query takes 'uid' as input and selects the username for that uid, Can someone please explain h...

What is the correct way to check if bit field is turn on in php

What is the correct way to check if bit field is turn on - (in php) ? I want to check a bit field that come from db(mysql) if is turn on or not. is this is the correct way ? if($bit & 1) Are there other ways ? I see somebody code that using ord() function , it is correct ? like if(ord($bit) == 1) ...

getting each value of an associative array

hello, i need help building a function that display an associative array and i want to insert them in a variable. for example i have this assoc array : $array[ID] = 1; $array[Name] = John; $array[age] = 12; $array[ID]=2; $array[Name] = Mary; $array[age] = 14; i need to make the ID,name,age as variables so i can display it in a table...

How do I save specific responses from webservers in my local computer

Hi, I have been asked to write to save the data in some secure place after certain task is completed by a client. Here my client has alot of staffs who makes data entry in online forms provided by some different vendors. After some steps the entered data generates some results. i.e after submitting the web form. Now he wants the genera...

Submitting form using Fancybox Ajax capabilities within an iFrame

Hi, I would like to use Fancybox to display a registration form within an iFrame. Then once the user has filled in his/her details. The details should be processed using the ajax mechanisms within Jquery/Fancybox and the values displayed within the same Fancybox iframe. How can this be implemented, I have been scratching my head all ...

How bad is using SELECT MAX(id) in MYSQL instead of mysql_insert_id() in PHP?

Hi, Background: I'm working on a system where the developers seem to be using a function which executes a MYSQL query like "SELECT MAX(id) AS id FROM TABLE" whenever they need to get the id of the LAST inserted row (the table having an auto_increment column). I know this is a horrible practice (because concurrent requests will mess the...

PHP sorting object array by certain criteria?

I have something like this: $i = 0; foreach($tracks['results'] as $track){ $trackName[$i] = $track['name']; $trackPlaycount[$track['name']] = $track['playcount']; $trackPercent[$track['name']] = $track['percent']; $i++; } $this->trackName = $trackName; $this->trackPlaycount = $trackPlaycount; $this->trackPercent = $tr...

PHP does not recognize CSS and stuff

Problems Project1.php does not show: CSS, thumbs and sidebar navegation I do not know what is wrong with it? Site Structure: giving | - - css | - - footer.inc.php | - - header.inc.php | - - index.php | - - portfolio | - - print | - - images.inc.php | - - img ...

sending mails in php using yahoo smtp

Can some one suggrst me a code where i can use yahoo smtp to send mails in PHP. ...

PHP - when using foreach to loop through array, how can I tell if I'm on the last pair?

I'm trying to 'pretty-print' out an array, using a syntax like: $outString = "["; foreach($arr as $key=>$value) { // Do stuff with the key + value, putting the result in $outString. $outString .= ", "; } $outString .= "]"; However the obvious downside of this method is that it will show a "," at the end of the array print out,...

Codeigniter URI routing variable encoding

I am using the following routing rule in my codeigniter project's routes.php file: $route['manage/(:any)'] = "manage/item_lookup/$1"; this redirects anything after manage in the url to the item_lookup function as a variable. Everything after the manage bit is a text string from a database which is then urlencoded i.e. the page "some ...

Cookie Based Menu Selections

Hi, I am new to PHP and would like to know how to setup and use Cookies to store user menu selections between pages. Basically, when a user say clicks on a menu option called "About Us", I would like to somehow store this selection via a cookie that I could then use somewhere else? FYI, I am using the jquery .click function to determi...

name an array with a variable (PHP)

I have a script i am writing. it parses through a list of scanned (barcoded) items and pulls data about the items. It also needs to count how many times each item was scanned. The part number is called $partselect. Ideally, I would like to store them in an array called $count with the format of $count[$part] = (number of times it's been ...

want to send mails from php using yahoo smtp.

Possible Duplicate: sending mails in php using yahoo smtp require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; $mail->Host = "plus.smtp.mail.yahoo.com"; $mail->Port = 465; // set the SMTP port $mail->Username = "sumthing...

MySQL - Find Client with most transactions on a table

I have a table of transactions that stores the transaction id, the client id and the total amount of each transaction. How do I find the client with more transactions? Im using PHP and Mysql, but im sure there is a way to do this inside the SQL query. Thanks. ...

XAMPP 1.7.3, Eclipse PDT & XDebug - Debugging a PHP web page in Eclipse never stops at breakpoints

Dear folks, My development web server is currently a XAMPP 1.7.3 on my localhost (Win XP). I just set up my Eclipse 3.6 PDT with XDebug. It works fine, if I debug a file as a "PHP script", but when it comes to debugging it as a "PHP web page", XDebug ignores the breakpoints completely. Only a manually inserted xdebug_break() inside th...