Sida 1 av 1

Hjälp med en gästbok[LÖST]

Postat: 17 jun 2010, 06:01
av xtr3m3
Har inte kunnat sova under natten så jag har suttit och pillat med min hemsida ett tag.
Har fixat till gästboken. Nu är det bara det att Firefox visar sidan rätt men inte Chromium.

Nån som har lust att hjälpa mig att få till det då jag inte är så insatt i hur uppbyggnaden av en gästbok fungerar.
Kan bara just grunderna i html.

Hur den visas i firefox:
Skärmbild.png
Skärmbild.png (31 KiB) Visad 1435 gånger
Hur den visas i chromium:
Skärmbild-1.png
Skärmbild-1.png (27.08 KiB) Visad 1435 gånger

Html-filen:

Kod: Markera allt

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
	<title><!--GB_TITLE--></title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="styleSheet" href="themes/melody1/style.css" type="text/css" />
<script language="JavaScript" type="text/javascript">
<!--
// Author: José Jorge Enríquez Rodríguez
// ejorge19@hotmail.com
// You can use/modify this script as long as you keep these comments

// Placing the cursor on the first field of the form (the name field)
function doFocus() {
  document.form.name.focus();
}

// Checking whether name or and message are empty.
// Email is not checked here (using JavaScript) since version 0.4.2.
// If you want to make your users post their email addresses, you can
// use the $gbEmailRequired variable in config.php. If you want to,
// you can still use this JavaScript function for checking the email,
// just uncomment the lines as indicated below.
function checkFields() {
  uName = document.form.name.value;
  uEmail = document.form.email.value;
  uMessage = document.form.message.value;

  if (uName == "") {
    alert('Ditt namn namn behövs.');
    doFocus();
    return false;
  }

  // Delete the lines starting with '/*****' and '*****/' if
  // you want this JavaScript function to check if the email field
  // is empty.
  /***** DELETE THIS LINE IF YOU WANT TO USE THIS FUNCTION!
  else if (uEmail == "") {
    alert('You forgot to write your email!');
    document.form.email.focus();
    return false;
  }
  else if ( (uEmail.indexOf('@') == -1) || (uEmail.indexOf('.') == -1) ) {
    alert('The email is not correct!');
    document.form.email.focus();
    return false;
  }
  DELETE THIS LINE IF YOU WANT TO USE THIS FUNCTION! *****/

  else if (uMessage == "") {
    alert('Du glömde skriva ett meddelande!');
    document.form.message.focus();
    return false;
  }
  else
    return true;
}

function emoticon(text) {
  var txtarea = document.form.message;
  text = ' ' + text;
  if (txtarea.createTextRange && txtarea.caretPos) {
    var caretPos = txtarea.caretPos;
    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
    txtarea.focus();
  } else {
    txtarea.value  += text;
    txtarea.focus();
  }
}
-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
// ******* openHelp function ********
// It opens a new window with some information about 'option'
// At the moment BBCode is the only available option :).
function openHelp(option) {
  helpWin = open("gbhelp.php?op="+option, "","width=600,height=400,status=no,toolbar=no,menubar=no,scrollbars=yes");
}
-->
</script>
</head>

<body bgcolor="#ffffff" onload="doFocus();">
<table bgcolor="#333" align="center" width="50%">
  <tr>
    <th align="left" class="title">
      <!--GB_TITLE-->
    </th>
    <td align="right">
      <a href="<!--GB_INDEX-->" title="Tillbaka till meddelandena"><img src="themes/melody1/gbmsgs.gif" border="0" alt="Tillbaka till meddelandena" /></a>
       <a href="javascript:window.close()" title="Stäng fönstret"><img src="themes/melody1/gbexit.gif" border="0" alt="Stäng fönstret" /></a>
    </td>
  </tr>
</table>
<br />
<form action="<!--GB_INDEX-->" name="form" onsubmit="return checkFields();" method="post">
<input type="hidden" name="action" value="add" />
<table align="center" width="50%">
  <tr>
    <th colspan="2" bgcolor="#333" align="center">
      Skriv
    </th>
  </tr>
  <tr>
  	<td colspan="2"><!--GB_SIGNERRORS--></td>
  </tr>
  <tr>
    <td bgcolor="efefef">
      <br />
      <table align="center">
        <tr>
          <td width="20%" align="right">
            <font color="red"><b>*</b></font>Namn:
          </td>
          <td width="80%">
            <input type="text" name="name" size="35" value="<!--GB_ENTRYNAME-->" />
          </td>
        </tr>
        <tr>
          <td width="20%" align="right">
            E-mail:
          </td>
          <td width="80%">
            <input type="text" name="email" size="35" value="<!--GB_ENTRYEMAIL-->" />
          </td>
        </tr>
        <tr>
          <td width="20%" align="right">
            Hemsida:
          </td>
          <td width="80%">
            <input type="text" name="url" size="35" value="<!--GB_ENTRYURL-->" />
          </td>
        </tr>
  <tr>
    <td colspan="2" align="left"><br /><font color="red"><b>*</b></font> Ditt meddelande:</td>
  </tr>
  <tr>
    <td>
      <table align="right">
        <tr>
          <td>
            <a href="javascript:emoticon(':D');"><img src="smilies/icon_biggrin.gif" border="0" alt="Very happy" title="Very happy" /></a>
            <a href="javascript:emoticon(':)');"><img src="smilies/icon_smile.gif" border="0" alt="Smile" title="Smile" /></a>
            <a href="javascript:emoticon(':(');"><img src="smilies/icon_sad.gif" border="0" alt="Sad" title="Sad" /></a>
            <a href="javascript:emoticon(':o');"><img src="smilies/icon_surprised.gif" border="0" alt="Surprised" title="Surprised" /></a>
          </td>
        </tr>
        <tr>
          <td>
            <a href="javascript:emoticon(':shock:');"><img src="smilies/icon_eek.gif" border="0" alt="Shocked" title="Shocked" /></a>
            <a href="javascript:emoticon(':?');"><img src="smilies/icon_confused.gif" border="0" alt="Confused" title="Confused" /></a>
            <a href="javascript:emoticon('8)');"><img src="smilies/icon_cool.gif" border="0" alt="Cool" title="Cool" /></a>
            <a href="javascript:emoticon(':lol:');"><img src="smilies/icon_lol.gif" border="0" alt="Laughing" title="Laughing" /></a>
          </td>
        </tr>
        <tr>
          <td>
            <a href="javascript:emoticon(':x');"><img src="smilies/icon_mad.gif" border="0" alt="Mad" title="Mad" /></a>
            <a href="javascript:emoticon(':P');"><img src="smilies/icon_razz.gif" border="0" alt="Razz" title="Razz" /></a>
            <a href="javascript:emoticon(':oops:');"><img src="smilies/icon_redface.gif" border="0" alt="Embarrased" title="Embarrased" /></a>
            <a href="javascript:emoticon(':cry:');"><img src="smilies/icon_cry.gif" border="0" alt="Crying or very sad" title="Crying or very sad" /></a>
          </td>
        </tr>
        <tr>
          <td>
            <a href="javascript:emoticon(':wink:');"><img src="smilies/icon_wink.gif" border="0" alt="Winking" title="Winking" /></a>
            <a href="javascript:emoticon(':!:');"><img src="smilies/icon_exclaim.gif" border="0" alt="Exclamation" title="Exclamation" /></a>
            <a href="javascript:emoticon(':?:');"><img src="smilies/icon_question.gif" border="0" alt="Question" title="Question" /></a>
            <a href="javascript:emoticon(':idea:');"><img src="smilies/icon_idea.gif" border="0" alt="Idea" title="Idea" /></a>
          </td>
        </tr>
      </table>
    </td>
    <td>
      <font size="-2">Tillåtna HTML-taggar: <!--GB_ALLOWEDTAGS--><br />
      <a href="javascript:openHelp('BBCode');">BBCode</a> enabled.</font><br />
      <textarea name="message" rows="7" cols="48"><!--GB_ENTRYMESSAGE--></textarea>
    </td>
  </tr>
  <tr>
  	<td></td><td> <!--GB_CONFIRMCODE--></td>
  </tr>
        <tr><td>Bekräftelsekod:</td>
        	<td >
        		<input type="text" name="confirmCode" size="4" maxlength="4" />
        	</td>
        </tr>

        <tr>
          <td colspan="2" align="center">
            <input type="submit" value="Skriv i gästboken" />
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</form>

<center>
<br /><br />
<!--GB_INFO-->
</center>

</body>
</html>

Re: Hjälp med en gästbok

Postat: 17 jun 2010, 11:40
av johanre
Kör HTML koden genom en validator så kan du få tips på vad du måste rätta till. T.ex. http://validator.w3.org/check

Re: Hjälp med en gästbok

Postat: 17 jun 2010, 22:53
av xtr3m3
Vet inte om det går att länka till adressen men fick detta: http://validator.w3.org/check?uri=http% ... ne&group=0

Verkar vara chrome som är boven :)