php

populate href of link for next and previous

Hi There, I am struggling alot with some PHP I am needing to implement a next and previous link, basically I have a search function on my site, that returns multiple results and click on a result navigates to that results page, I want to then be able to click next on that page, and be taken to the next result in the sequence that was re...

is it possible to get group's images from facebook ?

hello is it possible to get group's images from facebook using facebook API ? Thanks ...

receive in a php(server) a POST send by java (client)

hi guys, i want to receive in a server a xml file sent by java by POST how can e receive that ? and how can e parse the file, in this case a xml file... regards. ...

PHP: Mapped Network Drives

Hello all, I have mapped a network drive to a computer in my home network. Now I am trying to access it via PHP - I did this quick test: echo opendir('Z:\\'); This gives me: Warning: opendir(Z:\) [function.opendir]: failed to open dir: No error in C:\wamp\www\webs\tester-function.php on line 3 What have I done wrong here? I don'...

Automated Appointment Reminder

I need to create a web application using php, I had many users having appointments on different days and time. What I need is to send emails say 1 day, 6 hours and 1 hour before their respective appointments, cron job seems to be the option but how to run script at the specific times(when email has to be sent) for every user? ...

Fastest way to store & retreive translated text - database or flat file?

I am working on upgrading our site to work in different languages. My plan is to store paragraphs of text in mulitple languages and give each paragraph an identifier. Example id => '1' brief => 'welcome_paragraph' en => 'Welcome to our website!' de => 'Willkommen auf unserer Website!' Requirements quickly retreived edited via CMS a...

problem with date() function

i save in mysql database the time using NOW() function. how can i change the value returned of NOW() function? i want to add 6 hours. example if now() returns 2010-04-03 20:16:27, i want to save 2010-04-04 02:16:27 ...

random quote generator with php, ajax and mysql

i've tried using this code and this to make a random quote generator, but it doesn't display anything. my questions are: what is wrong with my code? in the above tut, the quote is generated on a button click, i'd like a random quote to be displayed every 30 mins automatically. how do i do this? //////////////////////// quote.html: ...

MySQL parameter resource error

Here is my error: Warning: mysql_query() expects parameter 2 to be resource, null given... This refers to line 23 of my code which is: $result = mysql_query($sql, $connection) My entire query code looks like this: $query = "SELECT * from users WHERE userid='".intval( $_SESSION['SESS_USERID'] )."'"; $result = m...

Proper mechanism for sending PHP errors to the client

Greetings, I was trying to discover a proper way to send captured errors or business logic exceptions to the client in an Ajax-PHP system. In my case, the browser needs to react differently depending on whether a request was successful or not. However in all the examples I've found, only a simple string is reported back to the browser in...

Pipe dynamic PDF into Imagemagick and convert to PNG

I need to create thumbnails from dynamic (database driven) pdf's. I've used a variation of the script below in the past, but this doesn't seem to be working for me now (page just hangs). <?php require_once('./template/all_includes.php'); $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read...

AJAX: Display MySQL data with value from multiple select boxes

I'm using the W3 Schools example: http://www.w3schools.com/PHP/php_ajax_database.asp to display a table of database data given the choice from a single select box. How can I modify this to include another select box, say for example I wanted records matching a name and an age? ...

Use openinviter with Rails or Java?

Hi, does anyone know if I can connect my self hosted Openinviter from within a Ruby on Rails or Java app, e.g. through an API? I couldn't find anything in the docs there and the forum isn't very active. It seems to be a good alternative to octazen, who have recently been bought by facebook and won't update their libs anymore. ...

How can I obtain the ID from the following example string?

Hi, I use the following method to pad out a ID for a property on our website: function generateAgentRef($id,$length=5,$strPrefix='1'){ return $strPrefix . str_pad($id,$length,0,0); } Basically it will prefix 1 and then pad out the id with 0's until the string reaches $length. But, I now have a requirement to revert this process....

How to get the age from a birthdate using PHP & MySQL?

I ask my users for their birthdate and store it in my database in the following way $month $day $year output May 6 1901 but I was wondering how can I get the age from the stored birthdate using PHP & MySQL? Here is the PHP code. if (isset($_POST['submitted'])) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mys...

Should I use Drupal or Kohana-type framework for a web "application"

The debate is that I need a PHP Framework/Drupal with the flexibility to add custom features to a potentially large application (web and with an api). However, with a framework, like Kohana, I see myself tackling and re-inventing the wheel with the simple stuff like account management and cms stuff. Account management and quick data col...

why echo does not show anything while php is busy

PHP Echo or Print functions does not show anything when php is busy with something (like when surfing the web with curl or something like that). Later i discovered php does show the output when you execute your php on the command line: php myscript.php But right now i don't get any outputs from command line too! Is there any kind of ...

Site login using cURL

I am using cURL for the first time. I need to login to a site and my code is not working. help. i have problem whit setting cookie <?php $cookie_file_path = tempnam('/tmp', 'cookie'); // Login variables $urls = 'http://mypage.php'; $uname = 'user'; $upass = 'pass'; $unamefield = '*****'; $upassfield = '*****'; $usubmit = 'submit'; /...

PHP File Upload second file does not upload, first file does without error

So I have a script I have been using and it generally works well with multiple files... When I upload a very large file in a multiple file upload, only the first file is uploaded. I am not seeing an errors as to why. I figure this is related to a timeout setting but can not figure it out - Any ideas? I have foloowing set in my htacc...

php arrays next() and prev()

I have an array that looks like this, Array ( [0] => 849710414 [1] => 849710726 [2] => 849710744 [3] => 849712728 [4] => 849713005 [5] => 849713439 [6] => 849714856 [7] => 849714924 [8] => 849716371 [9] => 849716441 [10] => 849717118 [11] => 849719043 [12] => 849719187 [13] => ...