Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fseek question

Status
Not open for further replies.

fluxdemon

MIS
Nov 5, 2002
89
US
Does fseek check to see if the site is there or do I have to point it to a file?

<?php

primaryURL=&quot;
if (fseek(primaryURL, r) include_once(primaryURL.txt)
else include_once(backupURL.txt)

?>
 
Hi,

> Does fseek check to see if the site is there or do I have to point it to a file?
I'm not quite sure what you mean. Do you want to check the existence of a site, before opening? What I do know is that FSEEK doesn't does this job.

QUOTE FSEEK DOCUMENTATION (php.net)
--------------------------
int fseek ( resource handle, int offset [, int whence])

Sets the file position indicator for the file referenced by handle.The new position, measured in bytes from the beginning of the file, is obtained by adding offset to the position specified by whence, whose values are defined as follows:

SEEK_SET - Set position equal to offset bytes.
SEEK_CUR - Set position to current location plus offset.
SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.)


If whence is not specified, it is assumed to be SEEK_SET.
--------------------------
END QUOTE

I think you should use FOPEN instead. You can read all about it at php.net (including examples)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top