php

php scraping HTML - problems with IE only

Hi, I am scraping a website with HTML with php that retrieves a page and removes certain elements to only show a photo gallery. It works flawlessly for every browser BUT any version of IE (typical ;)). We can fix the problem by rewriting the .css file, but we cannot implement it into the head of the php as this will be overwritten by th...

How to use message queues when working with parrallel processes in php?

Hi, I'm trying to implement a program where a parent process opens multiple child processes (usually around 40) that run in parallel to each other. Now, I want to be able to get the child processes talking to the parent process to extract some information that only the parent process has. My plan was to use message queues in php but I...

php sql and classes

hi, im looking to create a web app using php, mysql. im planning to write it in classes. i have created 3 classes: CBaseUser, CWaiter, CBaseAuth so basically CBaseUser will be a parent class to CWaiter and CBaseAuth contains things like GetPasswdLen(), CreatePasswd(), GetToken(). so right now im heading to do the rest of the program ...

Using slugs in codeigniter

I have heard of people using slugs for generating clean urls. I have no idea how it works. Currently i have a codeigniter site which generates url's like this www.site.com/index.php/blog/view/7 From what i understand by maintaining a slug field it is possible to achieve urls like www.site.com/index.php/blog/view/once-upon-a-time Ho...

PHP Uploading issue Getting Error 0 but move_uploaded_file() is returning false

PHP Uploading issue Getting Error 0 but move_uploaded_file() is returning false. When I print out $_FILES I get Array ( [uploadedfile] => Array ( [name] => flashlog.txt [type] => text/plain [tmp_name] => /tmp/php0XYQgd [error] => 0 [size] => 3334 ) ) I'm using a basic html/php tutorial which leaves me to believe that it might be a ...

Referactoring code in Action Script and php to optimize runtime memory usage

I used to write programs in the android sdk for google phone. One of the android developers guide that I read says that it is more efficient to declare a const public static const NO:String = "no"; var1 == NO; var2 = NO; than to do this var1=="no"; var2="no"; For Java, when you write "no" each time, a new variable is create...

Kohana or CakePHP?

Being a web development over the years, I have good experiences on php, xhtml, css, javascript, ajax, etc. I also work with some old php libraries like Smarty, PEAR, etc. Recently I decided to use a PHP framework, and I started to learn/use CakePHP. It's not really simple for an ancient philosopher like me, but I think it's a valuable ex...

How to send email ?

Hi i am working on sending email to any recipient like yahoo gmail my code is contact form <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Email Form </title> </head> ...

POST method problem in php?

Hi, As I am using FCKEditor to develop small web site to manage site contents dynamically. When i add more content in the FCKEditor is working fine in my staging server where if i tested same in my live server, which throwing error as "500 Internal server error". I was not able find out the problem, please help me out. Sri ...

How to pass a PHP variable to Javascript?

Hello, I have 2 pages, one PHP and one Javascript. I'd like to pass the variable from this PHP script on one page: $strFind="SELECT * FROM cometchat_chatrooms_users WHERE userid=$curmemid"; $result=mysql_query($strFind) or die(mysql_error()); $row=mysql_fetch_array($result); $room=$row['chatroomid']; to this Javascript on another pag...

php fsockopen() in a loop

Hi everyone, I want to do an application that sends data to specified ip range.However,i faced a problem like this.When i put fsockopen function in a loop the code returns nothing and the page(browser page) is alwalys loading mode.When i do a single fsockopen to google it works but when i do it in a loop it doesnt... Thanks for advance.....

creating a "deck of cards" based on rarity

I have an array of images. Each image has a "rarity" key that tells me whether it's "common", "uncommon", or "rare". So for instance, the array might look something like this: Array ( [0] => Array ( [image] => photo1.jpg [rarity] => common ) [1] => Array ( [image] => p...

How to use php function "array_diff_uassoc" in a class?

Here is a sample class: class A{ . . . public function updateAction(){ $tags=explode(' ',$taglist); . . . $tagsInDb=$tagsInDb->toArray(); $dif=array_diff_uassoc($tags,$tagsInDb,"here the callback should be inserted"); } protected function callback_function_for_arra...

SQL JOIN get name and all tags for item

Hi all, this is my first ever JOIN clause and I did run into a problem. I want to echo all the necessary information for my items but I don't understand how to echo all the tags for one item, right now I get a list with duplicates of items but with different tags if more than one tag is assigned for an item. Any ideas? Better ways to do...

Add Entry to DB, Upon Success Refresh Messages

Hi all, So it's not a complicated matter at all, but was wondering how the Stackoverflow community would tackle this. I wrote a facebook-style wall type thing where users enter their "status", it gets processed via jQuery Post and upon success returns a success message. Prepending the new message to the Wall Stream would make sense, ...

php find snippet of content from preg_match

Ok say I have a paragraph of text: After getting cut for the first and last time in his life, Durant watched from the sofa as the American team waltzed into the gold-medal game and then was tested by Spain, ultimately emerging with a 118-107 victory that ended an eight-year gold-medal drought for the senior U.S. men's n...

MYSQL data + PHP to FLOTgraphing

Hi guys, im quite new to mysql and flot graphing, but i get the general idea. This is my scenario: I receive data from a device, in which i put into mysql database. am i wrong in saying that the new data will replace the existing data in the database? i then need to plot that on a graph, how do i get(store) the old values so i can put in...

Why it's 0 but not 255 here?

echo intval(chr(255)); I don't understand... ...

why I still don't get an empty array?

Quoted from here: If delimiter contains a value that is not contained in string and a negative limit is used, then an empty array will be returned, otherwise an array containing string will be returned. But why I still don't get an empty array? var_dump(explode(',', '', -1)) I get this: array(1) { [0]=> string(0) ""...

why I still don't get an empty array?

Possible Duplicate: why I still dont get an empty array? Quoted from here: If delimiter contains a value that is not contained in string and a negative limit is used, then an empty array will be returned, otherwise an array containing string will be returned. But why I still don't get an empty array? var_dump(ex...