php

ereg to preg conversion

I'm a complete novice when it comes to regex. Could someone help me convert the following expression to preg? ereg('[a-zA-Z0-9]+[[:punct:]]+', $password) An explanation to accompany any solution would be especially useful!!!! ...

php , SimpleXML, extract info from array

I'm trying to extract some information from ebay api . I have this link up http://open.api.ebay.com/shopping?callname=GetMultipleItems&responseencoding=XML&appid=Morcovar-c74b-47c0-954f-463afb69a4b3&siteid=0&version=525&IncludeSelector=ItemSpecifics&ItemID=220617293997,250645537939,230485306218 and I'm using Simpl...

Threaded messaging system for PHP/CodeIgniter?

Is there an open source threaded messaging library for CodeIgniter? Or is it best to create the system in house? I'm looking for a private messaging system with the basic person to person interactions, reply, attach etc. ...

PHP echo xyz if rows in loop contain no data

I am trying to echo some text if my loop returns with no data but can't get it do work. I have tried a few things but no luck. my code: $result = mysql_send("SELECT * FROM datatable WHERE id='". $_SESSION['id']."'ORDER BY id ASC LIMIT 2"); while($row=mysql_fetch_array($result)) { $a = 1; extract($row); echo 'Trans ID:...

Very strange form behaviour

I can't work this out. One minute it was working fine and now it's not and I can't see what's changed!! My problem is simply submitting a username and password for a login function. The form method is set to "post" but for some reason no data is getting through. If I dump $_REQUEST or $_POST they return empty. I know the form is submitti...

how to create in PHP analog of C# ' private const int ' and ' private const byte '?

So in C# I create something like private const int HEADER_LENGTH = 13; private const byte SIGNATURE1 = 0x46; How to create its analog in PHP? ...

determine if a restaurant is open now (like yelp does) using database, php, js

i was wondering if anyone knows how yelp determines what restaurants are "open now"? i'm developing a similar application using html/javascript/php. i was going to have a column in my database for each day, with comma separated hours written in "2243" format (10:43 pm). so for example if a restaurant is open for lunch and dinner it might...

What is PHP for C# ReadBytes(stream langth)?

What is PHP for C# (asuming we open some local (on server) file instead of OpenFileDialog private const int HEADER_LENGTH = 13; stream = File.OpenRead(openFileDialog.FileName); header = ReadBytes(stream, HEADER_LENGTH); And will we be able to do something like this in PHP as a next step private const byt...

HTTP authentication and PHP authentication

Hi. I'm making a members area for my site and I have it already running. I authenticate members using mysql and php and this works really well. But now problems occurs, I would like to offer members a possibility to upload files to the systems, and those files should be available ONLY to logged in members. I know I could store those fi...

How to display progress loading image on file upload in PHP?

How to display simple progress loading image on file upload in PHP? without the use of APC ...

Trying to build a dynamic PHP mysql_query string to update a row and getting back the updated row

I have a form that jQuery tracks the onChage .change() event so when something is changed it runs a ajax request and i pass in the column, id, and the values in the url. Here i have the PHP code that should update the data. My question is now how do i build the mySQl string dynamically. and how do i echo back the changes/updates that w...

Change file extension if browser is IE

Hi, I'm looking for the best solution to dynamically change some images extension (from .svg to .png) only if the browser is IE. I don't know what's the best solution : parse the html code with PHP use jQuery with something like $("img.svg2png").attr("src", ...); dealing with htaccess and rewrite rules other solution ? Thanks ! ...

Will PHP script running on top of Apache be faster than C# stand alone program doing same thing (same counting algorithm)?

I mean PHP scripts on Apache are oriented for many users to use tham at the same time. So will 1000 requests which came at the (relatively) same time be fully processed faster than C# .Net program performing algorithm 1000 times in while loop? So we input same data, we perform same algorithm, which is written in the very same way (resp...

In PHP how would I push the values of an array on to the end of itself

Say I have an array: $myArray = array("foo", "bar"); What is a good way to repeat the values in the array onto the end of the array so that: $myArray = array("foo", "bar", "foo", "bar"); I thought maybe array_push would work like this: array_push($myArray, $myArray); but that actually pushes the array object and not the values o...

Move all files from sub directories into main directory

Hi, I have a main directory like : /import/ and in /import/ i have lots of sub directories, containing audio files. I would like to create a php script to move all the audio files from the sub directories into the main directory. Thanks guys :) ...

Does REGEX differ from PHP to Python

hi there, I found this post: http://stackoverflow.com/questions/118143/python-regex-vs-php-regex but I actually did not get if Python's REGEX syntax matches PHP's REGEX syntax. I started to convert some of my old PHP code to python (due to g's appengine etc.), and now I would like to know whether the regex is 100% convertable, by simpl...

How to you get hold of the user defined $tmp_path folder in Joomla

I want to create some files in my component and then delete them. How to I got hold of the $tmp_path variable that was set by the user in the configuration.php file? ...

Drupal 6 FusionChart PHP database data display

Hello, I am trying to get a pie chart display correctly but have found there to be not much documentation / guidance for drupal 6 and fusioncharts. anyways im aiming to query the database with this: $query = mysql_query("select * from content_type_engage"); Then i want to loop through the results and retrieve one specific value wi...

Communicating between PHP and Java using ActiveMQ/Stomp

Background I have two services that need to communicate with each other over a message queue. One is a legacy service written in PHP and the other is in Java. Sooner than later, the PHP service will be rewritten in Java. The current way they communicate with each other is to write to a shared database, which the other service polls. Thi...

Unable to render php files in browser

Hello, I am very new to php, and I am trying to develop a facebook application using php. I am using Joyent as my hosting platform. Currently, I am trying to do some simple scripts in php and then build on them. However I am unable to see any php files being rendered properly in my application. For eg: I have a simple script call...