עזרה בבקשה

bnayal

New member
עזרה בבקשה

אני קורא דף ככה:
<?php $d = "http://www.tapuz.co.il/tapuznews/"; $file = fopen ($d, "r"); feof ($file); $y = fread($file, 4096); $y = nl2br (htmlspecialchars($y)); echo $y; fclose ($file); ?>​
הבעיה היא שהקוד הזה יציג לי רק את ה4096 התוים הראשונים, יש אפשרות להציג את כל הדף בלי לעשות ככה: <?php $d = "http://www.tapuz.co.il/tapuznews/"; $file = fopen ($d, "r"); feof ($file); while ($y = fread($file, 4096)){ $y = nl2br (htmlspecialchars($y)); echo $y; } fclose ($file); ?> ????? תודה מראש לעונים!
 

kensaggy

New member
מממ...

אפשר להשתמש ב file..
<?php $url = "http://www.tapuz.co.il/foobar.html"; $file = implode("\n",file($url)); echo $file; ?>​
בהצלחה, חן.
 

orenphp

New member
איזה צירוף מקרים....

שלחת את ההודעה איזה כמה שניות לפני... :)
 

orenphp

New member
אם היית נכנס לphp.net

היית מקבל שם דוגמאות איך לקרוא את כל העמוד: php.net/fopen php.net/file הנה פיתרון אחד לבעיה:
$url = "http://www.your-site...."; $text = implode("", file($url));​
(לקוח כמובן מphp.net/file) בהצלחה.
 

bnayal

New member
עוד שתי שאלות:

1. למה הקוד:
<?php $d = "http://software.walla.co.il/"; $file = fopen ($d, "r"); feof ($file); $y = fread($file, 4096); $x = '/tsscript=item&path=&id=.*/'; preg_match_all ($x, $y, $o, PREG_PATTERN_ORDER); print '<a href="http://news.walla.co.il/ts.cgi?'.$o[0][0].'<br>'; fclose ($file); ?>​
עובד על המחשב שלי, ועל ליקוס לא? 2. משום מה ההגדרות של השרת שעל המחשב שלי הן לא לתת למשתמשים לגלוש בדפים בתוכו אלה רק שאני גולש דרך localhost? תודה מראש!!!
 
למעלה