1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

XHTML PHP files?

Discussion in 'PHP' started by richieg100, Aug 27, 2005.

  1. #1
    Can you make files with a .php extension XHTML valid? If so, please tell me how because I tried it in dreamweaver and it's not working out the way i planned.
    thanks,
    richie
    SEMrush
     
    richieg100, Aug 27, 2005 IP
    SEMrush
  2. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The file extension doesn't really have anything to do with making a page XHTML valid. It is the source code inside that matters. You could make a index.xyz file valid XHTML with the same code as you would make index.html valid.

    So there is something in your source code that goes against the spec you are trying to validate against.
     
    tflight, Aug 27, 2005 IP
  3. Lever

    Lever Deep Thought

    Messages:
    1,823
    Likes Received:
    94
    Best Answers:
    0
    Trophy Points:
    145
    #3
    You got some code we can see richieg100? Are you're using dwmx to convert a php file to xhtml and it's not validating? What's your level of knowledge of xhtml syntax? Are you letting dwmx do it all for you?
     
    Lever, Aug 27, 2005 IP
  4. richieg100

    richieg100 Peon

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    well, I am using DWMX and I'm pretty good with XHTML, i know it inside out, but I'm kind of new to PHP. I mean I've done alot of stuff with SSI but I never actually put in a PHP page declaration. I've just been telling the .htaccess file to parse everything as PHP, but this time I actually want the PHP declaration.

    Bassically, the problem is, I didnt know how to write that declaration so i let dreamweaver do it, but it comes out with an extra ?>. What's happening is its making that ?> mark on the top of my pages. Once I upload it to my site that dissapears, but the confusing part is I have Apache and MySQL on my computer and its still displaying the pages with the ?>.

    It's really not a big deal as the pages are fine once uploaded. (I validated all the pages do the files are XHTML valid) I just wanted to make sure this wouldnt cause problems with some browsers or OS's, or cause problems for me in the future.

    Here's the code:
    <?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>

    That stupid ?> at the end is what's causing it, but if I delete it it pops back again. Again, its not a big deal, I'm just curious.

    Thanks alot guys,
    Richie
     
    richieg100, Aug 27, 2005 IP
  5. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Then it sounds like your local Apache software isn't configured quite right. The code sample you posted looks good.
     
    tflight, Aug 28, 2005 IP