Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP not displaying 1

Status
Not open for further replies.

frozenpeas

Technical User
Sep 13, 2001
893
CA
Can anyone see what I'm doing wrong here?

The output of phpinfo() shows up fine.

Here is my little bit of code:

Code:
<?
require_once('/fns/connect.php');
require_once('/fns/output.php');
do_html_header('Welcome');
?>
<form action=&quot;/test2.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; name=&quot;form&quot; id=&quot;form&quot;>
  <table width=&quot;25%&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot;>
    <tr> 
      <td width=&quot;16%&quot; class=&quot;bodyContent&quot;>Username:</td>
      <td width=&quot;84%&quot;><input name=&quot;username&quot; type=&quot;text&quot; id=&quot;username&quot; size=&quot;25&quot; maxlength=&quot;50&quot;></td>
    </tr>
    <tr> 
      <td class=&quot;bodyContent&quot;>Password:</td>
      <td><input name=&quot;password&quot; type=&quot;password&quot; id=&quot;password&quot; size=&quot;25&quot; maxlength=&quot;50&quot;></td>
    </tr>
    <tr> 
      <td> </td>
      <td><input type=&quot;submit&quot; value=&quot;login&quot;></td>
    </tr>
  </table>
</form>
<?
do_html_footer();
?>

This outputs just:

Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<HTML><HEAD>
<META http-equiv=Content-Type content=&quot;text/html; charset=iso-8859-1&quot;></HEAD>
<BODY></BODY></HTML>

Thanks. frozenpeas
 
I just took a look in my mime.types file and don't even see php in there... strange.

What should that entry look like? frozenpeas
 
did you enable the short tags ?
if not you must use <?php ?> and not <? ?>
whats your error reporting level at ?
 
No, everything I am doing is pretty basic. I'm not doing anything with headers.

This is what is in /fns/output.php (which I include in the example above):

Code:
<?

function do_html_header($title){
	echo '<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>';
	echo '<html>';
	echo '<head>';
	echo '<title>'.$title.'</title>';
	echo '<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>';
	echo '<link href=&quot;/css/styles.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;>';
	echo '</head>';
	echo '<body>';
}

function do_html_footer(){
	echo '<p>footer</p>';
	echo '</body>';
	echo '</html>';
}

?>
frozenpeas
 
Short tags are enabled.

error_reporting = E_WARNING & ~E_NOTICE frozenpeas
 
sleipnir214 I don't know if you remember this, but my php problems started when I redid my server.

I had previously installed everything with tars but when I reinstalled everything, I used the RH CDs.

That is when all of these problems turned up. Gee, those CDs are convenient. frozenpeas
 
I always install PHP from source. But then, I do a lot of stuff with PHP that the RPM-versions do not include the functionality for.

You've said that a script something like:

Code:
<?php phpinfo(); ?>

works, but the one you quoted in your initial post does not.

It sounds to me like that script is doing something funky.

What does this script output?
Code:
<?php
print '
<html><body><table border=1>
<tr><td>1</td><td>2</td><td>3</td</tr>
<tr><td>4</td><td>5</td><td>6</td></tr>
<tr><td>7</td><td>8</td><td>9</td></tr>
</table>
</body></html>';
?>
Want the best answers? Ask the best questions: TANSTAAFL!
 
I can only infer that Apache and PHP are operating properly. It has to be something in your script.

I'd closely examine the files you are including at the beginning of your script. The one with the filename &quot;output.php&quot; seems particularly interesting to me. Want the best answers? Ask the best questions: TANSTAAFL!
 
I have posted them above - I cannot see what is causing a problem.

Do you see anything? frozenpeas
 
Here is the culprit:

Code:
require_once('/fns/output.php');

Do you know why? frozenpeas
 
The contents of that file are posted above. frozenpeas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top