Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » RESOLVED<?php echo "<h1> Hello World </h1>" ;?>(It doesn't get any simpler than this and look at what gets displayed)
RESOLVED<?php echo "<h1> Hello World </h1>" ;?> [message #492837] Thu, 22 October 2009 00:09 Go to next message
craig  is currently offline craig Friend
Messages: 10
Registered: September 2009
Junior Member
this is the output displayed in my webpage

Quote:

Hello World ";?>



I just starting to explore Eclipse and its features, particularly PHP.
Right from the get go it appears that the PHP parser is bonkers?

Why is it displaying the
Quote:
"?>
in the web browser window ?

Solution:
I move the workspace to the Apache DocumentRoot folder
I setup Eclipse "Run Configuration" path to the folder and current file in the DocumentRoot
In Preferences I selected "PHP Server" then on the right created configuration that with a URL path to "http://localhost

The result is output to a web page "within" Eclipse

There was a choice of running PHP Script but after setting it up I got an error. I had to setup a PHP executable. I thought I did it right? I'll settle for what I have for now

[Updated on: Thu, 22 October 2009 19:22]

Report message to a moderator

Re: <?php echo "<h1> Hello World </h1>" ?> [message #492845 is a reply to message #492837] Thu, 22 October 2009 02:31 Go to previous messageGo to next message
Enrico R. is currently offline Enrico R.Friend
Messages: 45
Registered: July 2009
Location: Germany
Member

Hello craig :)

The problem is the missing semicolon at the end of the "echo" statement!

Try this: <?php echo "<h1> Hello World </h1>"; ?>


craig schrieb:
> this is the output displayed in my webpage
>
> Quote:
>> Hello World " ?>
>
>
> I just starting to explore Eclipse and its features, particularly PHP.
> Right from the get go it appears that the PHP parser is bonkers?
>
> Why is it displaying the Quote:
>> "?>
> in the web browser window ?
Re: <?php echo "<h1> Hello World </h1>" ?> [message #492944 is a reply to message #492845] Thu, 22 October 2009 13:09 Go to previous message
craig  is currently offline craig Friend
Messages: 10
Registered: September 2009
Junior Member
nuts...Ah I'm so annoyed with myself

I posted one of the iterations of code I was using to test. I started eliminating elements of the code to see what got dropped in the output.

The code should have read as follows
Quote:

<?php
echo ( "<h1> Hello World </h1>" );
?>



I'm testing code right out of a text book for the sake of testing Eclipse and PHP. It's like feeling my way in a dark room with Eclipse so far.

With the ";" in the code the output is

Quote:

;?>



This is bizarre. If I increase the code example I get more code being projected into the output. I mean what is this. PHP code is not suppose to show in the output.

example;

Quote:

<html>
<?php
echo ( "<textarea rows=\"5\" cols=\"48\">" );
echo
("\"Utinam populus Romanus unam cervicem haberet!\"");
echo
("\n (Would that the Roman people had but one neck!)");
echo ("</textarea>");
?>
</html>




output to firefox browser window :

Quote:

" ); echo ("\"Utinam populus Romanus unam cervicem haberet!\""); echo ("\n (Would that the Roman people had but one neck!)"); echo (""); ?>



I mean what the blazes is going on here?

For the sake of discussion My System setup:
Windows XP
Apache server 2.2 (installed and running)
PHP 5.3.0 (installed)
Eclipse 3.5 Build id: 20090920-1017



I have to be honest. I "assume" I have to have the Apache web server and PHP installed on my system so that Eclipse can execute the php code. This is something I'm not quite sure about. Initially I had the impression that PHP Eclipse plugin created a self contained environment so that one didn't need Apache and PHP installation on the system beside what Eclipse sets you up with.
Previous Topic:403 Forbidden Sort of Solved
Next Topic:Xdebug's bug? xdebug.var_display_max_* values are ignored in remote usage
Goto Forum:
  


Current Time: Fri Apr 19 07:55:57 GMT 2024

Powered by FUDForum. Page generated in 0.01581 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top