Php or Mysql problem?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Php or Mysql problem?

Postby frankus » 10. March 2010 20:51

Since I installed XAMPP (Basis Package version 1.7.3) on my Windows 7, I have not used any php file with Mysql because it does not display correctly (see below). It displays with php codes showing. But the same file displays well when placed on online web host. So I am totally confused and this is not a Tag (<?php) issue. All the php files in xampp folder in htdocs dir are working well. The same Mysql settings i have on the internet are the I have in XAMPP's Mysql. So why is it not working. Could it be XAMPP's Mysql problem or what? Please can someone help me here? :(

1. XAMPP DISPLAY;
Image


2. ONLINE WEB HOST DISPLAY;
Image
frankus
 
Posts: 4
Joined: 09. March 2010 12:02

Re: Php or Mysql problem?

Postby Altrea » 11. March 2010 05:47

Post your Sourcecode here.
Otherwise noboby can really help you.

If your php code is displayed in plain text, there a 2 common reasons:
- short_open_tags problem
- file extension problem (files don't run through the php interpreter).

The XAMPP php applications running well, so i don't think it's a Apache, PHP or MySQL error.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Php or Mysql problem?

Postby MC10 » 11. March 2010 06:32

I'm almost certain this is a short_open_tags problem: The "username" box in the image (http://img163.imageshack.us/img163/6189/phpproblem.png) shows code using <?. However, since you state that it isn't a tag issue, I'm confused. The code would be very helpful.
MC10
 
Posts: 148
Joined: 20. February 2010 20:13

Re: Php or Mysql problem?

Postby frankus » 13. March 2010 00:54

The code;
Code: Select all
<?php
/**
 * Main.php
 *
 * This is an example of the main page of a website. Here
 * users will be able to login. However, like on most sites
 * the login form doesn't just have to be on the main page,
 * but re-appear on subsequent pages, depending on whether
 * the user has logged in or not.
 *
 * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
 * Last Updated: August 26, 2004
 */
include("include/session.php");
?>

<html>
<title>Jpmaster77's Login Script</title>
<body>

<table>
<tr><td>


<?
/**
 * User has already logged in, so display relavent links, including
 * a link to the admin center if the user is an administrator.
 */
if($session->logged_in){
   echo "<h1>Logged In</h1>";
   echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
       ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] &nbsp;&nbsp;"
       ."[<a href=\"useredit.php\">Edit Account</a>] &nbsp;&nbsp;";
   if($session->isAdmin()){
      echo "[<a href=\"admin/admin.php\">Admin Center</a>] &nbsp;&nbsp;";
   }
   echo "[<a href=\"process.php\">Logout</a>]";
}
else{
?>

<h1>Login</h1>
<?
/**
 * User not logged in, display the login form.
 * If user has already tried to login, but errors were
 * found, display the total number of errors.
 * If errors occurred, they will be displayed.
 */
if($form->num_errors > 0){
   echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";
}
?>
<form action="process.php" method="POST">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>>
<font size="2">Remember me next time &nbsp;&nbsp;&nbsp;&nbsp;
<input type="hidden" name="sublogin" value="1">
<input type="submit" value="Login"></td></tr>
<tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr>
<tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr>
</table>
</form>

<?
}

/**
 * Just a little page footer, tells how many registered members
 * there are, how many users currently logged in and viewing site,
 * and how many guests viewing site. Active users are displayed,
 * with link to their user information.
 */
echo "</td></tr><tr><td align=\"center\"><br><br>";
echo "<b>Member Total:</b> ".$database->getNumMembers()."<br>";
echo "There are $database->num_active_users registered members and ";
echo "$database->num_active_guests guests viewing the site.<br><br>";

include("include/view_active.php");

?>


</td></tr>
</table>


</body>
</html>
frankus
 
Posts: 4
Joined: 09. March 2010 12:02

Re: Php or Mysql problem?

Postby frankus » 13. March 2010 00:59

Guys now I see that tags were not complete. I did not check deep. Thank you all!!
frankus
 
Posts: 4
Joined: 09. March 2010 12:02


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 76 guests