php

Compare 2 arrays for likeness

How would I compare 2 Arrays in PHP to find which values each array have in common. Example would be Array 1 Array ( [0] => ace [1] => one [2] => five [3] => nine [4] => elephant ) Array 2 Array ( [0] => elephant [1] => seven [2] => ace [3] => jack [4] => queen ) Output Array ( [0] => a...

How to set facebook album "Cover" using the Api?

Using the facebook Graph Api you can get the album cover using: https://graph.facebook.com/<album_id>/picture You can get a json listing of the cover info using: https://graph.facebook.com/<album_id>?fields=picture But for the life of me, I can't figure out how to set the cover picture of an album using the api. Any ide...

Eclipse hanging in svn+ssh project

Hey! I am running eclipse php helios on windows 7 64bit. I have created a projected with existing sources, sources from a svn+ssh repository. I have the project in another pc, which is running ubuntu server 10.10. My problem is that I can't do a refresh of the project. It hangs when the bar is at half. I can see the file in php explore...

Doctrine ORM, two different querys produce the same result set

I'm using Doctrine 1.2 and Symfony 1.4. In my action, I have two different query that return different result set. Somehow the second query seem to change the result (or the reference?) of the first one and I don't have any clue why.. Here is an example: $this->categories = Doctrine_Query::create() ->from('Categorie AS c') ...

PHP: working with tr and td with while()

<table border="0" cellspacing="0" cellpadding="0" > <tr> <?php while ($pF = mysql_fetch_array($stringVisits)) { ?> <td class="viewercell" style="color: #CCC; font-size: 10px;"> <?php echo "<a href='profil.php?id=".$BuID."'>"; echo "<img style='margin-right: 5px; width: 61px; height: 80px;'"; if (checkStatus($BuID) == 1) { echo 'c...

PHP mail function not working

Hi everyone, I have a php script that sends an email. It looks like this: <?php // subject $subject = "$first_name $last_name has sent you a message on The Red-line"; // message $message = "<html> <head> <title> The Red-line </title> </head> <body> <p> Hi $war_first, </p> <br /> ...

PHP - split a string if its contain words longer more than 5 chars

Hi. As topic said, I need a recursive function that split a string if its contain words longer more than (for example) 5 chars. Example : if i have the string "aaaaa aaa a aaaa aaaaa" its ok; if i have the string "aaaaa bbbbbb aa aaaaa" I need to split 1 time (and, for example, add the char # before the first bbbbb and the last b). So...

PHP: crop with PNG and trans

Im having issue when a user uploads and try's to crop a PNG or transparent image( with .gif) I am getting: Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: in statusUpFunctions.php on line 100 Warning: imagecreatefromjpeg(): 'images/status/photo/1-6.jpg' is not a valid JPEG file in statusUpFunctions....

How can I make a PHP script that cannot be called by a web browser?

Possible Duplicate: PHP - how to best determine if the current invocation is from CLI or web server? I know the obvious answer is to place the script outside the web root, but I'm hesitant to do that in my project since that complicates installation and might not even be possible in some shared hosting environments. I know so...

Grab Clipboard data on page load

Im trying to create a script that will grab the users clipboard data on pageload, and show up in a textbox where they can press Submit. Ive looked all over google and can not find the solution. I was wondering if this is possible? ...

Store the order of something in MySQL

Let's say I have a table that's like the following: name VARCHAR(50) PRIMARY KEY NOT NULL ordernum TINYINT UNSIGNED NOT NULL Also let's say I have 3 rows. something - 1 somethingelse - 2 somethingmore - 3 If i want to insert another entry called something1, and give it an ordernum of 2, how do I reorder all the rows that has an...

Selenium-RC PHP example fails

I'm trying to get Selenium-RC to work in a Windows/XAMPP environment. I'm coding in PHP. The following command line opens two Firefox windows. java -jar jar\selenium-server-1.0.3\selenium-server.jar -htmlSuite "*firefox" "http://www.google.com" "jar\selenium-php-client-driver-1.0.1\TestSuite.php" "logs\TestSuite-F.html" The first Fir...

Selecting online users from db with mysql command

Hi. I use this code to update the user database with the latest time when the user was online: $postTime = $user_array['last_online']; if ($postTime == ""){ $minutes = 11; } else { $now = time(); $seconds = $now - $postTime; // $seconds now contains seconds since post time $minutes = ceil($seconds / 60); // minutes sin...

PHP: Detecting file extension from: filename.jpg

Yes as the title says: How can i detect an file extension? $_POST['fname']; is where i have the filename stored e.g asddsa.jpg So how can i check if .jpg then ... if .png then ... ? $src = "images/status/photo/".$_POST['fname']; $parts=pathinfo($src); if($parts['extension'] == "jpg"){ $img_r = imagecreatefromjpeg($src); }e...

How to embed a progressbar into a HTML form?

I have this code below and want it to show the progress of a form submission of a file upload. I want it to work on my website visit it through this IP (24.148.156.217). So if you saw the website I want the progress bar to be displayed when the user fills in the information and then hits the submit button. Then the progress bar displays ...

How could you grab an avatar from Gravatar?

Is there a way with PHP to get the Avatar from the Gravatar website? ...

Problem FaceBook application does not publish on the wall

irst clarify that goes wrong on my server connection with FaceBook I can usually write things on the application. To start I decided to make one of phrases, sentences are like 6 random test and works well. I think the problem is that the function to publish on the wall and does not work, if I look at the Firefox Error Console fails. Th...

In which language should I develop my social networking application?

Hey, I am from India and developed my first version of social network app in Django. However, due to paucity of Django/python resources in this country, I am willing to now port to another platform. What would you recommend? a) Java b) PHP c) Any other suggestions are also welcome. ...

What is the best Relational Database Management System (DBMS) to use with a web app?

It seems like most people use MySQL together with PHP. I've used H2 and Postgres with Java, but I can't really say why, I didn't evaluate any before I started. Does some work best with a specific language? Are there more stable ones that are better at large capacities? ...