Forum Moderators: coopster
I am asking again your help for my problem in your previous code that I am connecting to another server with your code which it is giving error on status bar the reason of gif & jpg.
Could you please help me which command I have to add to remove gif & jpg in your code that your previous code are as follows;
<?php
$file = fopen("http://www.domain.com/test.asp", "r") or die("Serverla ileti?im sa?lanamady!");
while(!feof($file)){
$line = trim(fgets($file));
$line = str_replace("<a", "<a target=\"_blank\"", $line);
$text .= $line;
}
fclose($file);
echo $text;
?>
Thanks advance your kind help for my problem.
Best Regards
armator
<?php$file = fopen("http://www.domain.com/test.asp", "r") or die("Serverla ileti?im sa?lanamady!");
while(!feof($file)){
$line = fgets($file);//I wouldn't write trim to preserve the layout of the source
$line = str_replace("<a", "<a target=\"_blank\"", $line);
$text .= $line."\n";
}
fclose($file);
$begin = 0;
$end = 0;
while(($begin = strpos($text, "<img", $end))!== false)
{
$end = strpos($text, ">", $begin) + 1;
$t_start = substr($text, 0, $begin);
$t_end = substr($text, $end, strlen($text) - $end);
$text = $t_start.$t_end;
}
echo $text;
?>
I know that this code looks a bit horrifying at the first sight, but it works!
Michal Cibor
you can also change color on mouseover and mouseout
<td style="background-color: rgb(1, 1, 1);" onmouseover="this.style.backgroundColor='#FEFEFE'" onmouseout="this.style.backgroundColor='rgb(1,1,1)';">
Best regards!
But you should really use more google ( [google.com...] )
Michal Cibor
Thanks your quick reply.
I am using style css in php that it is sometimes changing font colors & sizes which I am giving you as below.
But I would like to learn which command we can add in your previous code to change tr's / td's color & size .
My style css;
<style>
body {
background-color: #FFFFFF;
font-family: Arial, Verdana, sans-serif;
font-size: 0px;
color: #000000;
}
a { font-family: Arial, Verdana, sans-serif; font-size: 0px ; color: #ffffff; text-decoration: none}
a:hover { font-family: Arial, Verdana, sans-serif; font-size: 0px; color: #ffffff; background-color: #ffffff}
table { font-family: Arial, Verdana, sans-serif; font-size: 0px; color: #000000; margin-top: 11px; margin-right: 0px; margin-bottom: 0px; margin-left: -1px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px }
td { background-color: #ffffff; }
.note { font-family: Arial, Verdana, sans-serif; font-size: 0px; color: #000000;
font-weight: bold;}
</style>
Thanks again your kind interest and help.
Best Regards
Metin Mentes
...
while(($begin = strpos($text, "<img", $end))!== false)
{
}$t_style = "<style...</style>";//your whole style text
if(($style_begin = strpos($text, "<style"))!== false) $style_end = strpos($text, "</style>", $style_begin) + 8;
elseif(($style_begin = strpos($text, "<link"))!== false) $style_end = strpos($text, ">", $style_begin);
else
{$style_begin = strpos($text, "</head>"); $style_end = $style_begin;}
$t_style_begin = substr($text, 0, $begin);
$t_style_end = substr($text, $end, strlen($text) - $end);
$text = $t_style_begin.$t_style.$t_style_end;
echo $text;
?>