Solved

Error in PHP when validating W3C

Posted on 2014-09-19
10
832 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Tag Manager - Add Trigger Using Div class 22 64
Send email using HTML and PHP in separate file 5 41
WordPress Page Content Lost 2 23
PHP substring 3 18
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…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

696 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