3 replies [Last post]
EssentialBuyerGuides
EssentialBuyerGuides's picture
Offline
Enthusiast
England
Last seen: 16 years 23 weeks ago
England
Joined: 2004-06-25
Posts: 91
Points: 0

I've recently been putting together some form/blog pages and as far as mark-up goes, everything is xHTMl compliant and well formed.

I'm thinking it's something to do with my Doctype declaration at the top, though this is what dreamweaver bundled in as standard when I created the php page.

<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<h1>Email form</h1>


<?php

$domainthing=$_SERVER['SERVER_NAME'];
echo($domainthing);
echo("<br />");
$message="This is the message $domainthing";
echo($message);
echo("<br />");
echo("<br />");
mail("[email protected]", "Test mail thing", $message,
     "From: ", "[email protected]);
?>
</body>
</html>

That's the code for the mail form thing.

I've notstarted adding any kind of formatting yet.

Any ideas on why it wouldn't be working?

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

PHP + xHTML DOM ? How do CSS1 compat PHP pages work?

I may be being dumb but why is the php script echoing the dtd, is this the returned result from a form, in any thing I've done so far with php; menu includes, standalone php page I have written a normal dtd in with the html that the php will echo, that isn't a full dtd anyway can you not just try writting a normal dtd declaration and see what happens ( I'd be wary of anything DW wanted to add!) excuse me if I demonstrate my lack of knowledge with PHP Smile (getting to love it though)

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

rtm223
rtm223's picture
Offline
Enthusiast
Last seen: 16 years 29 weeks ago
Joined: 2004-05-18
Posts: 58
Points: 0

PHP + xHTML DOM ? How do CSS1 compat PHP pages work?

hugo, if you use the xml <? tag in a .php file then some set-ups of php will try to parse the contents of the tag as php, which will just give you errors. echo()ing is the easiest work-around. Although you are much better off dropping the <?xml and putting in a proper full doctype IMO.

However, I'm not sure what the problem with this script is, the question is a little vague Laughing out loud

Quote:
Any ideas on why it wouldn't be working?

What isn't working, I just copy/pasted it and it works fine for me....

css layout tutorials - in depth layout tutorials for all you newbies D maybe even some stuff for you not-so-new-bies out there P

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

PHP + xHTML DOM ? How do CSS1 compat PHP pages work?

Quote:
hugo, if you use the xml <? tag in a .php file then some set-ups of php will try to parse the contents of the tag as php, which will just give you errors. echo()ing is the easiest work-around. Although you are much better off dropping the <?xml and putting in a proper full doctype IMO.

Yes I realise that Rtm223, I guess that was a badly worded reply I meant to say why is it entering that <?xml version > line which is just a problem at this time and tried to suggest entering a normal dtd dec in the html output.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me