[advanced search]
Results from the most recent live auction are here.
10 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 10-23-2003, 01:26 PM   · #1
adam_uk
Senior Member
 
Trader Rating: (17)
Join Date: May 2003
Posts: 2,211
NP$: 6170.25 (Donate)
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
Breast Cancer
fopen

hey anyone ever had nightmares with this?

i am at the moment

basically im stuck

what does "resource ID #3" mean anyone?

ive got this peice of code
$page = $_GET['page'];
if($page ==""){
$handle = fopen ("D:\bin\Apache\htdocs\1\welcome.inc.php", "r");
}else{
$inc = ".inc.php";
$handle = fopen ("D:\bin\Apache\htdocs\1\$page$inc", "r");
}

EDIT: i woulda stuck it in php but it took some of my code away :S

and it chucks out that error the path is correct :'( all i wanna do is open it then echo it :'(


Please register or log-in into NamePros to hide ads
adam_uk is offline   Reply With Quote
Old 10-25-2003, 10:41 PM   · #2
deadserious
Senior Member
 
Trader Rating: (13)
Join Date: Aug 2002
Posts: 1,300
NP$: 2.85 (Donate)
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
Hey I'm not exactly sure what the resource id 3 means, but I think it's something to do with you're attempting to print some output without ever reading the file or attempting to open nothing or something along those lines.

Something like this should work:

$page = $GET['page'];
if($page ==""){
$handle = fopen ("D:\bin\Apache\htdocs\1\welcome.inc.php", "rb");
$contents = fread ($handle, filesize ("D:\bin\Apache\htdocs\1\welcome.inc.php"));
fclose ($handle);
}else{
$inc = ".inc.php";
$handle = fopen ("D:\bin\Apache\htdocs\1\$page$inc", "rb");
$contents = fread ($handle, filesize ("D:\bin\Apache\htdocs\1\$page$inc"));
fclose ($handle);
}
?>

Then you should be able to output $contents.
deadserious is offline   Reply With Quote
Old 10-26-2003, 03:33 AM   · #3
adam_uk
Senior Member
 
Trader Rating: (17)
Join Date: May 2003
Posts: 2,211
NP$: 6170.25 (Donate)
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
Breast Cancer
ahhhhhhhh wicked cheers


been doing my head in
adam_uk is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Traffic Down Under Find out how! Click to Watch Instant Video
Advertise your business at NamePros
All times are GMT -7. The time now is 02:12 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0