Kristian_C Posted January 14, 2007 Share Posted January 14, 2007 Hey, im verry tired of getting so ugly shtml errors when etc page is offline ++and i wondered, is it possible to insert direct sql/php/html maybe js? is this possible or must it be runned another way then shtml files, if thats the case, how to do it?->Kristian_C. Link to comment Share on other sites More sharing options...
MrAdam Posted January 14, 2007 Share Posted January 14, 2007 do you mean like, templated pages using includes?my way of doing it is to create a file called "templates.php" or something. have a few functions within it, mainly "writeHeader($title)" and "writeFooter()". The variable $title obviouslly to change the title of the page.then include templates.php, and run the functions where i want them. Link to comment Share on other sites More sharing options...
Kristian_C Posted January 14, 2007 Author Share Posted January 14, 2007 do you mean like, templated pages using includes?my way of doing it is to create a file called "templates.php" or something. have a few functions within it, mainly "writeHeader($title)" and "writeFooter()". The variable $title obviouslly to change the title of the page.then include templates.php, and run the functions where i want them.ERROR 404 and stuff like that, like if you open a link, and the site is down, you see : cant find server ++ those files are saved as .shtml .. i know it is possible to request IP/Browser/url +++ in those but then it must be like this : <!--#echo var="HTTP_REFERER" --><!--#echo var="REMOTE_ADDR" --><!--#echo var="REQUEST_URI" --> and i want to have like etc: <?$er=mysql_query("SELECT * FROM errors WHERE errortype='404'");$re=mysql_fetch_object($er);echo"$re->main";?><br><br><?echo"$re->errortext"?><br><br><br><br><br><br><?echo"$re->foot";?> Just dont know if im allowed to use regular php in there becouse i really dont know how .shtml operates..got any suggestions?.->Kristian_C. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 15, 2007 Share Posted January 15, 2007 Are you talking about creating a custom error page? Or displaying another version of the page if you get a 404 error? Link to comment Share on other sites More sharing options...
Kristian_C Posted January 16, 2007 Author Share Posted January 16, 2007 Are you talking about creating a custom error page? Or displaying another version of the page if you get a 404 error?The main problem is just to add php to the error page. tried normal but seems like it dont work, so i dont think it is possible to use php.->Kristian_C Link to comment Share on other sites More sharing options...
justsomeguy Posted January 16, 2007 Share Posted January 16, 2007 It is possible to use whatever you want, but you need access to the web server to do so. If you have access to the server, then what server are you running? Link to comment Share on other sites More sharing options...
Kristian_C Posted January 16, 2007 Author Share Posted January 16, 2007 Server info : Operating system Linux Kernel version 2.6.9-42.0.3.ELsmp Machine Type i686 Apache version 1.3.36 (Unix) PERL version 5.8.7 PHP version 4.4.4 MySQL version 4.1.21-standard hope that helps.->Kristian_C. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 16, 2007 Share Posted January 16, 2007 Well, I'm not sure how to set up a custom error page with Apache, but I've done it with IIS. Someone else might know how to set up Apache, or you can ask your host to set it up for you. Link to comment Share on other sites More sharing options...
Kristian_C Posted January 16, 2007 Author Share Posted January 16, 2007 Well, I'm not sure how to set up a custom error page with Apache, but I've done it with IIS. Someone else might know how to set up Apache, or you can ask your host to set it up for you.okay, ill ask ->Kristian_C. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now