masal_eser Posted March 11, 2008 Share Posted March 11, 2008 I’m using a html file as a DirectoryIndex and I want to execute php code on my html file. I have the following line in my configuration file: AddType application/x-httpd-php .html And my index.html file contain this lines: <html><body><h1>Restricted Area</h1> <?php if ($_SERVER["SSL_CLIENT_S_DN_CN"] == 'myemail@email.com' or ………………..) { die '<ul><li><a href="../">Parent Directory</a><br><br></li><li><a href="Journal.pdf">Journal</a></li><li><a href="credentials.html">Credentials</a></li></ul>'; } else { die '<h1>You Don't Have Acccess To This Area.</h1>'; } ?> </body></html> But I’m getting error. The page just prints all the codes after the </ul>. Can anyone help me? Quote Link to comment Share on other sites More sharing options...
trq Posted March 11, 2008 Share Posted March 11, 2008 What is this or................... thing? if ($_SERVER["SSL_CLIENT_S_DN_CN"] == 'myemail@email.com' or ………………..) And can you please use tags when posting code. Quote Link to comment Share on other sites More sharing options...
masal_eser Posted March 11, 2008 Author Share Posted March 11, 2008 Sorry, I'm just new here. This .................. means that I have several $_SERVER["SSL_CLIENT_S_DN_CN"] checks. <html><body><h1>Restricted Area</h1> <?php if ($_SERVER["SSL_CLIENT_S_DN_CN"] == 'myemail@email.com' or ………………..) { die '<ul><li><a href="../">Parent Directory</a> </li><li><a href="Journal.pdf">Journal</a></li><li><a href="credentials.html">Credentials</a></li></ul>'; } else { die '<h1>You Don't Have Acccess To This Area.</h1>'; } ?> </body></html> Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted March 11, 2008 Share Posted March 11, 2008 i think what your trying to do is put php code in a .html file, to execute php code the file name needs to be .php. Quote Link to comment Share on other sites More sharing options...
trq Posted March 11, 2008 Share Posted March 11, 2008 Well, there is an error in this line.... die '<h1>You Don't Have Acccess To This Area.</h1>'; Needs to be.... die "<h1>You Don't Have Acccess To This Area.</h1>"; Also, if your going to post problematic code to a forum, its best to post the exact code. You never know, you maye have removed the error with your or .............. bit, we can't tell. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.