php

reset all logged in users after they shutdown their consoled

i have list of student who have Nintendo DSs, and they should log in my website to solve some sheets (by using DS Opera browser), when they logged in , (status filed at my DB will change from 0 to 1),also the status change to 0 if they log out, what i need is when the student didn't log out and Shut down their DS's , the status should be...

Good resources to learn php debugging

What are the best resources do you recommend for learning php debugging? Is there any specific book, screencast, blog post or article that you really found useful? ...

Action "foo/foobar" does not exist error in Symfony

I am saving pictures under my web folder in the folder: web/media/photo In the template that displays the photo, I have the following snippet: <?php echo link_to(image_tag('media/photo/filename.jpg', '@some_url); ?> When I display the view, although the photo is displayed correctly and the link works, I get the following error in my...

How to retrieve email from GMail account using PHP?

Hi, I'm trying to automatically retrieve some email from my GMail account for further parsing, but I can't get my head around on how to do that. I've searched the internets and it suggested that I use PHP's imap functions, like this: $server = '{imap.gmail.com:993/ssl}'; $connection = imap_open($server, '[email protected]', 'password')...

Google Chart Tool Example Not Working

Hi , I am using the php post request example given on http://code.google.com/apis/chart/docs/post_requests.html for generating chart. The code: chartserver-image.php <?php // Create some random text-encoded data for a line chart. header('content-type: image/png'); $url = 'http://chart.apis.google.com/chart'; $chd = 't:'; for ($i ...

What's the regex to solve this problem?

I have an array in PHP with URLs like below: http://example.com/apps/1235554/ http://example.com/apps/apple/ http://example.com/apps/126734 http://example.com/images/a.jpg http://example.com/images/b.jpg http://example.com/apps/2331234/ http://example.com/apps/orange/ How can I separate out these urls and push them to another array us...

PHP Possible Memory Leak

I have a script that loops through a database for images to convert with gd & imagick. I unset or replace all variables and objects in between each loop. For each loop, get_memory_usage(1) reveals a concurrent amount of memory used by that script. Which is expected. But, when I run "top", the %MEM column reports that this script, (sam...

is it correct to unset the session variable for a particular index as the vay whole session is made unset in PHP?

is it correct to unset the session variable for a particular index as the vay whole session is made unset in PHP? I know this works: unset($_SESSION['bannersize']) But does this works ? : unset($_SESSION['bannersize'][3]) or is there any other way to unset any particular desired index of the session and then again rearrange the values...

Location of DB models in Zend Framework - want them centralized

Maybe I've been staring at the problem too long and it's much simpler than I think, but I'm stuck right now. I have three websites that are going to share database models. I've structured my applications so that I have an application directory for each site and a public directory for each site. The DB models live in a directory in the...

converter for xls to sql converter

Hi , Am looking converter for xls to sql converter . Or Is There any script for insert from xls spread sheet to table , Regards Bharanikumar ...

php numbers: assert( 1.0 < 2.0 )

How can this <?php assert( 1.0 < 2.0 ); ?> result in Warning: assert() [function.assert]: Assertion failed in C:\Program Files (x86)\wamp\www\test.php on line 2 Edit: depending on the file I put this code in, 1.0 < 2.0 evaluates to false or true. ...

Regex fix for this? [extension]

Sorry for the redundancy, I should've asked this in my previous question here: http://stackoverflow.com/questions/3061407/whats-the-regex-to-solve-this-problem This question is an extension: From the elements in an array below: http://example.com/apps/1235554/ http://example.com/apps/apple/ http://example.com/apps/126734 http://exampl...

session destroy help in php

how we can destroy the session when we click in the close button in my browser.. ...

JQuery to PHP function and back Ajaxed

Hi all, i have a set of php function that i want to call on different events mostly onclick with jquery async (ajax). The first function is called on load $(document).ready(function() { $("#div2").hide('slow'); $("#div1").empty().html('<img src="ajax-loader.gif" />'); $.ajax( ...

Send smtp mail in php with HTML page attach as a text

Hello All.... I have a requirement of sending mail using smtp server in php. Now I am able to send the mail using smtp for a plain text. but I have a requirement where I need to attach an HTML page, which includes set of images. Now for that I am trying the following code : <?php require_once "Mail.php"; $to = '[email protected]'; ...

php lampp permissions of fopen function

hi i'm programming php using: netbeans 6.8 lampp for ubuntu (xampp) apache which came with xampp $fh = fopen("testfile2.txt", 'w') or die("Failed to create file"); $text ="hello man cool good"; fwrite($fh, $text) or die("Could not write to file"); fclose($fh); echo "File 'testfile.txt' written successfully"; //i...

How to retrieve query string value from URL value stored in a variable?

Hello, $url = 'http://www.domain.com/file.php?dir=r&amp;hl=100,200&amp;ord=3&amp;key=a+b+c'; If it were a url I could get value of hl by, say, $_GET['hl']. but how do I retrieve the same from $url string. Thanks. ...

What's the best way to get rid of .php suffix in url strings so they look pretty?

Possible Duplicate: Remove .php extension with PHP What's the best way to get rid of .php suffix in url strings so they look pretty? Thank you in advance;-) ...

How to rearrange the array element from 0th index in the sequence to end?

How to rearrange the array element from 0th index in the sequence to end in PHP? UPDATED I have an array: $input =array{ 2 => '13234390', 4 => '12345290', 5 => '21322210' } now I want this array to be rearra...

How to download a webpage in php

Hello! I was wondering how I could download a webpage in php for parsing? ...