I have runned my html code against the W3C Code validator service on HTML and XHTML. I got this one niggerling error. The explaination against the error is blinding.
What is character "<" is the first character of a delimiter but occured as data mean, what does it mean against the souce code
<form action="<?php echo $editFormAction;?> id="form1" name="form1" method ...
It is suggesting several cases this might be remedied.
You tried to include the "<" character om you page: you should escape it as "<"
You used an unescaped ampersand "&" this may be valid in some contexts but it is recommended to use "&", which is always safe
Another possibilty is that you forgot to close quotes in previous flag.
I must say if the PHP souce document has no syntax error and to me it looks legitimate code what is the machine engine validator trying to say. Please advise. Thanks. I am myth by this.
The HTML is showing identical to the PHP. so if the PHP is valid code why should it throw up invalid error on coding?
You have this -
action="<?php echo $editFormAction;?>;" id="form1"
It should be this -
action="<?php echo $editFormAction;?>" id="form1"
I don't see how that could trigger the error you are showing, but give it a try.
I have recitified the semicolon. But still, I get 1 error,
Please advice. Thanks.
Change this -
to this -
as has been suggested numerous times already.
Then recognize that your page is named "Attendance.htm, yet it contains PHP scripting. The validator is completely confused by this since the PHP is NOT BEING PARSED OUT BY THE SERVER, thus it's left in the code. Rename your page to Attendance.php and validate it again.
I have added this
This has been added to the htm source code. As it was suggested earlier to NOT touch the php source code. Now when you say to that the validator is completely confused by the PHP is NOT BEING PARSED OUT BY THE SERVER, that it's left in the code, asking me to rename my page to Attendance.php and validate again. Explain this, is this done - Edit in htm source code and rename to php source extension ....?
Your page is named with an *.html extension. The server will not parse this page to find, execute and remove the PHP, so you are sending your PHP to the HTML validator. Naturally the validator things your PHP is an error.
In DW edit the file in the Files panel to change its extension from *.html to *.php.
Thank you this is helpful. So in other words, both must be ticked when one is working from local and remote. With the local being the source of editing and the remote being the production page. While this is the case, when browsing the local becomes the testing server and the producction server is the remote.
This is clearer. Thanks.
You must have a testing server defined for any active scripting site. The location and the identity of this testing server depends on your setup. If you are working with PHP, your testing server MUST have Apache installed, and if you are working with MySQL, your testing server MUST have MySQL installed. This server could be your local computer, or a shared network computer, or even the remote server for the production site. The latter option is NOT generally a good choice, however, unless you are experienced with managing such configurations.
My personal configuration is with two servers defined - the production server for the FTP remote site, and a local shared box (running Linux with Apache and MySQL) for the testing server.
When I preview a PHP file, the file is uploaded to the testing server, and then SERVED from that location back to my local browser. This allows my local PHP to be executed and the page built by the testing server before uploading it back to my local browser.
I do not have a local Apache server for the php script. My local server would then be my laptop as I am creating the pages from Dreamweaver. I also do not have a local MySQL server. My local server being my laptop. So I am relying on my production (remote) server. My remote server has both the servers, Apache and MysQL.
It is interesting to note that with this configuration. Configuration with only the remote servers have the 2 serves Apache and MySQL.
Now because my configuration does not have the servers - both; Apache and MySQL then am I still getting the local copy of the php uploaded to update the remote server's copy of PHP? I read you as it does update the production copy (remote server). So what happens to the local copy of htm? How is the production copy of htm updated? Do I have to manually upload it using the downdown and arrow to update it?
Your English is very difficult for me to follow.
Using the remote server as your testing server is a bad plan, as I indicated earlier. I think you need to have a local testing server for your development work. That would require that you get and install WAMP on your laptop unless you also have a networked box that you could use.
If the local site *and* the testing server are the same box, many people will place the local root folder in the Apache default folder. In that case, there is no uploading of files between the local site and the testing server. The file being edited in DW, and the file being served by the testing server are the same file. When the testing server is not the same as the local site, DW will have to upload each file being previewed from the local site to the testing server.
But here's a clue for you. ALL OF THESE CONCEPTS and operations are deeply discussed and painstakingly described in David Powers' Foundation PHP books. I strongly encourage you to get his latest one and use that as your reference in preparing your local development environment. To try to do this one concept at a time here on this forum is a burden for everyone.
Sorry if it is difficult for you to follow.
I did not want to have a local server by choice as it compromises my laptop security. But I will if that helps with future development work.
So if I had the local server than these will not occur?
I did not want to have a local server by choice as it compromises my laptop security.
I don't think that is the case.
So if I had the local server than these will not occur?
There's no way to guarantee that. Most (all?) of the 'errors' you are describing are operator errors. Having a local testing server is just a standard configuration for doing this kind of work.
Thanks for suggesting installing a server (PHP and MySQL) on my laptop. A local server. At this point where we are. It works without the my local server setup.
You seem certain that I have operated erroneously which is abit strange for me. I have moved this further ahead now. I have taken into account all our discussion and recreated the page. I now have only one php and its a souce page with php extension. I do not have any htm file. or htm files.
I am to the point of running the form without any errror and can wear the XHTML compliant badge on my page.
I am unable to write to the database table on Click submit. On click submit it goes beyond the on Click to the specified page. But, no data written to the database table. Please advice.