472,783 Members | 940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,783 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 3125
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.