Page 1 of 1

file_get_contents, geshi

Posted: Fri Apr 16, 2010 6:40 pm
by chopficaro
this:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Patrick Allard</title>
</head>
<body>
<p>html working</p>
<?
include_once 'geshi.php'; 
$file = file_get_contents('/samples/actionscript/firebutton.as', FILE_USE_INCLUDE_PATH); 
echo $file;
$language = 'actionscript 3';
$geshi = new GeSHi($file, $language);
echo $geshi->parse_code();
?>
</body>
</html>
is producing this:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Patrick Allard</title>
</head>

<body>
<p>html working</p>
<pre class="actionscript3" style="font-family:monospace;">&nbsp;</pre>
</body>
</html>
it should have at least echoed the file back, even if im not doing the geshi class correctly, but i am pretty sure i am. i know the directory of firebutton.as is correct, and im pretty sure i put everything that geshi needs where it should be. i unpacked it so that geshi.php is in the same directory as my script, along with the folders it came with. if you want to check my directorys go here:
http://patiscool.000space.com/pats%20re ... script.php
i have directory listings enabled so u can go up a directory and check.

Re: file_get_contents, geshi

Posted: Fri Apr 16, 2010 7:06 pm
by requinix
The file_get_contents didn't work - probably because you didn't give the right file path.

Check it again.

Re: file_get_contents, geshi

Posted: Sat Apr 17, 2010 2:16 am
by chopficaro
i fixed everything by using file_get_constants without a directory, so i guess ii wont organize the samples into folders. i am certain that the directory was correct though, this will bug me for a long time