php

Facebook Connect Ping vs. Redirect URL?

I almost have facebook connect working the way I need it on my site, I need to work out a couple bugs still, below is from the facebook connect documents, it list the 3 different URL options below in the settings of FB connect. This could be very useful for me because when a user logs in for the 1st time on my site with facebook, I need...

Connect PHP with Orbited

After searching the web for a good Comet and also and asking you guys what my best option is, I've chose to go with Orbited. The problem is if you need a good documentation about Comet you won't find. I've installed Orbited and It seems It works just fine. Basically, I want to constantly check a database and see if there is a new data. ...

Limit to number of items returned from DOMXPath query?

I'm having an issue where I am trying to pull 1700+ anchors off a webpage using a DOMXPath query. However the DOM Node List length is returned as 1400. I have done the same (with added tbody's) in XPather in FF and it returns 1700+ anchors so I know the query is right. Is there a limit to how many nodes xpather can return? Or how muc...

Facebook Stream.publish set permission based on attached media

I am in the process of making an app that uploads photos to Facebook and then optionally posts a link to the user's wall. I would like to know if it is possible to assign the same visibility permissions to the post as the photo or the photo album it is uploaded to. I am able to get the visibility permissions from the album fairly easily....

How many lines of PHP code is too many for one file?

I'm creating a PHP file that does 2 mysql database calls and the rest of the script is if statements for things like file_exists and other simple variables. I have about 2000 lines of code in this file so far. Is it better practice to include a separate file if a statement is true; or simply type the code directly in the if statement i...

JavaScript issue with Chrome

I'm not sure how this is Chrome specific, but it is. This is working on every other browser, including all IE* browsers etc. In fact, there's no code here that's client specific. All of this is being generated on the server. Yet after clearing Chrome's cache a million times and restarting it... the following doesn't work: <script type="...

Trying to join 2 tables, wont work

I want a list of all threads of the forum ID I'm viewing, but I also want to get information about the forum I'm viewing, like name and description. My query wont work: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in forum.php on line 11 How would I join in my forums table in this query? $tresult = m...

Twitter API -> updating profile bg image with php

Dear all, So far I have been trying to update the twitter profile bg image thr the twitter api with php... and without success Many examples on the web, including this one: http://stackoverflow.com/questions/1483163/updating-twitter-background-via-api and this one http://stackoverflow.com/questions/1485136/twitter-background-upload-wi...

How can i tell if a MySQL query returned nothing in PHP?

Question title says it all. I'm using PHP5 and MySQL. EDIT: I'm using mysql_...() functions. ...

Eclipse PDT does not underline syntax errors and code completion

Hi, Ater installing Eclipse PDT on my Mac(snow leopard), I installed Remote System Explorer (RSE) from http://download.eclipse.org/dsdp/tm/updates/3.0/. Now the editor neither underline syntax errors, nor do the code completion. But the editor does color the code. Where I can config it? Thanks!!! ...

How to start an AJAX request at a significant pause during user inputting using Jquery?

When a user is inputting something, I need to check user input against the corresponding data in database using AJAX, but I can't continuously check user input against the data in database because that would overwhelm my database server. I just want to start an AJAX request at a significant/obvious/sensible pause during user inputting. F...

How to avoid cross-reading between different directories under the same domain?

How to avoid cross-reading between different directories under the same domain? For example, setcookie('username', $username, strtotime('+1 months'), '/jp/', '.localdomain.com'); setcookie('username', $username, strtotime('+1 months'), '/cn/', '.localdomain.com'); When I use $_COOKIE['username'] to read the value under /jp/ or...

PHP based Ajax chat / support / assistance script

I have been assigned a task in a field I don't know anything about: Live chat directly on a PHP based web site. One-on-one only (Visitor to admin), with the possibility for both parties to store the conversation as text (though I could add that if necessary). Full fledged conversation management (continue conversation etc.) would be a pl...

How to access cookie values on different paths of the same domain using PHP?

Can a parameter of path be added to $_COOKIE[]? ...

Web service construction toolkit / wrapper for PHP?

I am developing a number of Web Applications and CMSes - and have old ones - that I would like to enrich with a RESTful API: The possibility to programmatically access library functions like, say, creating pages, moving them, deleting them, querying content, the things that an API does. What I am looking for is some kind of a web servic...

Generate download file link in PHP

I have a link in my page say, <a href='test.pdf'>(Test.pdf)</a>. When I click on that link, download dialogue box should open to download that file. Can anyone help me in implementing this in PHP? thanks ...

Header redirect and Session start() generating errors

I am using following code. I get errors: Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/mc/cpanel/Source/verifylogin.php:11) Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/public_html/mv/cpanel/Sou...

two dropdownlist

Dear all, I have two dropdownlist boxes. If I click on the first dropdown box, then the values have been changed in the second listbox accordingly to first listbox. For example: One is Fruits,vegetables,Birds. If i click on the Fruits then it shows the fruit list items in the second list box. It is same for other list also. Please send m...

How to I send data from JavaScript to PHP and vice versa?

How do I go about passing data from JavaScript code to PHP and back. Right now, I do this is a round about way: PHP to JavaScript: I would simply use the inline echo to send the data: <script type="text/javascript"> var data = <? echo $target_variable ?> </script> OR <script type="text/javascript"> var data = <?= $target_vari...

Why should I free the result of PHP and MySQL?

Why should I free the result of PHP and MySQL using mysql_free_result()? And what is the difference whether I free the result or not? Should I always free the result from a MySQL query result specially in CRUD? Thanks for answering my questions? ...