הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   עזרה -PHP שגיאה מוזרה (https://hosts.co.il/forums/showthread.php?t=31934)

Art Watch 01-10-06 10:16

עזרה -PHP שגיאה מוזרה
 
אז ככה, התחלתי לבסס על מחלקות את אחת המערכות שלי ואני קולט פתאום שגיאה.
קוד:

Parse error:  syntax error, unexpected $end in /home/gil/domains/gil.vhost.co.il/public_html/news/skin/1/skin_index.php on line 33
אני מנסה לתקן ולא מואצ שום בעיה...
הנה הקובץ:
PHP קוד:

<?

class skin
{
    function 
offsystem($why) {
        global 
$lang;
        return <<<EOF

        <table width=75% class=border><th>
{$lang['systemoff']}</th>
        <tr><td>
{$why}</td></tr></table>

        EOF;
    }

    function viewcats($id,$name,$content) {
        global $lang;
        return <<<EOF

        <table width=100% class=border><th><a href=viewnews.php?id=
{$id}>{$name}</a></th>
        <tr><td height=75 valign=top>
{$content}</td></tr></table><br>

        EOF;
    }

    function num($num) {
        global $lang;
        return <<<EOF

        <table width=50%><th>
{$lang['thereare']} {$num} {$lang['categories']}</th></table>

        EOF;
    }
?>

לא חסר כלום ואין שטום בעיה עם הקוד... מה הולך פה?

Tomer 01-10-06 10:18

לא סגרת את ה class skin, תוסיף "{" אחד בסוף

opsite 01-10-06 10:25

מה לא מובן בשגיאה? $end

זה אומר שאין לך סגירה בשורה 33 פשוט גש חפש

פתיחה ששחכת לסגור ופשוט תסגור

כמו שתומר אמר
class skin

פתחת אותו ולא סגרת בסוף ... תוסיף בסוף שורה לפני
<?
{

Art Watch 01-10-06 10:40

הוספתי ועדיין אין.
כאילו אל תחשבו שלא ניסיתי את זה
הוא מראה לי אותה שגיאה רק בשורה 34 ולא 33

opsite 01-10-06 10:45

קבל
 
מצטער אחי ואללה אני עייף מת לא שמתי לב מיד תקבל את הקוד התקין

Art Watch 01-10-06 11:00

חחחחח ולמה נראה לך שזה יעבוד?
מצטער להגיד לך אתה משוגע, או שאין לך מושג בPHP.
אם לא שמת לב כל הקוד פה הוא לא טאקסט אלא קוד שזמין בPHP.
עשית מעצמך צחוק

opsite 01-10-06 11:07

חחחח ואיי אחי אני מזה מצטער... התבלבלתי יוווווווו איזה פאדיחה חחחחחחחחחח



שנייה אני יתן לך תמתוקן פשוט לא שמתי לב מה אני עושה תבין אותי

אני ער מ 8 בבוקר אתמול הכוונה

Art Watch 01-10-06 11:30

אני מחכה..

opsite 01-10-06 11:44

בעיה מאוד מאוד מוזרה
 
בשעה טובה.... ברוךהשם..


PHP קוד:

<?php
"
class skin
{
    function offsystem($why) {
        global $lang;
        return 'EOF';
        
<table width=75% class=border><th>{$lang['systemoff']}</th>
        <tr><td>{$why}</td></tr></table>

        EOF;
    }

    function viewcats($id,$name,$content) {
        global $lang;
        return 'EOF';

     <table width=100% class=border><th><a href=viewnews.php?id={$id}>{$name}</a></th>
        <tr><td height=75 valign=top>{$content}</td></tr></table><br>

        EOF;
    }

    function num($num) {
        global $lang;
        return 'EOF';

  <table width=50%><th>{$lang['thereare']} {$num} {$lang['categories']}</th></table>


        EOF;
    }
}
"
?>


Elad-A 01-10-06 11:59

עובד מצוין:

PHP קוד:


<?

class skin
{
        function 
offsystem($why
    {
            global 
$lang;
            echo 
"
            <table width=75% class=border><th>{$lang['systemoff']}</th>
            <tr><td>{$why}</td></tr></table>
            "
;
        }

        function 
viewcats($id,$name,$content
    {
            global 
$lang;
            echo 
"
            <table width=100% class=border><th><a href=viewnews.php?id={$id}>{$name}</a></th>
            <tr><td height=75 valign=top>{$content}</td></tr></table><br>
            "
;
        }

        function 
num($num
    {
    global 
$lang;
            echo 
"
           <table width=50%><th>{$lang['thereare']} {$num} {$lang['categories']}</th></table>
            "
;
        }
}
?>



כל הזמנים הם GMT +2. הזמן כעת הוא 16:50.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ