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

הוסטס - פורום אחסון האתרים הגדול בישראל (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)

opsite 01-10-06 12:16

אלעד אחי כמו שאני עשיתי.. רק שאתה עשית לכל טבלה echo//

הכי חשוב שבסוף שניהם עובדים

תהנה גיל

RS324 01-10-06 15:24

ציטוט:

נכתב במקור על ידי opsite
בשעה טובה.... ברוךהשם..


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;
    }
}
"
?>


אתה יכול להסביר למה לעזאזל התחלת וסיימת את העמוד עם " ?
מה הקשר של זה לפה ?

opsite 01-10-06 15:46

תוריד אותם ותראה..

במקום לשים לכל טבלה echo "
שמתי למעלה למטה וזהו עובד


אני עובד ככה ושוב ... העיקר שזה עובד

-VladK- 01-10-06 16:35

ציטוט:

נכתב במקור על ידי opsite
תוריד אותם ותראה..

במקום לשים לכל טבלה echo "
שמתי למעלה למטה וזהו עובד


אני עובד ככה ושוב ... העיקר שזה עובד

WTF...פעם ראשונה שאני שומע על זה....מה שאתה עושה פה זה להפוך את כל הקוד...אפילו הPHP לטקסט =/...או שזה משהו חדש?

Art Watch 05-10-06 15:49

מצטער על הUP?
אבל בצעם אפחד מהם לא הצליח :| ואני מתעקש להשתמש בreturn
שיהיה אפשורת לשים HTML בקלילות

-VladK- 05-10-06 16:21

תהנה...

PHP קוד:

<?

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

        function 
viewcats($id,$name,$content
    {
            global 
$lang;
            return 
"
            <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;
            return 
"
           <table width=50%><th>{$lang['thereare']} {$num} {$lang['categories']}</th></table>
            "
;
        }
}
?>


A.M.F 05-10-06 18:16

EOF;
יש לפני כן רווח. אסור שיהיה לפני זה רווחים
כנ"ל לגבי HTML; אם אתה משתמש בזה.

Elad-A 05-10-06 18:35

בדקתי וזה עובד מעולה. (עם return)

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;
    }
}
?>



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

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