![]() |
|
#1
|
|||
|
|||
unable to accessright so I have a new.php file which is mainly html text, other than the include: <?php include("admin/showleftmenu.php");?>.
Now when I run new.php from the broswer, it gets stuck in a loop cos the showleftmenu.php file gives the following errors: <b>Warning</b>: fopen(): Unable to access lmenu.txt in <b>/new/admin/showleftmenu.php</b> on line <b>7</b> <b>Warning</b>: fopen(lmenu.txt): failed to open stream: No such file or directory in /new/admin/showleftmenu.php</b> on line <b>7</b> etc etc. At first I thought it was cos the lmenu.txt file had the wrong permissions but I changed that and i'm still having probs. This is the code in the showleftmenu.php file: PHP Code:
Last edited by dsmith : 06-May-2004 at 08:00.
Reason: Please use [php] & [/php] for syntax highlighting
|
|
#2
|
||||
|
||||
|
Dopee, I really don't get it why you need to include ONE file (i.e. showleftmenu.php) which in turn is ONLY reading in a text file. This is what I don't understand...
Get straight to the point; simply include in the text file. So inside new.php: PHP Code:
If that idea doesn't suit you, then the reason you might be getting that "warning" message is cause your path is wrong... inside showleftmenu.php: PHP Code:
.. utltimately you can control the include folder in php.ini but this is something you probably want to do at a later stage. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
hey jds thanx for the reply.
Yes I understand now...I added $leftMenu = "lmenu.txt"; $lfilePointer = fopen($leftMenu, "r+"); while (!feof($lfilePointer)) { $line = fgets($lfilePointer, 4096); print $line; } fclose($lfilePointer); ?> to my new.php file and it works fine now. But now I have another ques: In this code: <?php require_once( './admin/lmenu.txt' ); ?> Is this better code to use instead of opening,reading, and closing the text file? |
|
#4
|
||||
|
||||
|
I would GUESS so but to be honest I haven't really made any tests to see if that is indeed true. However, just counting the functions required to open, read (,print/echo) and close a file rather than just include it sounds a lot more complicated to me.
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
Belkin Laptop Cooler by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remote access to XP Prof op. system | lizard- | Computer Hardware Forum | 10 | 18-May-2005 06:44 |
| access local webserver from the local host | calisro | Apache Web Server Forum | 1 | 10-May-2004 08:53 |
| Urgernt: Extremely queer Apache access log | moothecow | Apache Web Server Forum | 1 | 20-Dec-2003 02:45 |
| FREE 25 MB, No Ads, Control Panel, ASP, ColdFusion, PHP, MySQL, Access Hosting | rkmails | Free Web Hosting | 0 | 08-Sep-2003 05:49 |
| Access 2000 | pcxgamer | Web Design Forum | 6 | 23-May-2003 06:29 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The