NuSphere Forums Forum Index
NuSphere Forums
Reply to topic


Joined: 19 Aug 2007
Posts: 15
Reply with quote
I was also very disappointed to find that html preview does not work with php files. This is one of the few features that keep me using Dreamweaver to some degree.
View user's profileFind all posts by msruby64Send private message


Joined: 03 Jun 2008
Posts: 76
Location: Bavaria, Germany
Reply with quote
using html in php files is state of the art, so please ....
View user's profileFind all posts by bitseekerSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
I'm not sure I got it right. What's expected from a php script like below?

mytest.php:
Code:
<?php
  echo "hello world";
?>


and from the script below

remove_account.php
Code:
<?php
...
  $result = mysql_query(sprintf('delete from site_accounts where user_id=%d', $_GET['uid']));
  if (!$result) {
    die('failed to delete: ' . mysql_error());
}
?>

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 10 Sep 2007
Posts: 18
Reply with quote
dmitri wrote:
I'm not sure I got it right. What's expected from a php script like below?

mytest.php:
Code:
<?php
  echo "hello world";
?>


and from the script below

remove_account.php
Code:
<?php
...
  $result = mysql_query(sprintf('delete from site_accounts where user_id=%d', $_GET['uid']));
  if (!$result) {
    die('failed to delete: ' . mysql_error());
}
?>


Dimitri,

In both cases absolutely nothing would be shown. The html preview tab should only process html tags and totally ignore the php ones.

Maybe I'm wrong but I get the feeling you might be confused because you output all html in a php file from within php tags..

ie.. (in a very simplified form )

<?php

echo "<html><body><p>hello there</p>";

echo $fredsname;

echo "</body></html>";

?>

Whereas what we are basically meaning is this....

<html>
<body>
<p>hello there</p>
<?php
echo $fredsname;
?>
</body>
</html>

now the file in question would still have a php extension of course so that it is parsed but it is in effect basically a html file with php elements. So what would be ideal for us is if the html preview tab displayed it as a normal html file but just ignored everything between the php tags. If we need to see the result of the php we can either run the debugger or just view the file through our local webserver.

Does this make things clearer or have I totally confused the issue? Smile

Richard.
View user's profileFind all posts by ricktuSend private message


Joined: 14 Apr 2007
Posts: 96
Reply with quote
This would be a great addition. We never use any .html files in our projects. Everything is .tpl or .tpl.php or .php or something besides .html.
View user's profileFind all posts by rodericksimpsonSend private message
HTML view not available in PHP templates?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 2 of 2  

  
  
 Reply to topic