Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need a little html help (prolly easy)
Author Message
dJabba Offline
Member
***

Posts: 100
Joined: Jan 2009
Reputation: 0
Post: #1
need a little html help (prolly easy)
Hi
At the moment im finally trying to pitch together a working webspace, have had my domain for years now, never really uploaded anything finished to it.
Now i wanted to start up with creating a simple php form script to upload my files automatic to the server, when ever i finished a mirc script or updated it.

So far so good, i know my basic (x)html and php, but i run into trouble as far as defining the document type (line 1 of the file).

According to w3c, i should have my first line something like:
Code:
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

this works almost if i name my file test.htm, but if i name the file test.php i get this error from my webspace:
Code:
Parse error: syntax error, unexpected T_STRING in /usr/home/web/web58292/djabba.eu/test/test.php on line 1

but if i name it .htm the server wont interpret my php code, if i name it .php i can not define the xml and w3c wont validate the page.

---
first i thought it was a server issue, but they claim its a programming issue of mine. So before i bitch em more, i though i'll ask you ppl here, you know a lot about these things.

the test file is as simple as:
Code:
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title</title>
</head>
<body>
<?php
$myString = "Hello!";
echo $myString;
echo "<h5>I love using PHP!</h5>";
?>
</body>
</html>
url http://djabba.eu/test/test.php _ http://djabba.eu/test/test.htm

---
when i name it htm, there is still one issue though that wont validate, and i cant seem to find the mispelling. As far as i can read, i spelled it excact the same in the file as they say i should when i validate....

Code:
DOCTYPE Override in effect!

The detected DOCTYPE Declaration "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">" has been suppressed and the DOCTYPE for "XHTML 1.0 Transitional" inserted instead, but even if no errors are shown below the document will not be Valid until you update it to reflect this new DOCTYPE.


Hope someone can help, and even if you cant, thanks for reading and trying to help out. Maybe its all right and i just get it completly wrong, but you dont learn if you dont ask. Smile

-dJabba

[edit] removed 1 prob, was w3c's validator, server crashed rebooted and htm is validating fine now.

Semi inactive as mirc scripter .. paying jobs have priority, but i havent given up on my projects .. they are just slowed down.
(This post was last modified: 09-01-2009 12:32 PM by dJabba.)
09-01-2009 12:26 PM
Find all posts by this user Quote this message in a reply
twig Offline
Administrator
*******

Posts: 123
Joined: Nov 2008
Reputation: 1
Post: #2
RE: need a little html help (prolly easy)
ah the joys of working with server side scripting =)

replace your first few lines of
Code:
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

with

Code:
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

My little side venture: ThatAwesomeShirt!
09-01-2009 12:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
dJabba Offline
Member
***

Posts: 100
Joined: Jan 2009
Reputation: 0
Post: #3
RE: need a little html help (prolly easy)
dont know if you like stuff like this ... but here you go *picks up twig and hugs and kisses him* ... lol

i knew it must be something simple, but to echo the xml line, didnt think of that myself ... you rock!

Semi inactive as mirc scripter .. paying jobs have priority, but i havent given up on my projects .. they are just slowed down.
09-01-2009 12:55 PM
Find all posts by this user Quote this message in a reply
twig Offline
Administrator
*******

Posts: 123
Joined: Nov 2008
Reputation: 1
Post: #4
RE: need a little html help (prolly easy)
lol ur welcome

just needed to break the ?> apart in the xml line because its also used to close php tags

My little side venture: ThatAwesomeShirt!
09-01-2009 12:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
dJabba Offline
Member
***

Posts: 100
Joined: Jan 2009
Reputation: 0
Post: #5
RE: need a little html help (prolly easy)
ah yea, thats logical now you mention it - server dunno what to do with it else.

Semi inactive as mirc scripter .. paying jobs have priority, but i havent given up on my projects .. they are just slowed down.
09-01-2009 12:58 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump: