SirChick Posted August 17, 2007 Share Posted August 17, 2007 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 ''; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/ Share on other sites More sharing options...
JeBu Posted August 17, 2007 Share Posted August 17, 2007 Try <?php .... ?> instead of <? .... ?> Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326583 Share on other sites More sharing options...
Orio Posted August 17, 2007 Share Posted August 17, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326585 Share on other sites More sharing options...
SirChick Posted August 17, 2007 Author Share Posted August 17, 2007 same result. it is .php lol and it is loading php on server as i had to login to use the page that im pasting the code of here in order to test it (its using sessions) Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326586 Share on other sites More sharing options...
Orio Posted August 17, 2007 Share Posted August 17, 2007 Show the full code. I suppose $QuoteResult came from somewhere? Orio. Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326591 Share on other sites More sharing options...
SirChick Posted August 17, 2007 Author Share Posted August 17, 2007 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> Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326598 Share on other sites More sharing options...
MadTechie Posted August 17, 2007 Share Posted August 17, 2007 you opening that file directly or including it ? or something else ? does it display like that if you open it directly ? have you tried another php file to check its not the server ? Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326604 Share on other sites More sharing options...
SirChick Posted August 17, 2007 Author Share Posted August 17, 2007 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>'; } Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326609 Share on other sites More sharing options...
uwannadonkey Posted August 17, 2007 Share Posted August 17, 2007 dunno, but shouldnt include have single quotes? Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326610 Share on other sites More sharing options...
SirChick Posted August 17, 2007 Author Share Posted August 17, 2007 all my other scripts use this structure: include("homepage.php"); and works so i dont think it matters. Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326614 Share on other sites More sharing options...
MadTechie Posted August 17, 2007 Share Posted August 17, 2007 dunno, but shouldnt include have single quotes? and why not ? single and double quotes both have their uses.., i would probably used singles as well! Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326617 Share on other sites More sharing options...
SirChick Posted August 17, 2007 Author Share Posted August 17, 2007 but even if the include didnt work surely my if statements on the first post would load the last Else If because $QuoteResult would be blank.... just to add i put single quotes and no difference Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326624 Share on other sites More sharing options...
SirChick Posted August 17, 2007 Author Share Posted August 17, 2007 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>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326642 Share on other sites More sharing options...
MadTechie Posted August 17, 2007 Share Posted August 17, 2007 create a new file called phpinfo.php containing (nothing more) <?php phpinfo(); ?> open the file directly what displays ? if you see <?php phpinfo(); ?> then its a server problem Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326655 Share on other sites More sharing options...
SirChick Posted August 17, 2007 Author Share Posted August 17, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326667 Share on other sites More sharing options...
MadTechie Posted August 17, 2007 Share Posted August 17, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326697 Share on other sites More sharing options...
SirChick Posted August 17, 2007 Author Share Posted August 17, 2007 working now, thought i don't know how :S i dindt change any thing lol Quote Link to comment https://forums.phpfreaks.com/topic/65405-solved-why-does-this-display-incorrectly/#findComment-326729 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.