Jump to content

[SOLVED] Why does this display incorrectly..


SirChick

Recommended Posts

For some reason it's displaying the php code and also using the html to change its colour:

 

<?


if($QuoteResult == 'Result: You search the train station from top to bottom and find $1!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo 'Result: You search the train station from top to bottom and find $1!';
echo '</font></div>';
}
elseif($QuoteResult == 'You failed to find any money, better try some other time!')
{
echo '<font style="font-size:16px" color="red" face="Arial">';
echo 'You failed to find any money, better try some other time!';
echo '</font></div>';
}
elseif($QuoteResult == 'Result: You search the train station from top to bottom and find $3!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo 'Result: You search the train station from top to bottom and find $3!';
echo '</font></div>';
}
elseif($QuoteResult == 'Result: You search the train station from top to bottom and find $5!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo 'Result: You search the train station from top to bottom and find $5!';
echo '</font></div>';
}
elseif
{
echo '<font style="font-size:16px" color="red" face="Arial">';
echo 'Server is having difficulties admin is working on it!';
echo '</font></div>';
}
?>

 

this is what i get as an echo on my page:

 

 

'; echo 'Result: You search the train station from top to bottom and find $1!'; echo '

'; } elseif($QuoteResult == 'You failed to find any money, better try some other time!') { echo ''; echo 'You failed to find any money, better try some other time!'; echo ''; } elseif($QuoteResult == 'Result: You search the train station from top to bottom and find $3!') { echo ''; echo 'Result: You search the train station from top to bottom and find $3!'; echo ''; } elseif($QuoteResult == 'Result: You search the train station from top to bottom and find $5!') { echo ''; echo 'Result: You search the train station from top to bottom and find $5!'; echo ''; } elseif { echo ''; echo 'Server is having difficulties admin is working on it!'; echo ''; } ?>

Link to comment
Share on other sites

1) Try using full tags- instead of <? use <?php

2) Check if the extension is php.

3) Check if php is installed on the server.

 

Obviously the php isn't being processed. If you open the page's source you will see the full code.

 

Orio.

Link to comment
Share on other sites

well it comes from 3 includes which are longgg scripts lol!

 

the code im showing you just echo's it however i needed to use php to echo it instead of html with a short tag because i needed the font to be either red or green depending on the $QuoteResult's string.

 

 

<html>
<body bgcolor="#466B98" text="#000000" style="scrollbar-face-color:#C8E8F8;scrollbar-arrow-color:#000000;scrollbar-3dlight-color:#C8E8F8;scrollbar-darkshadow-color:#404040;scrollbar-highlight-color:#E8F4FF;scrollbar-shadow-color:#40B0E8;scrollbar-track-color:#E8F4FF;">
<form name="" method="POST" action="" enctype="text/plain" id="Form1">
<input type="submit" id="DoCrime" name="Button1" value="Submit" style="position:absolute;left:365px;top:458px;width:150px;height:20px;z-index:0">

</form>

<?php
if (isset($_POST['DoCrime'])){
include("UnderBridgeCrimeScript.php");
}
?>


<div id="bv_" style="position:absolute;left:307px;top:348px;width:262px;height:64px;z-index:14" align="center">


<?php


if($QuoteResult == 'Result: You search the train station from top to bottom and find $1!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo 'Result: You search the train station from top to bottom and find $1!';
echo '</font></div>';
}
elseif($QuoteResult == 'You failed to find any money, better try some other time!')
{
echo '<font style="font-size:16px" color="red" face="Arial">';
echo 'You failed to find any money, better try some other time!';
echo '</font></div>';
}
elseif($QuoteResult == 'Result: You search the train station from top to bottom and find $3!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo 'Result: You search the train station from top to bottom and find $3!';
echo '</font></div>';
}
elseif($QuoteResult == 'Result: You search the train station from top to bottom and find $5!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo 'Result: You search the train station from top to bottom and find $5!';
echo '</font></div>';
}
elseif
{
echo '<font style="font-size:16px" color="red" face="Arial">';
echo 'Server is having difficulties admin is working on it!';
echo '</font></div>';
}
?>
</body>
</html>

Link to comment
Share on other sites

yeh i tried a complete different pc also. That file ^ is the display to the user. I removed some of the html which is like the menu which is just alot of href links over an image so i didnt paste it in cos its just guna be in the way.

 

<?php
if (isset($_POST['DoCrime'])){
include("UnderBridgeCrimeScript.php");
}
?>

this bit here includes the other .php which then has 2 includes in that and it chooses which include by using a rand feature.... i aint got it working yet... how ever... this would mean $ResultQuote = "" at the moment.

 

So my echo on that code provided above should display:

"Server is having difficulties admin is working on it!" which is this part:

 

elseif
{
echo '<font style="font-size:16px" color="red" face="Arial">';
echo 'Server is having difficulties admin is working on it!';
echo '</font></div>';
}

 

Link to comment
Share on other sites

This is now in a separate file as test.php and i still get the same problem. The difference here is i set $QuoteResult in this and then seeing if it will find out which echo to display but it does the same as before.

 

<?php
$QuoteResult = 'Result: You search the train station from top to bottom and find $3!';

if($QuoteResult == 'Result: You search the train station from top to bottom and find $1!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo 'Result: You search the train station from top to bottom and find $1!';
echo '</font></div>';
}
elseif($QuoteResult == 'You failed to find any money, better try some other time!')
{
echo '<font style="font-size:16px" color="red" face="Arial">';
echo 'You failed to find any money, better try some other time!';
echo '</font></div>';
}
elseif($QuoteResult == 'Result: You search the train station from top to bottom and find $3!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo 'Result: You search the train station from top to bottom and find $3!';
echo '</font></div>';
}
elseif($QuoteResult == 'Result: You search the train station from top to bottom and find $5!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo 'Result: You search the train station from top to bottom and find $5!';
echo '</font></div>';
}
elseif
{
echo '<font style="font-size:16px" color="red" face="Arial">';
echo 'Server is having difficulties admin is working on it!';
echo '</font></div>';
}
?>

Link to comment
Share on other sites

PHP Version 5.2.2.

System Windows NT ASUSA7N266 5.1 build 2600

Build Date May 2 2007 19:17:46

Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"

Server API Apache 2.0 Handler

 

 

etc

 

 

it loaded up my information from the server.

Link to comment
Share on other sites

OK now open the file (directly) that displays the

<?php
$QuoteResult = 'Result: You search the train station from top to bottom and find $3!';

blar blar blar blar blar 

 

it should say

 

Server is having difficulties admin is working on it!

 

or a blank screen

 

if so post the code you are using to include / display this file

if not and it displays

 

<?php
$QuoteResult = 'Result: You search the train station from top to bottom and find $3!';

if($QuoteResult == 'Result: You search the train station from top to bottom and find $1!')
{................ ..........

 

then can you attach that file to the next post

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.