?
Solved

php problems

Posted on 2003-11-14
8
Medium Priority
?
351 Views
Last Modified: 2010-05-18


If I save a file called php.php and put it on my server like this:
It does nothing.  Displays a blank white browser window.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>

<?
phpinfo();
?>

</body>
</html>
#####But if I do this it displays "My First PHP Page" but not the info on version.  So PHP must be on my server right?  But why no info.  Also got another real .php page that when you go to it it just shows the code??
here is the URL to that page  free.livegirllove.com/ttt-install.php it needs version PHP 4.1.2 so maybe thats why it only displays the code??
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<h1>My First PHP Page</h1>
<?
phpinfo();
?>

</body>
</html>
0
Comment
Question by:livegirllove
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 13

Expert Comment

by:lozloz
ID: 9752661
hi,

no i don't think php's on your sever at all - either that or it's setup to not parse .php as a php file, get in contact with your sys admin

loz
0
 
LVL 19

Expert Comment

by:Michael701
ID: 9752711
whenyou say 'my server' would it be a host like godaddy? many hosts disable soem php commands phpinfo() beign one of them. also when you see the (blank) page, do a right click and 'view source' many times there are hints in the code. next change your phpinfo() line to echo 'Hello world!';
0
 
LVL 14

Accepted Solution

by:
ThG earned 2000 total points
ID: 9753790

if the host in question is the same you pointed us to, then it seems to have PHP installed:
$ httpver free.livegirllove.com
Server: Apache/2.0.47 (Unix) mod_jk2/2.0.0 PHP/4.2.3

Anyway, either it's bad configured, or you don't have rights to use PHP.
I would try two things:

rename your testscript (first change <? to <?php) to test.php4

if that didn't work, create a file .htaccess (don't miss the dot) containing:
AddType application/x-httpd-php .php

this either makes your script work or makes the page unable to load.
Let me know the result. If this doesn't help, I think you can only contact the admin
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:livegirllove
ID: 9754611
Ok Apache needed a restart after install of php.  But I can run my .php from mozilla but IE will not, just displays the source code.  I hate to clear my cache and history, is there something else that could keep it from working in IE?
0
 
LVL 14

Expert Comment

by:ThG
ID: 9755264
PHP is not browser depedendent, so there can be no differences between mozilla behaviour and IE's. Try reloading/refreshing the page pressing ctrl or shift buttons
0
 
LVL 1

Expert Comment

by:vincevincevince
ID: 9755290
put

header("Cache-Control: no-store, no-cache, must-revalidate");

at the top of each page
0
 
LVL 1

Author Comment

by:livegirllove
ID: 9756778
Ok not sure what to do.  Didn't get exatly the answer but ended up deleting my cookies and IEs history an PHP started to work!!
ThG posted twice so here you go.....
0
 
LVL 14

Expert Comment

by:ThG
ID: 9757119
cool.
the ctrl / shift key while refreshing the page is a trick to override temporarily the cache. The result would have probably been the same but.. it works, that's important. :-)
0

Featured Post

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question