Solved

Error in PHP when validating W3C

Posted on 2014-09-19
10
880 Views
Last Modified: 2014-09-19
I am running validation on one of my new PHP pages.

This is the line:

<?php require_once( "../../webassist/security_assist/helper_php.php" ); ?>

This is the error:

Saw <?. Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.)
0
Comment
Question by:amucinobluedot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 333 total points
ID: 40332500
That means that your PHP script is not getting parsed through the PHP parser.  Do you have the correct file suffix?  You can check some of this with a little script like this one, shown here in its entirety.

<?php phpinfo();

Open in new window

0
 

Author Comment

by:amucinobluedot
ID: 40332514
Yes. the file is:  default.php and it displays just fine.

I get those errors when I run the Validation in Dreamweaver

Your script shows a page with all PHP info
0
 
LVL 11

Assisted Solution

by:Radek Baranowski
Radek Baranowski earned 167 total points
ID: 40332524
maybe you need to set expilictly that the file is of php type.

but best try to run this file in a browser within working PHP container (server) to see if the code works.

if it works, then probably this is only Dreamweaver validation issue.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:amucinobluedot
ID: 40332527
The page works just fine, its only when I run DW validation that displays those errors.
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 333 total points
ID: 40332541
Dreamweaver was a good tool for building simple web sites many years ago, but nobody does that any more.  Today we use things like the Laravel framework instead.  And you can feed your finished script directly to the validator -- you do not need (and probably do not want) the interference of Dreamweaver.
http://validator.w3.org/
0
 

Author Comment

by:amucinobluedot
ID: 40332551
Well .. I am using DW because I have been using it for years and I currently have some great extensions (DMXZone) and (Webassist) which help me code fast. So for now I will stick to it and about the errors I will simply ignore the DW hints  :)   Plus I can't validate a page that is inside an intranet I don't think.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 40332562
Don't know about your intranet, but you can probably copy the HTML and paste it into a public-facing document then fire up the validator.  I often do that just to make sure I'm on track and not doing something like accidentally duplicating ID attributes.
0
 

Author Comment

by:amucinobluedot
ID: 40332571
:)
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40333125
I get those errors when I run the Validation in Dreamweaver

Don't do it that way.  DW can't parse PHP at all, so what it does is transfer the entire page markup (minus things like Template or Library code) to W3.  So all PHP code gets treated like HTML.

Always, always make W3 look at RENDERED code.  That means giving it a working web link.  Use Firebug and a browser to make this fast and easy.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 40333134
Firebug and a browser
Google Chrome Dev Tools are pretty good, too.
http://discover-devtools.codeschool.com/
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question