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
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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.