WN

WN (https://www.wn.se/forum/index.php)
-   Klientsidans teknologier, design och grafik (https://www.wn.se/forum/forumdisplay.php?f=12)
-   -   Städar upp min kod (https://www.wn.se/forum/showthread.php?t=16485)

cezar 2006-09-27 11:34

En grej den klagar på är mina länkar i mitt nyhetsscript som ser ut såhär:

http://manu6.manufrog.com/~johnnynu/cutene...=1&ampnumber=10

Från början länkade jag bara med '&' istället för '&amp' men det är ändrat så den borde inte klaga nu?

Citat:


Warning Line 33, column 104: cannot generate system identifier for general entity "ampnumber" .
...johnnynu/cutenews/rss.php?category=1&ampnumber=10">

An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".

Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and æ are different characters.

If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.

Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.


Kaffe 2006-09-27 11:43

Missat ett semikolon. Du bör skriva:

Kod:

http://manu6.manufrog.com/~johnnynu/cutenews/rss.php?category=1&number=10
Med ett semikolon på slutet. Felet uppstår ju eftersom & på börjar en character entity, & står för ampersand. Nu letar den efter &ampnumber istället.

cezar 2006-09-27 11:53

Citat:

Originally posted by Kaffe@Sep 27 2006, 11:43
Missat ett semikolon. Du bör skriva:

Kod:

http://manu6.manufrog.com/~johnnynu/cutenews/rss.php?category=1&number=10
Med ett semikolon på slutet. Felet uppstår ju eftersom & på börjar en character entity, & står för ampersand. Nu letar den efter &ampnumber istället.

Grymt. Nu försvann massa errors.
Har bara 3 errors kvar B)

Citat:


Below are the results of attempting to parse this document with an SGML parser.
Error Line 6 column 54: document type does not allow element "LINK" here.
<link href="stil.css" rel="stylesheet" type="text/css"/>

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).


Error Line 10 column 6: end tag for element "HEAD" which is not open.
</head>

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

If this error occured in a script section of your document, you should probably read this FAQ entry.


Error Line 12 column 5: document type does not allow element "BODY" here.
<body>

Jag undrar mom jag har missat att stänga någon tag eller så men jag hittar inget. Vore smutt om det finns något program som kan kolla igenom alla taggar...

Kaffe 2006-09-27 12:54

Lite nyfiken på vad som genererar felmeddelandena nu?

Hur som helst:

Kod:

<link href="stil.css" rel="stylesheet" type="text/css"/>
Skall egentligen vara:
Kod:

<link href="stil.css" rel="stylesheet" type="text/css">
Självslutande element används endast i XHTML.

cezar 2006-09-27 13:03

Citat:

Originally posted by Kaffe@Sep 27 2006, 12:54
Lite nyfiken på vad som genererar felmeddelandena nu?

Hur som helst:

Kod:

<link href="stil.css" rel="stylesheet" type="text/css"/>
Skall egentligen vara:
Kod:

<link href="stil.css" rel="stylesheet" type="text/css">
Självslutande element används endast i XHTML.

Ok, ja det är jag med :).
Det hjälpte inte att jag tog bort '/'.

Citat:


Error Line 6 column 54: document type does not allow element "LINK" here.
<link href="stil.css" rel="stylesheet" type="text/css">

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).


Kaffe 2006-09-27 13:29

I så fall har du ett felaktigt nästlat element.

Om du absolut inte hittar det själv får du prova exempelvis:
http://infohound.net/tidy/
eller
http://tidy.sourceforge.net/

cezar 2006-09-27 16:05

Den hittar 0 errors, 1 warning på en div som inte innehåller något i html koden.
Det ligger en class i den som har en del värden, så som bakrundsbild m.m.
Nu validerar i allafall css filen som HTML 4.01 så den borde inte kunna ställa till med något.

cezar 2006-09-27 16:29

Det fungerade då jag öppnade alla taggar inom head. Gjorde alltså '/>' till '>'.

Nu så validerar den som HTML 4.01.

Kaffe 2006-09-27 20:45

Citat:

Originally posted by cezar@Sep 27 2006, 16:29
Det fungerade då jag öppnade alla taggar inom head. Gjorde alltså '/>' till '>'.

Nu så validerar den som HTML 4.01.

Var ju det jag skrev ju... :rolleyes:

Säg, validerar den nu som strict eller transitional?

cezar 2006-09-28 11:29

Citat:

Ursprungligen postat av Kaffe
Citat:

Ursprungligen postat av cezar
Det fungerade då jag öppnade alla taggar inom head. Gjorde alltså '/>' till '>'.

Nu så validerar den som HTML 4.01.

Var ju det jag skrev ju... :rolleyes:

Säg, validerar den nu som strict eller transitional?

Stängde 3 taggar så validerade den som strict.

Har endå en del kvar att städa...
Min tabell till gästboken validerar inte.

Kod:

<form action="sign.php" method="post">
<table class="gbok_table">
<tr>
<td>
<img class="noborder" src="images/name.gif" alt="Name" />
</td>
<td>
<input class="input" maxlength="35" name="name" type="text" />
</td>
</tr>
<tr>
<td>
<img class="noborder" src="images/email.gif" alt="Email />
</td>
<td>
<input class="input" maxlength="125" name="email" *type="text" />
</td>
</tr>
<tr>
<td>
<img class="noborder" src="images/url.gif" alt="URL" />
</td>
<td>
<input class="input" maxlength="125" name="uri" type="text" value="http://" />
</td>
</tr>
<tr>
<td>
<img class="noborder" src="images/message.gif" alt="Message" />
</td>
<td>
<textarea class="textarea" name="message"></textarea>
<td/>
</tr>
</table>
<input type="image" src="http://www.johnny.nu/blog/images/sign_gb.gif" alt="Sign GB" value="Sign Guestbook" />
</form>

7 errors!
Läs om ni orkar.
Kod:

Warning Line 48, column 0: character "<" is the first character of a delimiter but occurred as data .
</td>

This message may appear in several cases:
You tried to include the "<" character in your page: you should escape it as "<"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
Another possibility is that you forgot to close quotes in a previous tag.


Warning Line 49, column 0: character "<" is the first character of a delimiter but occurred as data .
<td>


Warning Line 50, column 0: character "<" is the first character of a delimiter but occurred as data .
<input class="input" maxlength="125" name="email" type="text" />


Error Line 50, column 19: an attribute value literal can occur in an attribute specification list only after a VI delimiter .
<input class="input" maxlength="125" name="email" type="text" />

Have you forgotten the "equal" sign marking the separation between the attribute and its declared value? Typical syntax is attribute="value".


Error Line 50, column 20: end tag for "img" omitted, but OMITTAG NO was specified .
<input class="input" maxlength="125" name="email" type="text" />

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".


Info Line 47, column 0: start tag was here .
<img class="noborder" src="images/email.gif" alt="Email />
Error Line 66, column 41: required attribute "rows" not specified .
<textarea class="textarea" name="message"></textarea>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.


Error Line 66, column 41: required attribute "cols" not specified .
<textarea class="textarea" name="message"></textarea>


Error Line 67, column 4: document type does not allow element "td" here .
<td/>

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).


Error Line 68, column 4: end tag for "td" omitted, but OMITTAG NO was specified .
</tr>


Info Line 65, column 0: start tag was here .
<td>
Error Line 70, column 109: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag .
...lt="Sign GB" value="Sign Guestbook" />

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").


Vinklubben 2006-09-28 11:33

Du har glöt ett fnutt-tecken efter alt="Email. Rad 13.

Kaffe 2006-09-28 11:39

Samma här, byt ut enkelavslut: /> mot >.

Alla input element bör också placeras i ett div, ins, del, p eller annat block-element. Jag föredrar ins, även om det egentligen tänkt att användas för ett tillägg av författaren, inte användaren, så har jag skapat min egen lilla semantiska mening med att wrappa insert-element runt inputs. Nu är jag lite småskadad också, en enkel div räcker.

Exempel:
Kod:

<div><input class="input" maxlength="35" name="name" type="text"></div>
Om man är käck kan man också skippa tabellern och använda dessa DIV-element (med lite extra mark-up) för att formatera formuläret. Det blir faktiskt lite extra kod med applicerade klasser, men ger större flexibilitet.

En td är felstängd:
Kod:

<td/>
Och attributet cols behövs för textarean.

Sen bör du väl vara klar.

cezar 2006-09-28 12:26

Lite bättre. 5 errors har jag nu

koden
Kod:

<form action="sign.php" method="post">
<table class="gbok_table">
<tr>
<td>
<img class="noborder" src="images/name.gif" alt="Name" />
</td>
<td>
<div>
<input class="input" maxlength="35" name="name" type="text">
</div>
</td>
</tr>
<tr>
<td>
<img class="noborder" src="images/email.gif" alt="Email" />
</td>
<td>
<div>
<input class="input" maxlength="125" name="email" type="text">
</div>
</td>
</tr>
<tr>
<td>
<img class="noborder" src="images/url.gif" alt="URL" />
</td>
<td>
<div>
<input class="input" maxlength="125" name="uri" type="text" value="http://">
</div>
</td>
</tr>
<tr>
<td>
<img class="noborder" src="images/message.gif" alt="Message" />
</td>
<td>
<textarea class="textarea" name="message" cols="50"></textarea>
</td>
</tr>
</table>
<div>
<input type="image" src="http://www.johnny.nu/blog/images/sign_gb.gif" alt="Sign GB" value="Sign Guestbook">
</div>
</form>

Errors
Kod:

Below are the results of checking this document for XML well-formedness and validity.
Error Line 43, column 60: end tag for "input" omitted, but OMITTAG NO was specified .
<input class="input" maxlength="35" name="name" type="text">

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".


Info Line 43, column 0: start tag was here .
<input class="input" maxlength="35" name="name" type="text">
Error Line 53, column 63: end tag for "input" omitted, but OMITTAG NO was specified .
...ass="input" maxlength="125" name="email" type="text">


Info Line 53, column 0: start tag was here .
<input class="input" maxlength="125" name="email" type="text">
Error Line 63, column 76: end tag for "input" omitted, but OMITTAG NO was specified .
..." name="uri" type="text" value="http://">


Info Line 63, column 0: start tag was here .
<input class="input" maxlength="125" name="uri" type="text" value="http://">
Error Line 72, column 51: required attribute "rows" not specified .
<textarea class="textarea" name="message" cols="50"></textarea>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.


Error Line 77, column 108: end tag for "input" omitted, but OMITTAG NO was specified .
...alt="Sign GB" value="Sign Guestbook">


Info Line 77, column 0: start tag was here .
<input type="image" src="http://www.johnny.nu/blog/images/sign_gb.gif" alt="Sign


Kaffe 2006-09-28 13:02

Passade på att läsa den här biten:
Kod:

Below are the results of checking this document for XML well-formedness and validity.
Nu kontrollerar du ju mot XML eller kanske XHTML? Inte HTML alltså. Och då skall enkelavsluten tillbaka in. Eller så kanske du menade att kontrollera mot HTML 4.01, och då skall dem ut helt och hållet.

Kod:

Info Line 63, column 0: start tag was here .
<input class="input" maxlength="125" name="uri" type="text" value="http://">
Error Line 72, column 51: required attribute "rows" not specified .
<textarea class="textarea" name="message" cols="50"></textarea>

Talar ju för sig själv, du har glömt attributet rows också.

cezar 2006-09-28 13:45

Ok. Slängde dit rows på alla input och då hade jag 1 error på att jag hade row på en input. Tog bort den och då klagade den på en annan.

Höll på så tills alla rows var borta sen validerade den.

Ska börja validera de andra sidorna nu. Lär dyka upp fler fel då.
Hör av mig igen om jag inte grejjar det :)

Kaffe 2006-09-29 06:43

Citat:

Originally posted by cezar@Sep 28 2006, 13:45
Ok. Slängde dit rows på alla input och då hade jag 1 error på att jag hade row på en input. Tog bort den och då klagade den på en annan.

Höll på så tills alla rows var borta sen validerade den.

Ska börja validera de andra sidorna nu. Lär dyka upp fler fel då.
Hör av mig igen om jag inte grejjar det :)

Du hade glömt rows för textaera, inte input. Inputs använder inte rows. Allt finns i specifikationen: http://www.w3.org/TR/REC-html40/inte...#edef-TEXTAREA

cezar 2006-09-29 13:43

Citat:

Ursprungligen postat av Kaffe
Citat:

Ursprungligen postat av cezar
Ok. Slängde dit rows på alla input och då hade jag 1 error på att jag hade row på en input. Tog bort den och då klagade den på en annan.

Höll på så tills alla rows var borta sen validerade den.

Ska börja validera de andra sidorna nu. Lär dyka upp fler fel då.
Hör av mig igen om jag inte grejjar det :)

Du hade glömt rows för textaera, inte input. Inputs använder inte rows. Allt finns i specifikationen: http://www.w3.org/TR/REC-html40/interact/f...l#edef-TEXTAREA

Tack.
Får jag terra dig lite mer ? :rolleyes:

Är inte så hajj på javascripts men någon annan kanske ser direkt vad som är felet...

Får 7st likadana fel i valideringen. Använder ett script för att visa hur många länkklick jag har fått.

Citat:


Error Line 57, column 129: required attribute "type" not specified .
...ccount"><script language="Javascript">ccount_display('10')</script></span> }

Koden
Kod:

<a href="http://www.johnny.nu/blog/ccount/click.php?id=6">
Länk
</a>
{
<span class="ccount">
<script language="Javascript">ccount_display('6')
</script>
</span>
}
- <span class="header">Info.</span>

Eller ahh, det löste sig. Böt ut language mot type="text/javascript"

Någon som kanske vet hur man löser detta ?

Kod:

Error Line 83, column 11: there is no attribute "name" .
<form name="contactform" action="/blog/about.php" method="post">

Vad ska det vara istället för name då?

f_b 2006-09-29 14:19

Ett tips är att kolla på w3schools.com, där har de en enkel och bra HTML/XHTML-referens.

Sen verkar det som du angett doctype XHTML 1.0 Strict. Om du vill fortsätta med det så ska du inte ha name, utan id.

cezar 2006-09-29 14:39

Citat:

Originally posted by f_b@Sep 29 2006, 14:19
Ett tips är att kolla på w3schools.com, där har de en enkel och bra HTML/XHTML-referens.

Sen verkar det som du angett doctype XHTML 1.0 Strict. Om du vill fortsätta med det så ska du inte ha name, utan id.

Tack så mycket.
Den validerar nu men förstår inte varför denna lilla snutt visas som text på sidan:

?>

Det är slutet av mitt php script.
Tar jag bort det i koden fungerar inte scriptet men sätter jag dit det så fungerar allt men den visas som text på sidan <_<

cezar 2006-10-06 11:02

Ser ni något big misstake med denna kodsnutt?
Får i allafall en massa errors.

Citat:


<input type="image" src="http://www.johnny.nu/blog/images/comment.gif" name="submit" />
<input type=checkbox name=CNremember id=CNremember value=1><label for=CNremember> Remember Me</label> |
Forget Me


Kaffe 2006-10-06 11:37

Citat:

Originally posted by cezar@Oct 6 2006, 11:02
Ser ni något big misstake med denna kodsnutt?
Får i allafall en massa errors.

Citat:


<input *type="image" src="http://www.johnny.nu/blog/images/comment.gif" name="submit" />
<input *type=checkbox name=CNremember *id=CNremember value=1><label for=CNremember> Remember Me</label> |
Forget Me


En input har enkelavslut enligt XHTML-specfikation: /> och en har det inte. Vilken dokumenttp validerar du mot?

cezar 2006-10-06 11:50

Citat:

Ursprungligen postat av Kaffe
Citat:

Ursprungligen postat av cezar
Ser ni något big misstake med denna kodsnutt?
Får i allafall en massa errors.

Citat:


<input *type="image" src="http://www.johnny.nu/blog/images/comment.gif" name="submit" />
<input *type=checkbox name=CNremember *id=CNremember value=1><label for=CNremember> Remember Me</label> |
Forget Me




En input har enkelavslut enligt XHTML-specfikation: /> och en har det inte. Vilken dokumenttp validerar du mot?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

f_b 2006-10-06 11:55

Du har inget id i den övre raden.
Sen har du inga fnuttar kring värdena till type, name, id,value och for-attributen på rad 2.

Det är de felen jag kan se på rak arm.

cezar 2006-10-09 11:11

Det jobbiga nu är att jag hittar inte koden som jag måste ändra.

Kör med cutenews php script och man ändrar koden i cutenews webgränssnitt som man loggar in på.
Den koden har jag kollat igenom och hittar inte de kodsnuttar som den klagar på.

Citat:


Below are the results of checking this document for XML well-formedness and validity.
Error Line 98 column 69: there is no attribute "name".
...="return CNSubmitComment()" method="post" name="comment" id="comment" action="">


You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.


Error Line 98 column 106: document type does not allow element "br" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
..."comment" id="comment" action="">


The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "

" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").


Error Line 128 column 18: character data is not allowed here.
<noscript>Your browser is not Javascript enable or you have turn it off.

You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include putting text directly in the body of the document without wrapping it in a container element (such as a

aragraph</p>) or forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes).


Error Line 138 column 13: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.
<input type=checkbox id="CNremember" value="1" /><label for="CNremember"> Remem


Error Line 147 column 111: required attribute "type" not specified.
...utenews/remember.js"></script><script>CNreadCookie();</script><div style="mar

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.


cezar 2006-10-11 09:21

Nu börjar det dra ihop sig, behöver lite hjälp till.

I en show.inc.php fil så finns denna kod som genererar ett jscript:

Kod:

$CN_remember_include = "<script type=\"text/javascript\" src=\"$config_http_script_dir/remember.js\"></script><script>CNreadCookie();</script>";
      $CN_remember_form = "onsubmit=\"return CNSubmitComment()\"";

Nu så validerar den inte riktigt och jag vågar inte ändra hur som helst.
Som jag fattar det så behöver den typ="text/javascript" som redan finns ?!

<script type=\"text/javascript\" ...

Kod:

Error Line 165, column 96: required attribute "type" not specified .
...utenews/remember.js"></script><script>CNreadCookie();</script><div style="mar

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.


Kaffe 2006-10-11 09:31

Det följer ett litet script-block efter det första, som behöver det attributet.

Titta noga så ser du det.

cezar 2006-10-11 11:54

Citat:

Originally posted by Kaffe@Oct 11 2006, 09:31
Det följer ett litet script-block efter det första, som behöver det attributet.

Titta noga så ser du det.

Sådär ja.

Nu är det bara <form onsubmit="return CNSubmitComment()" method="post" name="comment" id="comment" action=""> kvar som jag varken hittar i cutenews/inc/show.inc.php eller i cutenews panelen.

Behöver nästan något sökverktyg som söker igenom alla dokument på servern efter just den koden.
Har lagt till ett inlägg på cutenews forum också för den delen...

Kaffe 2006-10-11 12:16

Sökverktyg för att leta igenom koden låter lite overkill gentemot att faktiskt lära sig sin kod :rolleyes:.

Skämt åsido, Dreamweaver (som exempel) kan söka igenom alla filer i ett projekt. Säkerligen borde andra editorer med projekthantering klara av det också.

cezar 2006-10-11 14:14

Citat:

Originally posted by Kaffe@Oct 11 2006, 12:16
Sökverktyg för att leta igenom koden låter lite overkill gentemot att faktiskt lära sig sin kod :rolleyes:.

Skämt åsido, Dreamweaver (som exempel) kan söka igenom alla filer i ett projekt. Säkerligen borde andra editorer med projekthantering klara av det också.

Ok.
Lite konstigt att den genererar en kod som inte finns med i det jag har skrivit.
Måste komma från någon fil och man kan inte se vilka filer som är include:at.

Cutenews är för övrigt ett ganska stort script och det är svårt att veta vilka filer som gör vad alltid.

Kaffe 2006-10-12 08:42

Citat:

Ursprungligen postat av cezar
Citat:

Ursprungligen postat av Kaffe
Sökverktyg för att leta igenom koden låter lite overkill gentemot att faktiskt lära sig sin kod :rolleyes:.

Skämt åsido, Dreamweaver (som exempel) kan söka igenom alla filer i ett projekt. Säkerligen borde andra editorer med projekthantering klara av det också.

Ok.
Lite konstigt att den genererar en kod som inte finns med i det jag har skrivit.
Måste komma från någon fil och man kan inte se vilka filer som är include:at.

Cutenews är för övrigt ett ganska stort script och det är svårt att veta vilka filer som gör vad alltid.

Jag är säker på att kodsnutten finns med, PHP är inte ett ramverk som har förmågan att skriva ut kod på måfå, till skillnad från .NET som gärna skriver ut lite kod här och var.

Jag skulle misstänka, om det inte ligger bland eventuella templates att det renderas utifrån scriptet.

Jag tog en titt i CuteNews, och i shows.inc.php på rad 588 samt 604 hittade jag de relaterade kodbitarna.

Vad exakt är det som inte validerar?

cezar 2006-10-12 09:21

Nu börjar det bli krångligt.

För att få bort atributet 'name' så är man tvungen att gå in i show.inc.php.
och ta bort name=\"name\".

Gör man det så validerar sidan men då kan man inte infoga smileys i kommentarerna.

atributet ligger i denna kod:

Kod:

echo"<form $CN_remember_form method=\"post\" name=\"name\" id=\"comment\" action=\"\">".$template_form."
<div>
<input type=\"hidden\" name=\"subaction\" value=\"addcomment\" />
<input type=\"hidden\" name=\"ucat\" value=\"$ucat\" />
<input type=\"hidden\" name=\"show\" value=\"$show\" />$user_post_query
</div>
</form>
\n $CN_remember_include";

Förmodligen är det atributet kopplat till någonting annat...
För den som orkar läsa i shows.inc.php filen så finns den här som en .txt fil >> http://johnny.nu/temp/shows.inc.txt

Kaffe 2006-10-12 10:36

Att du inte kan infoga smilies beror antagligen på att Javascriptet unyttjar sig av Name-attributet. Validera mot annan doctype, skriv om javascriptet eller strunta i det.

cezar 2006-10-12 13:44

Byter doctype.
Sidan blir väll inte sämre för det :)

Kaffe 2006-10-12 14:13

Citat:

Originally posted by cezar@Oct 12 2006, 13:44
Byter doctype.
Sidan blir väll inte sämre för det :)

Beror på vad du byter till och vad du byter från.


Alla tider är GMT +2. Klockan är nu 09:27.

Programvara från: vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Svensk översättning av: Anders Pettersson