PHP help for newbie

Alles, was PHP betrifft, kann hier besprochen werden.

PHP help for newbie

Postby samiur » 07. March 2013 14:08

Hello,
I'm a new XAMPP user. I'm using XAMPP 1.8.1 Today I've created my first php page.

Code: Select all
<!DOCTYPE html>
<html>
<body>

<?php
echo "My first PHP script!";
?> 

</body>
</html>


My php file directory is:
http://localhost/mis/samiur.php


When I open it, there is nothing. The page is blank.

I'm a newbie and I don't know where is the problem. Can anyone help me?

Update: Screenshot of the problem.
Image
Image
Last edited by samiur on 07. March 2013 18:23, edited 2 times in total.
samiur
 
Posts: 3
Joined: 07. March 2013 04:33
Operating System: Windows 7

Re: PHP help for newbie

Postby Altrea » 07. March 2013 15:15

Hi samiur,

your code should work.
What is the output in your browsers sourcecode view?

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: PHP help for newbie

Postby Altrea » 07. March 2013 18:26

Seems like php is not processed (which is a very uncommon issue).
Can you access the XAMPP Administration page (http://localhost/xampp/)?
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: PHP help for newbie

Postby samiur » 07. March 2013 18:49

I can access in XAMPP Administration page.
samiur
 
Posts: 3
Joined: 07. March 2013 04:33
Operating System: Windows 7

Re: PHP help for newbie

Postby Altrea » 07. March 2013 19:56

samiur wrote:I can access in XAMPP Administration page.

Because the XAMPP Administration page is also written in php, your XAMPP installation seems to be working.
The issue must be in your file. If you are willing to send me the file via email, i would be able to take a look at it!?
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: PHP help for newbie

Postby Altrea » 08. March 2013 08:24

Okay, i have analysed your file. In your case it is an encoding issue.
My Notepad++ Code editor identifies the Encoding as "UCS2-2 Little Endian".
Because this is a 2 Byte charset, php doesn't recognise beginning and ending of the php blocks.

You can see the differences in the following image, which is a comparison of your file against a utf8 rewritten version of your file:
http://imageshack.us/photo/my-images/268/samiur.jpg/

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: PHP help for newbie

Postby samiur » 08. March 2013 13:02

Thank you very much. It actually worked.... :D
samiur
 
Posts: 3
Joined: 07. March 2013 04:33
Operating System: Windows 7

Re: PHP help for newbie

Postby Altrea » 08. March 2013 15:33

Glad you got it working :-)
Have fun with XAMPP and all that fancy stuff 8)
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: PHP help for newbie

Postby gondwe » 05. April 2013 04:13

Hey Guys,

im running xampp 1.8.1 and i just installed it. seem everything is working fine except i dont know how to test my php code.
is there a special folder for my codes to save or do i just create a folder inside the xampp directory
becoz the dir i created in there is resulting in an error

>>Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7

and my directory is C:/xampp/www/mybasicform.php

PLease help.. Thanks
gondwe
 
Posts: 2
Joined: 05. April 2013 03:52
Operating System: windows 7

Re: PHP help for newbie

Postby gondwe » 05. April 2013 04:29

Hey guyz

thanks ... i think ive found my errors :idea:
gondwe
 
Posts: 2
Joined: 05. April 2013 03:52
Operating System: windows 7

Re: PHP help for newbie

Postby ionamartin123 » 25. July 2013 11:16

I think you had done the mistake in directory files so the xampp 1.8.1 server does not accept the files.some times the RAM speed is slow doing the same problem.It is an server error.
ionamartin123
 
Posts: 3
Joined: 03. June 2013 08:38
Operating System: Win 7

Re: PHP help for newbie

Postby ionamartin123 » 06. August 2013 07:56

I used that code.The code is working in Xamp server.I think you are doing procedure is wrong.
ionamartin123
 
Posts: 3
Joined: 03. June 2013 08:38
Operating System: Win 7


Return to PHP

Who is online

Users browsing this forum: No registered users and 13 guests