473,382 Members | 1,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

what wrong with this PHP script ?

Hi there

I've created abd uploaded this basic PHP script:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<H1 align="center">
<?php print("Hello world!"); ?>
</H1>
</body>
</html>

But when I go to my browser and display the page:
http://members.lycos.co.uk/eightbitfanatics/test.php

it come up with the source code.

any ideas ?

Lee
Jul 16 '05 #1
5 3178
Lee Redeem wrote:
Hi there

I've created abd uploaded this basic PHP script:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<H1 align="center">
<?php print("Hello world!"); ?>
</H1>
</body>
</html>

But when I go to my browser and display the page:
http://members.lycos.co.uk/eightbitfanatics/test.php

it come up with the source code.


Nothing's wrong with the script, it's the server. It doesn't look like
it is set up for parsing a .php file. This means either the webmaster
has set a different extension to be used (like .phtml) or PHP is not
enabled on the server. I'd try to use the phtml extension if you know
you have PHP capeabilities on the server.

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 16 '05 #2
On Fri, 15 Aug 2003 14:07:57 GMT, Justin Koivisto <sp**@koivi.com>
wrote:
Lee Redeem wrote:
Hi there

I've created abd uploaded this basic PHP script:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<H1 align="center">
<?php print("Hello world!"); ?>
</H1>
</body>
</html>

But when I go to my browser and display the page:
http://members.lycos.co.uk/eightbitfanatics/test.php

it come up with the source code.


Nothing's wrong with the script, it's the server. It doesn't look like
it is set up for parsing a .php file. This means either the webmaster
has set a different extension to be used (like .phtml) or PHP is not
enabled on the server. I'd try to use the phtml extension if you know
you have PHP capeabilities on the server.


It's not that. Whatever editor/method of upload the OP has used has
converted < to &lt; and > to &gt; etc.

If it was as simple as the server not parsing php, the <html>, <head>,
etc would not be visible.

I'd also suggest finding a decent host. Lycos has bloated the OP's
original code to 13 times its size!

--
David (please modify address to david@ before replying!)
Jul 16 '05 #3
"Lee Redeem" <le******@lycos.co.uk> wrote in message
news:88**************************@posting.google.c om...
Hi there

I've created abd uploaded this basic PHP script:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<H1 align="center">
<?php print("Hello world!"); ?>
</H1>
</body>
</html>

But when I go to my browser and display the page:
http://members.lycos.co.uk/eightbitfanatics/test.php

it come up with the source code.


Your server is not supporting PHP, or is not set to parse .php files by
default. contact your server administrator.

HTH

--
Suni
Jul 16 '05 #4
David Mackenzie <dc*@tarbrax.freeserve.co.uk> wrote in message
If it was as simple as the server not parsing php, the <html>, <head>,
etc would not be visible.


?? Where do you get that theory? True only if the server is set to
only send files of a certain extensions or explicitly doesn't allow
..php files to be sent.
you could just as well rename the script "doody.fart"... it won't get
parsed but it will send the file as plain text.
Jul 16 '05 #5
{{Date: 15 Aug 2003 07:03:31 -0700
From: le******@lycos.co.uk (Lee Redeem)
But when I go to my browser and display the page:
http://members.lycos.co.uk/eightbitfanatics/test.php
it come up with the source code.}}

I clicked on that link and it seems to work fine, so I guess you found
the problem and fixed it. What was the solution? I'm having the same
problem with my first attempt at a php hello program:
http://www.rawbw.com/~rem/h.php

One possible clue is the following system message:
2001/06/11: PHP is available. To setup for an extension in your
site, use an .htaccess and do for example: AddHandler php4-script .php
Is that something I need to do before my hello world script will work?
If so, what exactly do I need to do. It's cryptic for a total beginner.
If not, what *do* I need to do to get h.php to be processed instead of
treated as .txt?

For comparison, these all work:
http://www.rawbw.com/~rem/h.txt
http://www.rawbw.com/~rem/h.html
http://www.rawbw.com/~rem/cgi-bin/h-sh.cgi
http://www.rawbw.com/~rem/cgi-bin/h-cmucl.cgi
http://www.rawbw.com/~rem/cgi-bin/h-perl.cgi
(First one trivial just for hack value of course, second one in a
trivial way, no actual html in the file, but still it "works". I've
been programming HTML since about 1995, and CGI/sh/cmucl since
2001.Jan, but I thought I'd install a simple hello world file in each
of those to accompany the others I'm doing in other languages I haven't
done before, and I tried the CGI/perl one tonight for the first time
and it worked the first time after I did the right chmod.)

Jul 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Greener | last post by:
Hi, I need help badly. Can you do client-side programming instead of server-side to capture the Browser type info? If this is the case, what's wrong with the following? <script...
5
by: tin | last post by:
<script language="Javascript"> <!-- function apri (theURL,winName,features){ window.open (theURL,winName,features); var a=null; oldwindow = window.self; oldwindow.opener = window.self;...
6
by: Rtritell | last post by:
Please can you find out what's wrong, fix the script and tell me what was wrong. Im just beginning <html> <head> <title>Random Mad Lib!</title> <script language="JavaScript"> <!-- Hide
17
by: Paul | last post by:
HI! I get an error with this code. <SCRIPT language="JavaScript"> If (ifp==""){ ifp="default.htm"} //--></SCRIPT> Basicly I want my iframe to have a default page if the user enters in...
4
by: Paul | last post by:
HI! I have a script that does not seem to work. can someone tell me what I am doing wrong here? <script language="JavaScript"> function firefoxautofix(){ parent.window.resizeBy(-1,-1)...
2
by: Miguel Dias Moura | last post by:
Hello, i want to open a new window when a button is clicked. I am working in ASP.net / VB. However my code is not working. This is my Script Code: <script runat="server"> Private Sub...
8
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that...
6
by: plemon | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta...
3
by: Siong.Ong | last post by:
Dear all, my PHP aims to update a MySQL database by selecting record one by one and modify then save. Here are my PHP, but I found that it doesnt work as it supposed to be, for example, when...
2
by: Tarik Monem | last post by:
OK! I've gone through a few tutorials and I cannot understand what I'm doing wrong casting_registration.php <table> <tr> <td> <form enctype="multipart/form-data" action="thankyou.php"...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.