My php Dont work..

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

My php Dont work..

Postby ggilir » 22. September 2012 21:15

Hey i just did download and install the xampp 1.8.0

but my php dont work..
it shows the php codes??:S

like

Image

how do i fix so i can use my php codes

if i use

<?
echo "Hello ";

?>

it also dont work;(
ggilir
 
Posts: 4
Joined: 22. September 2012 21:11
Operating System: Windows Vista

Re: My php Dont work..

Postby Altrea » 23. September 2012 08:07

Hi ggilir,

Instead of the php short open tag <? simply use the long one <?php

best wishes,
Altrea
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: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: My php Dont work..

Postby ggilir » 23. September 2012 11:22

But it still dont work.. i get errors.

Notice: Use of undefined constant username - assumed 'username' in C:\xampp\htdocs\chat\plugin\core.php on line 6

Notice: Undefined index: username in C:\xampp\htdocs\chat\plugin\core.php on line 6

Notice: Use of undefined constant mode - assumed 'mode' in C:\xampp\htdocs\chat\index.php on line 3

Notice: Undefined index: mode in C:\xampp\htdocs\chat\index.php on line 3

and in my logins.

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\chat\login.php on line 15

and on a real webserver they work:(
ggilir
 
Posts: 4
Joined: 22. September 2012 21:11
Operating System: Windows Vista

Re: My php Dont work..

Postby JJ_Tagy » 23. September 2012 13:48

For reference: Notice != error

Without the offending code, we can only guess what the problem is.
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: My php Dont work..

Postby ggilir » 23. September 2012 13:59

<?php
require("plugin/core.php");
$hent = mysql_query("select * from users where username='$_POST[username]' and password='" . securePassword($_POST[password]) . "'");
$hent = mysql_fetch_array($hent);
if (strtolower($hent[username]) == strtolower($_POST[username])) {
$_SESSION[username] = $hent[username];
$_SESSION[lastmove] = 0;
$sid = substr(md5(session_id()), 0, 5);
mysql_query("update users set ip='$_SERVER[REMOTE_ADDR]' where username='$hent[username]'");
mysql_query("update users set sessionid='$sid' where username='$hent[username]'");
?><a onclick="newwindow=window.open('chatframe.php','chatten','height=620,width=920', 'resizable=no');">Åben chatten</a><?
} else {
echo "Næh";
}
?>
ggilir
 
Posts: 4
Joined: 22. September 2012 21:11
Operating System: Windows Vista

Re: My php Dont work..

Postby ggilir » 23. September 2012 14:03

but when i did use older version of xampp it did work fine. when i did download this = ERROR ! :S
ggilir
 
Posts: 4
Joined: 22. September 2012 21:11
Operating System: Windows Vista

Re: My php Dont work..

Postby JJ_Tagy » 23. September 2012 15:00

It seems your short open tags is turned off. You will either need to change all <? to <?php or open your php.ini and turn the setting on.
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 121 guests