/    Sign up×
Community /Pin to ProfileBookmark

W3C Validator & PHP code

I’m having an issue with the following code running through the validator.

[code=php]<input type=”text” id=”uname” name=”uname” value=”<?php print “$uname”; ?>” size=”30″ />[/code]

It gives an error about the PHP code in the value section. Can someone help me get past this?

Thanks

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiJun 17.2010 — The PHP code itself is irrelevant as the validator only ever sees the output from the processed code. What is contained in the $uname variable?

[code=php]var_dump($uname)[/code]
Copy linkTweet thisAlerts:
@MindzaiJun 17.2010 — double post.
Copy linkTweet thisAlerts:
@NogDogJun 17.2010 — Note that you should not be submitting your PHP source code directly to the validator: you want to submit the [X]HTML that it [i]outputs[/i] when the PHP script is executed. If it's on a web site, you can just submit the URL to the validator. Otherwise if testing locally, run the script in your browser, then do a "View Source" in the resulting browser page, and copy-and-paste that to the browser. Even easier is to use the "Web Developer" extension in Firefox, and after the page is displayed, do a Tools -> Web Developer -> Tools -> Validate Local HTML. ?
Copy linkTweet thisAlerts:
@quark76authorJun 17.2010 — Note that you should not be submitting your PHP source code directly to the validator: you want to submit the [X]HTML that it [i]outputs[/i] when the PHP script is executed. If it's on a web site, you can just submit the URL to the validator. Otherwise if testing locally, run the script in your browser, then do a "View Source" in the resulting browser page, and copy-and-paste that to the browser. Even easier is to use the "Web Developer" extension in Firefox, and after the page is displayed, do a Tools -> Web Developer -> Tools -> Validate Local HTML. ?[/QUOTE]

WOW! That is why I love this site! I am developing it locally & this is exactly what I needed!

Thanks.
×

Success!

Help @quark76 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...