Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How to Include PHP script in shtml file ???

Reply
Thread Tools

How to Include PHP script in shtml file ???

 
 
Michael Winter
Guest
Posts: n/a
 
      10-28-2005
On 27/10/2005 23:38, EnjoyNews wrote:

[snip]

> I thought maybe some javascript in my .html file could execute
> another file, in this case a .php file. [...]


It could, but it's not a good solution. One of the advantages of using
the server is that you can reliably perform actions using it. Using a
client-side script negates this reliability and, let's face it, the
reason why you're looking for a quick way out is because you're not
inclined to make the necessary effort to solve the problem properly.

[Me:]
>> What's a .shtml site, anyway?

>
> it's a .html file that uses serverside commands like "include file"


I'm well aware of SSI. You missed my point, but it's not important.

[snip]

> It's rather complicated to rename the files from .shtml to .php,
> since all the serverside commands used in the files, does not work in
> an .php file.


With your server configuration, yes. However, it strikes me as rather
odd that you didn't forsee this issue.

[snip]

> But how do I get the server to pass .shtml file through PHP. ??


I'm curious to know why it doesn't anyway. An SSI include element should
pass a PHP script through the preprocessor. The URL for the virtual
attribute value (typically preferred over file) can even include a query
string that can be accessed as usual.

If the server is configured with IncludesNOEXEC, rather than Includes,
then an error will result because permission to execute the script was
not granted, but you made no mention of that.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
PHP Training Institute In Delhi, Live Projects on PHP. Short TermPHP Courses, PHP Scripts, PHP Training with Live Projects. Rajive Narain Java 0 09-18-2009 10:47 AM
Ruby equivalence for php include("file.php"); Miquel Oliete Ruby 4 03-07-2008 06:33 PM
converting .shtml to .php Man in Yellow Hat NZ Computing 2 12-25-2004 05:31 AM



Advertisments