Fopen

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
NamecheapNamecheap
Watch

adam_uk

Established Member
Impact
20
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 :'(
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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.
 
0
•••
ahhhhhhhh wicked :D cheers


been doing my head in :D
 
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back