Welcome! Log In Create A New Profile

Advanced

Project works locally, but not on host

Posted by 45223998 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Project works locally, but not on host
October 17, 2013 11:07AM
Hi

I am using notepad++ and I have tried easyphp and Wamp, when I run my code locally I can go to the login page, although it displays kind of funny with seemingly all my php code as text on the page. But when I try and run it from the web host i get the error:


Parse error: syntax error, unexpected end of file in /home/vhosts/45223998-debeerl.6te.net/login.php on line 67

my code looks like this:
Language: PHP
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Portfolio ICT2613 - 45223998</title> </head> <?php // user check, connect and session start... ?> <body> <center> <h1> Welcome to The Chess Club </h1> <br> <FORM NAME ="form1" METHOD ="POST" ACTION ="login.php"> Username: <INPUT TYPE = ';TEXT'; Name =';username'; value="<?php print $username?>" Maxlength="25"> <br> <br> Password: <INPUT TYPE = ';PASSWORD'; Name =';password'; value="<?php print $password?>" Maxlength="8"> <P align = center> <br> <INPUT TYPE = "Submit" Name = "Log" VALUE = "Login"> </P> </FORM> </body> </html>

I have checked that all the start and end of all the html code is there... I just can't figure it out. I have looked at where a similar question was answered, but that was when the person used echo...

Thanks in advance
avatar Re: Project works locally, but not on host
October 17, 2013 11:38AM
Language: HTML
<html xmlns="http://www.w3.org/1999/xhtml">

Why are you using an xmlns attribute ? It is invalid for HTML. The xmls attribute specifies the XML namespace for a document.

XML has much more strict syntax requirements than HTML.

Eg: All elements must have a closing tag <br />
avatar Re: Project works locally, but not on host
October 17, 2013 11:45AM
You should also put your PHP before any HTML headers - causes problems otherwise ("Headers already sent error" )

Language: HTML
<P align = center>

Should be -

Language: HTML
<P align = "center">
avatar Re: Project works locally, but not on host
October 17, 2013 11:51AM
Quote

php code as text on the page

The error is in your PHP code - most likely opening / closing brackets problem.



Quote

I have checked that all the start and end of all the html code is there

What about the DOCTYPE declaration ?

Language: HTML
<!DOCTYPE HTML Public . . . >




Leave spaces between contents and the <?php .... ?> tags

Language: PHP
"<?php print $username?>" // You must have a space before the ?
Sorry, only registered users may post in this forum.

Click here to login