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

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

Bernoli 12-02-12 15:31

בעיה ב-include
 
שאני מנסה לעשות
PHP קוד:

include("templates/page.php?id={$page}"); 

אני מקבל שגיאה:
HTML קוד:

Warning: require(templates/page.php?id=11) [function.require]: failed to open stream: No such file or directory in /home/amir123/domains/***.bernoli.co.il/public_html/***/index.php on line 28

Fatal error: require() [function.require]: Failed opening required 'templates/page.php?id=11' (include_path='.:/usr/local/php5/lib/php') in /home/amir123/domains/***.bernoli.co.il/public_html/***/index.php on line 28

מה אפשר לעשות ?

Tomer 12-02-12 15:44

אתה חייב לעשות include לכתובת מלאה (http://domain/templates/page.php?id=x). אי אפשר לעשות include לוקאלי למשתנה.

Bernoli 12-02-12 15:48

תודה..

mmh 12-02-12 22:55

לא הבנתי למה לעשות את זה בכלל..
אבל אתה יכול להשתמש בfile_get_contents

Kernel 12-02-12 23:01

תנסה להוציא את המשתנה בלי להשתמש ב-INCLUDE ל-URL,
אתה מאריך מאוד את זמן הצגת העמוד (TTFB בריבוע).


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

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