[ create a new paste ] login | about

Link: http://codepad.org/mhvDHx1U    [ raw code | output | fork ]

PHP, pasted on Feb 22:
<?php
include('../config.php');
set_time_limit(0);


//$dataFileName = 'data.txt';



while ( true )
{
	$row = $db->get_row("SELECT * FROM `test`  WHERE `id` = 6");
	$requestedTimestamp = isset ( $_GET [ 'timestamp' ] ) ? (int)$_GET [ 'timestamp' ] : null;
	
	clearstatcache();
	
	
	$modifiedAt = $row->laiks;
	
	if ( $requestedTimestamp == null || $modifiedAt > $requestedTimestamp )
	{
		
		$image_name = basename($row->foto).PHP_EOL;
		
		
		
		//$row2 = $db->get_row("SELECT * FROM `forums_user` WHERE `card_id` = '$row->name'");
		//$data = '
		
		//<div style="background:#343642;width:100%;height:100vh;color:#fff;">
		//		<center>
			//		<h1>'.$row2->vards.' '. $row2->uzvards.'</h1>
		//			<center>
		//			<img style="width:50%;"src="image.php/'. $image_name .'?width=300&height=300&cropratio=4:5&image=/'. $row2->foto.'" />
		//			</center><br/><br/>
		//			'.  $row2->sia .' <br/>
		//			'. $row2->amats.'<br/>
		//		</center>
		//		
		//		</div>
				
				
					
		
		
		
		//';
		$id = $row->name;
		
		$row2 = $db->get_row("SELECT * FROM `forums_user` WHERE `card_id` = '$id'");
		
		$image_name = basename($row2->foto).PHP_EOL;
		$dati = '<h1>'.$row2->vards.' '. $row2->uzvards.'</h1>
		<br/>
		<img src="image.php/'. $image_name .'?width=300&height=300&cropratio=4:5&image=/'. $row2->foto.'" />
		
		<br/><br/>
					'.  $row2->sia .' <br/>
					'. $row2->amats.'<br/>
					
					'.$id.';
		';
		
		
		
		$arrData = array(
			'content' => $dati,
			'timestamp' => $modifiedAt
		);		

		$json = json_encode( $arrData );

		echo $json;

		break;
	}
	else
	{
		sleep( 1 );
		continue;
	}
}
?>


Output:
1
2
3
4
5
6

Warning: include(../config.php): failed to open stream: No such file or directory on line 2

Warning: include(): Failed opening '../config.php' for inclusion (include_path='.:/usr/lib/php') on line 2

Fatal error: Call to a member function get_row() on a non-object on line 12


Create a new paste based on this one


Comments: