chopficaro Posted April 16, 2010 Share Posted April 16, 2010 this: <!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: <!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;"> </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%20resume%20site%20v1.4/actionscript.php i have directory listings enabled so u can go up a directory and check. Link to comment https://forums.phpfreaks.com/topic/198809-file_get_contents-geshi/ Share on other sites More sharing options...
ChemicalBliss Posted April 16, 2010 Share Posted April 16, 2010 I would read the faq/readme/install file, must be one if its a custom script. I would *guess*, since i dont know the script: <?php include_once 'geshi.php'; $language = 'actionscript 3'; $file = file_get_contents('/samples/actionscript/firebutton.as', FILE_USE_INCLUDE_PATH); $geshi = new GeSHi($file, $language); echo $geshi->parse_code(); ?> good luck tho -cb- Link to comment https://forums.phpfreaks.com/topic/198809-file_get_contents-geshi/#findComment-1043424 Share on other sites More sharing options...
chopficaro Posted April 17, 2010 Author Share Posted April 17, 2010 i copied the code right from the websites documentation Link to comment https://forums.phpfreaks.com/topic/198809-file_get_contents-geshi/#findComment-1043596 Share on other sites More sharing options...
trq Posted April 17, 2010 Share Posted April 17, 2010 You should at least try and trap errors. <?php include_once 'geshi.php'; if ($file = file_get_contents('/samples/actionscript/firebutton.as', FILE_USE_INCLUDE_PATH)) { $geshi = new GeSHi($file, 'actionscript 3'); echo $geshi->parse_code(); } else { trigger_error('Error reading file', E_USER_ERROR); } Link to comment https://forums.phpfreaks.com/topic/198809-file_get_contents-geshi/#findComment-1043599 Share on other sites More sharing options...
chopficaro Posted April 17, 2010 Author Share Posted April 17, 2010 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 Link to comment https://forums.phpfreaks.com/topic/198809-file_get_contents-geshi/#findComment-1043600 Share on other sites More sharing options...
ChemicalBliss Posted April 17, 2010 Share Posted April 17, 2010 Well the its a problem with their script, contact their support. -cb- Link to comment https://forums.phpfreaks.com/topic/198809-file_get_contents-geshi/#findComment-1043807 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.