php

Looping through SimpleXMLElement Object works only in 2 steps

I've got a SimpleXMLElement for which I read in a XML file using curl. Trying to get the values out of it I seem to need to use a nested foreach, but in a similar situation I was able to do this in one go. Now I'm really curious why this isn't working: Its the delicious RSS feed; SimpleXMLElement Object ( [title] => Delicious/chr...

How do i Loop through the hidden field items and put in Session using PHP

Iam having hidden field which contains the value in this format ENO:123,EQNO:231,loc:CHICAGO;ENO:567,EQNO:898,loc:FLORIDA; In the above line iam having two pair of records separated by ";" and for each record iam having three columns separated by ":" Now How Do i loop through this and put each column in session ...

Same origin policy -- JavaScript calling PHP

Hi, I know that this is a popular topic, but I've yet to find an answer that's completely comprehensive. I'm trying to create a simple way for our 'customers' to place a Google Map on their website, which plots the position of our customers (or a subset thereof) on the map. The customers are in a MySQL database which is turned into XML...

How can I loop through a series of response variables with a specific prefix in PHP?

I'm posting a form to a php script. The form contains a dynamic number of fields named cardObjectX, where X is a counter. Example: cardObject1, cardObject2, and so on. I need to loop through all the cardObject fields in my php script, but because we don't know how many there will be for any given post, we can't hard-code the field names....

PHP Login System

Possible Duplicate: looking for PHP login script Does anyone know of a good login code in php? Something easy to implement? ...

problem with nextgen plugin

I have a problem with Nextgen gallery,after activating some plugins it doesn't show the submit buttons(insert, cancel). Then i have deactivated all plugins, but that doesn't help. I haven't any experience with wordpress, so any suggestions would be very useful. Thanks much ...

Stuck trying css mega menu in Zend framework

I am following zendcast's Zend_Navigation – creating a menu, a sitemap and breadcrumbs screencast and I will like to replace the menus he has there with so called pure "Mega Menu". The screen cast uses an xml file like so Home / <pages> <report> <label>Repor...

Regexp to detect call time pass by references in PHP source code

I'm looking for a regular expression that will accurately identify any PHP call time pass by references in source code in order to aid migration to PHP 5.3. Currently, I have [^=&]\s*&\s*\$, but this doesn't filter out assignment cases ($var = &$othervar;). This regexp should be compatible with eclipse (sorry, not sure what flavor of...

Parse Json in php

Does anyone how to display in php the weather by date? This is what I tried Nothing yet with: <?php $url="http://www.worldweatheronline.com/feed/weather.ashx?q=schruns,austria&amp;format=json&amp;num_of_days=5&amp;key=8f2d1ea151085304102710"; $json = file_get_contents($url); $data = json_decode($json, TRUE); echo $data[0]->weather...

Image management system

Hi Everyone, I have a user that wants to be able to upload photo's to his website, and then be able to choose which album he wants them to appear in. I already have the albums hard coded on the site, but he wants the ability to add more. Does anyone know of a script or cms or something that this can easily and cheaply be implemented o...

Wordpress password protected pages.

Hello everyone, I am hoping someone can help me this this problem. I know how to password protect a page in wordpress admin area, in the edit page area, edit the visibility and set it to password protected. I want to know if there are wordpress php functions to check if the user typed in the correct password in the layout php file. I...

How to call a custom ruleset.xml for php code sniffer

I'm trying to write an custom ruleset.xml for php code sniffer but calling it from the commandline without putting it in the default folder doesn't seem to work. Since the documentations seems to state otherwise i'd like to ask if i'm doing something wrong here :~/$ phpcs --standard=/home/edo/custom_ruleset.xml source/ ===> ERROR: the ...

C# window rendering PHP

Hello I want to build an application written in C# that renders a webpage in a dialog. Simple enough there are lots of tutorials on how to do this http://www.codeproject.com/KB/cs/webbrowser.aspx Now I want to render some PHP pages instead of static pages, mainly to configure a database (SQLIte) and add a few recored, ect. I don't w...

Definitive List of NetBeans Shortcuts

I'm looking for a list of helpful NetBeans shortcuts. Examples include: CTRL+clicking on a method to go to it's definition and using CTRL+Space for intellisense. Feel free to list your favorites here or send me a link(s). FYI - I primarily use NetBeans for PHP. ...

PHP 5.3 fgetcsv \"

I'm importing a CSV from DB2 into MySQL, all goes well until half a million rows in I encounter \" from a column with encrypted data. Here is an example: 100,"foo","bar","µ┬;¬µ┬;→ºµ┬;Öì\" 101,"foo","bar","$⌠ù¶∙$∙µ┬µ┬;→ºµ┬;Öì" When fgetcsv parses this, it escapes the last double quote and includes the next line as if it is part of tha...

Invalid query: Column count doesn't match value count at row 1

I have a strange problem, I'm sending an SQL query through PHP: INSERT INTO `lib_plex` (`id`, `active`, `lastUpdated`, `entry_date`, `entry_ip`, `address`, `city`, `state_iso`, `zip_code`, `plex_type`, `price`, `has_garage`, `has_indoor_parking`, `has_outdoor_parking`, `has_pool`, `has_fireplace`, `average_nb_room`, `construction_year`,...

PHP substr after a certain char, a substr + strpos elegant solution?

Hello, let's say I want to return all chars after some needle char 'x' from: $source_str = "Tuex helo babe". Normally I would do this: if( ($x_pos = strpos($source_str, 'x')) !== FALSE ) $source_str = substr($source_str, $x_pos + 1); Do you know a better/smarter (more elegant way) to do this? Without using regexp that would no...

Converting a C (\0 terminated) string to a PHP string

PHP is one of those languages I use periodically, but usually have to dust the cobwebs off when I start using it again. The same applies this week whilst I port some C code to PHP. This uses a lot of AES encryption and SHA256 hashing - all working fine so far. However, decrypted strings come out in "C" form - i.e. terminated with a zero ...

What is the difference between include() and calling a function in PHP?

What is the difference between include() and calling a function in PHP? For example : 1- <?php $foo = '<p>bar</p>'; return $foo; ?> <html><body><?php echo $foo; ?></body></html> 2-insert above php code in a php file and include() thanks in advance ...

PHP Timer security

I have a timer on the site which the user will only be able to click on every * seconds/minutes/hours. Every user has a timer value in the users table where the values are written and read. The value in the database is the amount of seconds that the user will have to wait. I've figured out how to make the timer countdown from the correc...