FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


php





krazy
when i try to use php on my frih webbsite... i put the php in and it just comes up as i put it in on the screen E.G



Quote:
<?
$logmsg = $_GET['logmsg'];

if($logmsg)
{
echo "<table class='main'><td class='main'>";
switch ($logmsg) {
case 1:
echo "You must be logged in to view this page";
break;
case 2:
echo "Your account has been frozen until $ban[ban_time]<p><b>Reason:</b> $ban[reason]<p>If you feel that you were banned and shouldn't have been, please email banned@ridethewind.frih.net";
break;
case 3:
echo "Wrong Username or Password";
break;
case 4:
echo "Thanks for playing. See you again soon!";
break;
}
echo ".</td></table>";
}
?>


that's what it shows, not what it is supposed to show if you know what i mean
mathiaus
Try the below (ie. The PROPER/full tag) Very Happy
Code:
<?php



EDIT: V
Assuming your index page has this code and is throwing up your error, try this code. You don't break the last case! I also added a default case just for good practise Smile (Indenting is a good idea as well)

Code:
<?
$logmsg = $_GET['logmsg'];

if($logmsg) {
   echo '<table class="main"><td class="main">';
   switch ($logmsg) {
      case 1:
         echo 'You must be logged in to view this page';
         break;
      case 2:
         echo 'Your account has been frozen until '.$ban['ban_time'].'<p><b>Reason:</b> '.$ban[reason].'<p>If you feel that you were banned and shouldn\'t have been, please email banned@ridethewind.frih.net';
         break;
      case 3:
         echo 'Wrong Username or Password';
         break;
      case 4:
         echo 'Thanks for playing. See you again soon!';
      default:
         echo 'Unknown error';
   }
   echo '</td></table>';
}
?>





EDIT (2): Make sure the file has a .php extension as well Smile
mOrpheuS
If it still doesn't work (after you've tried everything suggested by mathiaus above), it could be possible that there is a problem with script execution permission on your account.

In which case, please put in a request for account reset - here.
krazy
i put in for a reset...
ChrisCh
... have you used the right file extension??? If your file is named something.html instead of something.php, it will do that (unless you change a special Apache setting).
krazy
how do i change the apache setting?
Manofgames
Krazy have you done what Mathius suggested and started the code with <?php instead of <?

That should solve the issue, I have this problem with many free scripts I find.

You dont need to change any apache settings, it can get too complicated sometimes if you dont know anything about it.
ChrisCh
krazy wrote:
how do i change the apache setting?

It's in the advanced features section, but really, just change the file from something.html to something.php - it saves tweaking with mime types...

If, for some reason, this would be a major inconvenience, let me know and I'll explain how to do it, otherwise just change the file extension to what it should really be. Very Happy
Bondings
The "<?" should be working exactly the same as "<?php".

Are you sure the file ends in .php?

Are you sure you aren't viewing the file in the file manager instead of on your website?
mathiaus
Embarassed Sorry, solved with the user on IRC
-close-
Related topics
http://tuvanonline.com/library/index.php
PHP-Nuke platium?
PHP Write to line
Anyone good with PHP-NUKE?
PHP safety?
req: PHP to list files in directory, and link to them
php admin and mysql admin console
Mysql And PHP HELP PLZ
Great php editor
Script php about gallery
File upload with PHP, Build an upload database for your site
[php scripts ] phpweather&email
Including With PHP
help me upgrade php to 5.
php includes
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Support and Web Hosting -> Frihost Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.