Top
Phpuniverset logo
 

INDHOLD

Forside

Script libary

Job annoncer

Tips og Tricks

Konkurrence

Downloads

Dokumenter

PHP bog shop

Forum

Online udviklere


ARTIKLER

CSS

Diverse

E-handel / annoncer

Grafik

Html

Internet

Javascript

Linux

PHP/MySQL

Programmer

Flash

Søgemaskiner

Windows

C / C++


INFO

Information

Annoncering

Kontakt

Forside Forum PHP, mysql Hjælp til linje skift i formel

Hjælp til linje skift i formel


 

Hjælp til linje skift i formel

ohs12121212  

Har fået dette svar, men vedkommen kan ikke fortælle mig eller vise mig på et link, hvor
og hvordan jeg gør dette.

Er der en her som kan vise mig dette på et link med billede.

så laver du en forspørgsel i din databse tabel og henter teksten ud i en variabel
f.eks.
$tekst og så kan du gøre følgende

$nytekst = nl2br("$tekst");
echo"nytekst";



Dato : 25.11.2006, 20:14

Visninger : 1342

Points : 20

 

Det er rigtigt det du gør, men noget af det er forkert, men nl2br() betyder at hvis der er
\n så skal den lave det om til br,

men hvis vi nu tar dit lille eks.
<?
/* mere kode her oppe. */
$tekst $data['news'];

$nytekst nl2br("$tekst"); 
echo 
$nyeste;
/* og her skal der også være mere kode */
?>

var det ikke det du mente?????


Dato : 27.11.2006, 06:32

Godkendt svar af : Per H  

 

Det som jeg gerne vil vide er, på hvilken side at dette stykke kode skal indsættes, og
hvor på siden. Det har jeg aldrig kunnet få et svar på. 


Dato : 27.11.2006, 10:54

Kommentar af : ohs12121212  

 

Her er koden for siden som udskrives. Kan du vise hvor det stykke kode skal indsættes.

<?php require_once('Connections/cms.php'); ?>
<?php
$colname_rsForside 
"1";
if (isset(
$_GET['id'])) {
  
$colname_rsForside = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_cms$cms);
$query_rsForside sprintf("SELECT * FROM forside WHERE id = %s ORDER BY id DESC",
$colname_rsForside);
$rsForside mysql_query($query_rsForside$cms) or die(mysql_error());
$row_rsForside mysql_fetch_assoc($rsForside);
$totalRows_rsForside mysql_num_rows($rsForside);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Content Management System</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
    background-image: url(img/baggrund.jpg);
    margin-left:0px;
    margin-top:0px;
    margin-right:0px;
    margin-bottom:0px;
    height:100%;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function mmLoadMenus() {
  if (window.mm_menu_1114220122_0) return;
    window.mm_menu_1114220122_0 = new
Menu("root",70,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1114220122_0.addMenuItem("Forside","location='index.php'");
   mm_menu_1114220122_0.hideOnMouseOut=true;
   mm_menu_1114220122_0.bgColor='#555555';
   mm_menu_1114220122_0.menuBorder=1;
   mm_menu_1114220122_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1114220122_0.menuBorderBgColor='#777777';
window.mm_menu_1114221213_0 = new
Menu("root",71,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1114221213_0.addMenuItem("Menu&nbsp;1","location='menu_1.php'");
  mm_menu_1114221213_0.addMenuItem("Menu&nbsp;2","location='menu_2.php'");
  mm_menu_1114221213_0.addMenuItem("Menu&nbsp;3","location='menu_3.php'");
  mm_menu_1114221213_0.addMenuItem("Menu&nbsp;4","location='menu_4.php'");
  mm_menu_1114221213_0.addMenuItem("Menu&nbsp;5","location='menu_5.php'");
   mm_menu_1114221213_0.hideOnMouseOut=true;
   mm_menu_1114221213_0.bgColor='#555555';
   mm_menu_1114221213_0.menuBorder=1;
   mm_menu_1114221213_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1114221213_0.menuBorderBgColor='#777777';
window.mm_menu_1114221611_0 = new
Menu("root",79,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1114221611_0.addMenuItem("Menu&nbsp;6","location='menu_6.php'");
  mm_menu_1114221611_0.addMenuItem("Menu&nbsp;7","location='menu_7.php'");
  mm_menu_1114221611_0.addMenuItem("Menu&nbsp;8","location='menu_8.php'");
  mm_menu_1114221611_0.addMenuItem("Menu&nbsp;9","location='menu_9.php'");
  mm_menu_1114221611_0.addMenuItem("Menu&nbsp;10","location='menu_10.php'");
   mm_menu_1114221611_0.hideOnMouseOut=true;
   mm_menu_1114221611_0.bgColor='#555555';
   mm_menu_1114221611_0.menuBorder=1;
   mm_menu_1114221611_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1114221611_0.menuBorderBgColor='#777777';

    window.mm_menu_1114222112_0 = new
Menu("root",89,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1114222112_0.addMenuItem("Nye&nbsp;ting","location='nye_ting.php'");
  mm_menu_1114222112_0.addMenuItem("Brugte&nbsp;ting","location='brugte_ting.php'");
   mm_menu_1114222112_0.hideOnMouseOut=true;
   mm_menu_1114222112_0.bgColor='#555555';
   mm_menu_1114222112_0.menuBorder=1;
   mm_menu_1114222112_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1114222112_0.menuBorderBgColor='#777777';

  window.mm_menu_1114222414_0 = new
Menu("root",82,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1114222414_0.addMenuItem("Billeder&nbsp;1","location='billeder_1.php'");
   mm_menu_1114222414_0.hideOnMouseOut=true;
   mm_menu_1114222414_0.bgColor='#555555';
   mm_menu_1114222414_0.menuBorder=1;
   mm_menu_1114222414_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1114222414_0.menuBorderBgColor='#777777';

  window.mm_menu_1114222456_0 = new
Menu("root",56,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1114222456_0.addMenuItem("2006","location='2006.php'");
   mm_menu_1114222456_0.hideOnMouseOut=true;
   mm_menu_1114222456_0.bgColor='#555555';
   mm_menu_1114222456_0.menuBorder=1;
   mm_menu_1114222456_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1114222456_0.menuBorderBgColor='#777777';

  window.mm_menu_1114222604_0 = new
Menu("root",48,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1114222604_0.addMenuItem("Info","location='info.php'");
   mm_menu_1114222604_0.hideOnMouseOut=true;
   mm_menu_1114222604_0.bgColor='#555555';
   mm_menu_1114222604_0.menuBorder=1;
   mm_menu_1114222604_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1114222604_0.menuBorderBgColor='#777777';

  
    window.mm_menu_1115155000_0 = new
Menu("root",75,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1115155000_0.addMenuItem("Oversigt","location='index.php'");
   mm_menu_1115155000_0.hideOnMouseOut=true;
   mm_menu_1115155000_0.bgColor='#555555';
   mm_menu_1115155000_0.menuBorder=1;
   mm_menu_1115155000_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1115155000_0.menuBorderBgColor='#777777';

        window.mm_menu_1115155146_0 = new
Menu("root",71,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1115155146_0.addMenuItem("Menu&nbsp;1","location='menu_a.php?id=1&mainid=1'");
  mm_menu_1115155146_0.addMenuItem("Menu&nbsp;2","location='menu_a.php?id=2&mainid=2'");
  mm_menu_1115155146_0.addMenuItem("Menu&nbsp;3","location='menu_a.php?id=3&mainid=3'");
  mm_menu_1115155146_0.addMenuItem("Menu&nbsp;4","location='menu_a.php?id=4&mainid=4'");
  mm_menu_1115155146_0.addMenuItem("Menu&nbsp;5","location='menu_a.php?id=5&mainid=5'");
   mm_menu_1115155146_0.hideOnMouseOut=true;
   mm_menu_1115155146_0.bgColor='#555555';
   mm_menu_1115155146_0.menuBorder=1;
   mm_menu_1115155146_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1115155146_0.menuBorderBgColor='#777777';
    window.mm_menu_1115155347_0 = new
Menu("root",71,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1115155347_0.addMenuItem("Menu&nbsp;1","location='menu_b.php?id=1&mainid=1'");
  mm_menu_1115155347_0.addMenuItem("Menu&nbsp;2","location='menu_b.php?id=2&mainid=2'");
  mm_menu_1115155347_0.addMenuItem("Menu&nbsp;3","location='menu_b.php?id=3&mainid=3'");
  mm_menu_1115155347_0.addMenuItem("Menu&nbsp;4","location='menu_b.php?id=4&mainid=4'");
  mm_menu_1115155347_0.addMenuItem("Menu&nbsp;5","location='menu_b.php?id=5&mainid=5'");
   mm_menu_1115155347_0.hideOnMouseOut=true;
   mm_menu_1115155347_0.bgColor='#555555';
   mm_menu_1115155347_0.menuBorder=1;
   mm_menu_1115155347_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1115155347_0.menuBorderBgColor='#777777';
window.mm_menu_1115155613_0 = new
Menu("root",89,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1115155613_0.addMenuItem("Nye&nbsp;ting","location='nye_ting_til_salg.php'");
 
mm_menu_1115155613_0.addMenuItem("Brugte&nbsp;ting","location='brugte_ting_til_salg.php'")
;
   mm_menu_1115155613_0.hideOnMouseOut=true;
   mm_menu_1115155613_0.bgColor='#555555';
   mm_menu_1115155613_0.menuBorder=1;
   mm_menu_1115155613_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1115155613_0.menuBorderBgColor='#777777';
window.mm_menu_1115155728_0 = new
Menu("root",76,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1115155728_0.addMenuItem("Album&nbsp;1","location='album_1.php'");
   mm_menu_1115155728_0.hideOnMouseOut=true;
   mm_menu_1115155728_0.bgColor='#555555';
   mm_menu_1115155728_0.menuBorder=1;
   mm_menu_1115155728_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1115155728_0.menuBorderBgColor='#777777';

        window.mm_menu_1115155827_0 = new
Menu("root",92,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
 
mm_menu_1115155827_0.addMenuItem("Set&nbsp;&&nbsp;Sket","location='nyheder.php?id=1&mainid
=1'");
   mm_menu_1115155827_0.hideOnMouseOut=true;
   mm_menu_1115155827_0.bgColor='#555555';
   mm_menu_1115155827_0.menuBorder=1;
   mm_menu_1115155827_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1115155827_0.menuBorderBgColor='#777777';
window.mm_menu_1115155915_0 = new
Menu("root",93,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1115155915_0.addMenuItem("Information","location='information.php'");
   mm_menu_1115155915_0.hideOnMouseOut=true;
   mm_menu_1115155915_0.bgColor='#555555';
   mm_menu_1115155915_0.menuBorder=1;
   mm_menu_1115155915_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1115155915_0.menuBorderBgColor='#777777';
window.mm_menu_1115160126_0 = new
Menu("root",88,18,"",12,"#000000","#FFFFFF","#CCCCCC","#666666","left","middle",3,0,1000,-
5,7,true,true,true,0,true,true);
  mm_menu_1115160126_0.addMenuItem("Opret&nbsp;mail","location='opret_mail'");
   mm_menu_1115160126_0.hideOnMouseOut=true;
   mm_menu_1115160126_0.bgColor='#555555';
   mm_menu_1115160126_0.menuBorder=1;
   mm_menu_1115160126_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1115160126_0.menuBorderBgColor='#777777';

mm_menu_1115160126_0.writeMenus();
} // mmLoadMenus()

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src;
x.src=a[i+2];}
}
//-->
</script>
<script language="JavaScript" src="mm_menu.js"></script>
<link href="css/styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style3 {
    color: #999999;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 18px;
    font-weight: bold;
}
.style9 {color: #999999; font-family: Verdana, Arial, Helvetica, sans-serif; font-size:
12px; }
-->
</style>
</head>

<body
onLoad="MM_preloadImages('img/rod_01_over.gif','img/rod_03_over.gif','img/rod_04_over.gif'
,'img/rod_05_over.gif','img/rod_08_over.gif','img/rod_02_over.gif','img/rod_07_over.gif','
img/rod_06_over.gif')">
<script language="JavaScript1.2">mmLoadMenus();</script>
<table width="722" height="100%" border="0" align="center" cellpadding="1" cellspacing="0"
bgcolor="#FFFFFF">
  <tr>
    <td valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,
29,0" width="722" height="101">
            <param name="movie" value="img/flash1.swf">
            <param name=quality value=high>
            <embed src="img/flash1.swf" quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Shockw />aveFlash" type="application/x-shockwave-flash" width="722" height="101"></embed>
          </object></td>
        </tr>
        <tr>
          <td><form name="form1" method="get" action="resultat.php">
              <table width="722" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="left"><a href="index.php"
onMouseOver="MM_swapImage('forside','','img/rod_01_over.gif',1)"
onMouseOut="MM_swapImgRestore()"><img src="img/rod_01.gif" name="forside" width="70"
height="22" border="0" id="forside"></a><a href="javascript:;"
onMouseOver="MM_swapImage('menu_a','','img/rod_03_over.gif',1);MM_showMenu(window.mm_menu_
1115155146_0,0,22,null,'menu_a')" onMouseOut="MM_swapImgRestore();MM_startTimeout();"><img
src="img/rod_03.gif" name="menu_a" width="60" height="22" border="0" id="menu_a"></a><a
href="javascript:;"
onMouseOver="MM_swapImage('menu_b','','img/rod_04_over.gif',1);MM_showMenu(window.mm_menu_
1115155347_0,0,22,null,'menu_b')" onMouseOut="MM_swapImgRestore();MM_startTimeout();"><img
src="img/rod_04.gif" name="menu_b" width="60" height="22" border="0" id="menu_b"></a><a
href="javascript:;"
onMouseOver="MM_swapImage('ting_til_salg','','img/rod_05_over.gif',1);MM_showMenu(window.m
m_menu_1115155613_0,0,22,null,'ting_til_salg')"
onMouseOut="MM_swapImgRestore();MM_startTimeout();"><img src="img/rod_05.gif"
name="ting_til_salg" width="100" height="22" border="0" id="ting_til_salg"></a><a
href="javascript:;"
onMouseOver="MM_swapImage('billeder','','img/rod_08_over.gif',1);MM_showMenu(window.mm_men
u_1115155728_0,0,22,null,'billeder')"
onMouseOut="MM_swapImgRestore();MM_startTimeout();"><img src="img/rod_08.gif"
name="billeder" width="80" height="22" border="0" id="billeder"></a><a href="javascript:;"
onMouseOver="MM_swapImage('nyheder','','img/rod_02_over.gif',1);MM_showMenu(window.mm_menu
_1115155827_0,0,22,null,'nyheder')"
onMouseOut="MM_swapImgRestore();MM_startTimeout();"><img src="img/rod_02.gif"
name="nyheder" width="70" height="22" border="0" id="nyheder"></a><a href="javascript:;"
onMouseOver="MM_swapImage('info','','img/rod_07_over.gif',1);MM_showMenu(window.mm_menu_11
15155915_0,0,22,null,'info')" onMouseOut="MM_swapImgRestore();MM_startTimeout();"><img
src="img/rod_07.gif" name="info" width="40" height="22" border="0" id="info"></a><a
href="kontakt_os.php" onMouseOver="MM_swapImage('kontakt_os','','img/rod_06_over.gif',1)"
onMouseOut="MM_swapImgRestore()"><img src="img/rod_06.gif" name="kontakt_os" width="100"
height="22" border="0" id="kontakt_os"></a></td>
                  <td width="72" align="right"><input name="search" type="text"
id="search" size="13">                  
                  <td width="42"><input type="submit" name="Submit"
value="S&oslash;g"></td>
                </tr>
              </table>
          </form></td>
        </tr>
        <tr>
          <td height="19"><table width="722" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="116">&nbsp;</td>
                <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><table width="100%"  border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td><h2><br>
                            <span class="style3"><?php echo $row_rsForside['overskrift'];
?></span></h2></td>
                      </tr>
                      <tr>
                        <td><br>                          
                          <span class="style9"><?php echo $row_rsForside['tekst1'];
?></span><br></td>
                      </tr>
                      <tr>
                        <td valign="middle"><br>                          <?php
              
if ($row_rsForside['billede']) { 
               echo 
'<img src="billeder/'.$row_rsForside['billede'].'">';}?><br>                   
      </td>
                      </tr>
                      <tr>
                        <td><br>                          
                          <span class="style9"><?php echo $row_rsForside['tekst2'];
?></span><br>                          </td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                      </tr>
                    </table>                    <h3><br>
                      </h3></td>
                  </tr>
                </table></td>
                <td width="80">&nbsp;</td>
              </tr>
          </table></td>
        </tr>
      </table>
        <p>&nbsp;</p>
        <p>&nbsp; </p>
        <p>&nbsp;</p>
        <p>&nbsp; </p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp; </p></td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result
($rsForside);
?>


Dato : 27.11.2006, 11:47

Kommentar af : ohs12121212  

 

Hvad skal den udskrive og hvor skal den udskrive det henne???

Dato : 27.11.2006, 20:34

Kommentar af : Per H  

 

Ok - det er vist nemmere at du viser et eks.p hvor du har lagt koden ind og opmærker det
som den skal udskrive. Det vil nok give mig en mening med hvad du mener.


Dato : 27.11.2006, 21:41

Kommentar af : ohs12121212  

 

Per, kan du ikke skrive direkte til mig for at vise hvor jeg indsætter koden.
sh()duo2.dk


Dato : 03.12.2006, 14:32

Kommentar af : ohs12121212  




Login for at skrive et indlæg :



   Brugernavn

Password
 

+ Opret en ny Bruger, Klik her

+ Glemt brugernavn/password

 

Send Artikel/anmeldelse til: phpuni@phpuniverset.dk

Tilbage til oversigt

© Copyright 2000 Propelcom Phpuniverset's politik om personlige oplysninger, artikler & Koder Phpuniverset er optimeret til Mozilla 1024 * 768 Phpuniverset version: 3.0 beta
Webhost : Ignesco.dk

Bund