Jump to content

[SOLVED] question


adam291086

Recommended Posts

hello,

 

I have a website that displays some test results, these are generated from another website. All is working well. What i want to do though is modify the contents to display 10 of the rows of information rather than the 100.

 

Can i do this with php?

If so how?

If not what should i look for?

Link to comment
https://forums.phpfreaks.com/topic/74699-solved-question/
Share on other sites

at the moment i am using a basic Iframe. The image is created by software that monitors my works web server.

 

<iframe src="website address, cant give it to you as it contains ip addresses=True"
id="indicative"
name="indicative"
frameborder= 1
height="100%"
width="100%">
</iframe>

 

 

Link to comment
https://forums.phpfreaks.com/topic/74699-solved-question/#findComment-377647
Share on other sites

you could file_get_contents, then explode it at certain points? Then have, like:

 

<?php
file_get_contents('siteaddress');
$line = explode('say, like, </td>, which would split every table part up', $line);
$i = 0
foreach($line as $data){
if($i =< 10){
echo 'linedata';
}
$i++
}
?>

Link to comment
https://forums.phpfreaks.com/topic/74699-solved-question/#findComment-377650
Share on other sites

explode basically breaks up data into pieces. It's constructed like so:

 

$new_variable = explode('the character to explode by', $old_variable);

 

So, now, if you had this data:

 

$old_variable = first|second

 

and said

 

$new_variable = explode('|', $old_variable);

 

it breaks it up so you'd get this

 

$new_variable[0] = 'first';

$new_variable[1] = 'second';

 

and, if you added more, it would go on like that.

Link to comment
https://forums.phpfreaks.com/topic/74699-solved-question/#findComment-377655
Share on other sites

ok thanks i now understand, the problem being that is it possible to file_get_contents() on a website address? I have a simple file working but its not getting the site contents.

<html>
<head>
</head>
<body>
<?php
// Get a file into an array.  In this example we'll go through HTTP to get
// the HTML source of a URL

$lines = file_get_contents('www.google.co.uk');
if ($lines)
{	 
echo $lines;  	
}	
else  	
{  		
echo "No File Found";  		
}

?>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/74699-solved-question/#findComment-377657
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.