php page displaying text that is supposed to be part of php code
Hello all,
I am working on php and putting html and php into the same page. My code is as follows: Code:
<? Code:
<? echo $myrow[ Code:
" SIZE=30 /> Code:
Edit"; // echo " Thanks as always for your help. DragonM15 |
Hi -
You might try something like this: Code:
// Original: 'Hope that helps .. PSM |
That made the amount of text inside the text box decrease to
Code:
<? Code:
<? echo $myrow[ Thanks, DragonM15 |
I think you named your file file.html. It should by file.php
I was able to reproduce your error in file.html, but the form shows fine in file.php jlinkels |
Its in a php file... edit.php
I tried it on 2 computers (one windows with php and one slackware 12.1 with php) and both give the same problem. DragonM15 |
As a side-note I am running apache-2.2.9 on a Slackware 12.1 box. All my other PHP files work perfect, it is just this one that isn't working properly.
DragonM15 |
I tried it on my own server after editing a few statements to get it to work without that particular database. It works all right.
See if it runs on your server, and if so, undo all my changes until it goes wrong. What is the contents of the array returned by the database? Are there some stray quotes in? The file name I used is build.php - should have been edit.php of course but typing was faster than thinking PHP Code:
jlinkels |
jlinkels, I put your exact code into a new php file titled edit1.php and I also modified all statements involving edit.php to edit1.php. However that actually made the page look worse.
The error looks like: http://i59.photobucket.com/albums/g2...pediterror.jpg As always, the apache error log shows no errors. DragonM15 |
It is not worse, on the contrary it provides more information. :)
I created exactly the same screen output as you have by setting short_open_tag = Off in /etc/php4/apache/php.ini. It starts exactly at "0) $r--; ...." as yours does. You have to restart apache after changing. Watch out, there might be more php.ini files around on your system. I hope this is your problem, although I am amazed if it happens on two different systems, and you say other scripts do work. Do they use the short open tags as well, or the long <?php tag? In PHP 2 '>' was allowed as closing tag, after that it became depreciated and unusable. I assume you don't run PHP 2, do you? jlinkels |
Well... That fixed the problem! I feel like an idiot right about now, but the problem is fixed. Ill bet that fixes one of my other problems with my delete php. And for the record, in Slackware the php.ini is in /etc/httpd/php.ini for anyone having the same problem I was.
No I am not using php2 I am using php-5.2.6 (current version). And also, the pages that were in the making that I was also having problems with had <? ?>'s and were having problems. All the ones that worked were <?php 's. Thank you for your help in solving my problem! DragonM15 P.S. That only took 2 days of staring and pulling my hair out.... |
All times are GMT -5. The time now is 03:56 AM. |