עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

what's wrong with my php news reader/writer script?

Featured Replies

פורסם

there is : "news.txt" that goes as follows:

News Name

Some Name

Some Date

Some News

....

...

End News

my script goes like this:

read.php


<?php

function getnews()
{

$filename = "news.txt";
$newsf = fopen($filename,"r");

$i=0;
while ((!feof($newsf)) && ($i<20))
{
$tmpname = fgets($newsf);
$newss = "News Name";
while ($tmpname != $newss)
{
$tmpname = fgets($newsf);
}
$NNames[] = fgets($newsf);
$NDates[] = fgets($newsf);
$tmpnews = fgets($newsf);
$endon = "End News";
while ($tmpnews != endon)
{
$sumn = $sumn . $tmpnews;
$tmpnews = "";
$tmpnews = fgets($newsf);
}
$NNews[] = $sumn;
$sumn = "";
$i++;
}
fclose($newsf);
}
?>

פורסם

את זה גם אתה יכולת לראות(וגם מישהו שלא יודע כל כך PHP).



while ($tmpnews != endon)
{
$sumn = $sumn . $tmpnews;
$tmpnews = "";
$tmpnews = fgets($newsf);
}

חסר לך שם $ בWHILE.

פורסם
  • מחבר

אופס ::)

זה מה שקורה כשכותבים תוכנות ב4 בבוקר....

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.