Jump to content

[SOLVED] Warning: flock() expects parameter 1 to be resource


eMonk

Recommended Posts

i'm getting the error in the topic with this code. i don't think i'm pointing to the correct path using  $DOCUMENT_ROOT.

 

$DOCUMENT_ROOT = $SERVER['DOCUMENT ROOT'];

// open file for appending
@ $fp = fopen("$DOCUMENT_ROOT/www.domain.com/orders/orders.txt", 'ab');

flock($fp, LOCK_EX);

if (!$fp) {
echo "<p><strong>Your order could not be processed at this time.
	 Please try again later.</strong></p></body></html>";
exit;
}

 

- the .php file is uploaded in /www.domain.com/test/processorder.php

- the orders.txt is uploaded in /www.domain.com/orders/orders.txt

 

how do i know 100% if i'm pointing to the right file in fopen?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.