Top
Phpuniverset logo
 
930 banner

INDHOLD

Forside

Script libary

Job annoncer

Tips og Tricks

Konkurrence

Downloads

Dokumenter

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 Stort mellemrum

Stort mellemrum


 

Stort mellemrum

Sebastian Jepsen  

Hej

Jeg har det problem at når jeg sætte min kode ind i min anden kode så kommer der et
meget stort mellemrum mellem der det skulle stå og bunden hvor det koden står.

http://www.sebofdoom-designs.com/project/projects-site.php 

Min kode er: [code]<?php
session_start
();

$host "sebproject.db.5164517.hostedresource.com";
$databasename "sebproject";
$databaseuser "sebproject";
$databasepassword "Y5XYXr5y";

mysql_connect($host,$databaseuser,$databasepassword);
if (
$ex != "no")
mysql_select_db($databasename);
//
$tablehead '<table border="1" cellspacing="0" cellpadding="4" bordercolor="#999999">';
?>
<html>

<head>
<meta name="google-site-verification"
content="qweVS5Y_WsRE1HXwfTJrA9FylMjMRTQNG3VZuMGtbno" />
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Sebofdoom-Designs</title>
<link rel="shortcut icon" href="../ikon.ico">
<script language="JavaScript">
<!--
function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2;
n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) {
doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}
// -->
</script>
<style title="center" media="screen" type="text/css">
#center {width:200px; height:100px; position:absolute; top:0%; left:50%; margin:-0px auto
auto -550px; text-align:center;
}
/* set millions of background images */
.rbroundbox { background: url('../nt.png'); }
.rbtop div { background: url('../tl.png') no-repeat top left; }
.rbtop { background: url('../tr.png') no-repeat top right; }
.rbbot div { background: url('../bl.png') no-repeat bottom left; }
.rbbot { background: url('../br.png') no-repeat bottom right; }

/* height and width stuff, width not really nessisary. */
.rbtop div, .rbtop, .rbbot div, .rbbot {
width: 100%;
height: 26px;
font-size: 1px;
}
.rbcontent { margin: 0 7px; }
.rbroundbox { width: 90%; margin: 1em auto; 
}
</style>
</head>

<body background="../Carbon_background.jpg" link="#FFFFFF"
onload="FP_preloadImgs(/*url*/'../Navigation/Knapper/Click/Home_Click.png',
/*url*/'../Navigation/Knapper/Mus_over/Home_mus_over.png')">


    <div id="center">
    <div style="position: absolute; width: 1013px; height: 38px; z-index: 1; left: 34px; top:
289px" id="lag1">

    <a href="index.php">
    <img border="0" id="Home" src="../Navigation/Knapper/Normal/Home_normal.png"
onmouseover="FP_swapImg(1,0,/*id*/'Home',/*url*/'../Navigation/Knapper/Mus_over/Home_mus_o
ver.png')"
onmouseout="FP_swapImg(0,0,/*id*/'Home',/*url*/'../Navigation/Knapper/Normal/Home_normal.p
ng')"
onmousedown="FP_swapImg(1,0,/*id*/'Home',/*url*/'../Navigation/Knapper/Click/Home_Click.pn
g')"
onmouseup="FP_swapImg(0,0,/*id*/'Home',/*url*/'../Navigation/Knapper/Mus_over/Home_mus_ove
r.png')"
</a></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p; 
    
    <a href="Movies.php">
    <img border="0" id="Movies" src="../Navigation/Knapper/Normal/Movies_Normal.png"
onmouseover="FP_swapImg(1,0,/*id*/'Movies',/*url*/'../Navigation/Knapper/Mus_over/Movies_m
us_over.png')"
onmouseout="FP_swapImg(0,0,/*id*/'Movies',/*url*/'../Navigation/Knapper/Normal/Movies_Norm
al.png')"
onmousedown="FP_swapImg(1,0,/*id*/'Movies',/*url*/'../Navigation/Knapper/Click/Movies_Clic
k.png')"
onmouseup="FP_swapImg(0,0,/*id*/'Movies',/*url*/'../Navigation/Knapper/Mus_over/Movies_mus
_over.png')"
</a></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    
    <a href="/gallery/Pictures.php">
    <img border="0" id="Pictures" src="../Navigation/Knapper/Normal/Pictures_Normal.png"
onmouseover="FP_swapImg(1,0,/*id*/'Pictures',/*url*/'../Navigation/Knapper/Mus_over/Pictur
es_mus_over.png')"
onmouseout="FP_swapImg(0,0,/*id*/'Pictures',/*url*/'../Navigation/Knapper/Normal/Pictures_
Normal.png')"
onmousedown="FP_swapImg(1,0,/*id*/'Pictures',/*url*/'../Navigation/Knapper/Click/Pictures_
Click.png')"
onmouseup="FP_swapImg(0,0,/*id*/'Pictures',/*url*/'../Navigation/Knapper/Mus_over/Pictures
_mus_over.png')"
</a></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 
    
    <a href="Projects.php">
    <img border="0" id="Projects" src="../Navigation/Knapper/Normal/Projects_Normal.png"
onmouseover="FP_swapImg(1,0,/*id*/'Projects',/*url*/'../Navigation/Knapper/Mus_over/Projec
ts_mus_over.png')"
onmouseout="FP_swapImg(0,0,/*id*/'Projects',/*url*/'../Navigation/Knapper/Normal/Projects_
Normal.png')"
onmousedown="FP_swapImg(1,0,/*id*/'Projects',/*url*/'../Navigation/Knapper/Click/Projects_
Click.png')"
onmouseup="FP_swapImg(0,0,/*id*/'Projects',/*url*/'../Navigation/Knapper/Mus_over/Projects
_mus_over.png')"
</a></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    
    <a href="Tutorials.php">
    <img border="0" id="Tutorials" src="../Navigation/Knapper/Normal/Tutorials_Normal.png"
onmouseover="FP_swapImg(1,0,/*id*/'Tutorials',/*url*/'../Navigation/Knapper/Mus_over/Tutor
ials_mus_over.png')"
onmouseout="FP_swapImg(0,0,/*id*/'Tutorials',/*url*/'../Navigation/Knapper/Normal/Tutorial
s_Normal.png')"
onmousedown="FP_swapImg(1,0,/*id*/'Tutorials',/*url*/'../Navigation/Knapper/Click/Tutorial
s_Click.png')"
onmouseup="FP_swapImg(0,0,/*id*/'Tutorials',/*url*/'../Navigation/Knapper/Mus_over/Tutoria
ls_mus_over.png')" </a></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; 
    
    <a href="Forum.php">
    <img border="0" id="Forum" src="../Navigation/Knapper/Normal/Forum_Normal.png"
onmouseover="FP_swapImg(1,0,/*id*/'Forum',/*url*/'../Navigation/Knapper/Mus_over/Forum_mus
_over.png')"
onmouseout="FP_swapImg(0,0,/*id*/'Forum',/*url*/'../Navigation/Knapper/Normal/Forum_Normal
.png')"
onmousedown="FP_swapImg(1,0,/*id*/'Forum',/*url*/'../Navigation/Knapper/Click/Forum_Click.
png')"
onmouseup="FP_swapImg(0,0,/*id*/'Forum',/*url*/'../Navigation/Knapper/Mus_over/Forum_mus_o
ver.png')" </a></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; 
    
    <a href="Lineup.php">
    <img border="0" id="Lineup" src="../Navigation/Knapper/Click/Lineup_Click.png"
onmouseover="FP_swapImg(1,0,/*id*/'Lineup',/*url*/'../Navigation/Knapper/Mus_over/Lineup_m
us_over.png')"
onmouseout="FP_swapImg(0,0,/*id*/'Lineup',/*url*/'../Navigation/Knapper/Click/Lineup_Click
.png')"
onmousedown="FP_swapImg(1,0,/*id*/'Lineup',/*url*/'../Navigation/Knapper/Click/Lineup_Clic
k.png')"
onmouseup="FP_swapImg(0,0,/*id*/'Lineup',/*url*/'../Navigation/Knapper/Mus_over/Lineup_mus
_over.png')" </a></a></div>
    
    <img border="0" src="../Headbanner/HeadBanner.png" width="1100" height="325">
    
    
    <div style="position: absolute; width: 928px; height: 267px; z-index: 2; left: 73px; top:
382px" id="lag2">
<div style="position: absolute; width: 100px; height: 100px; z-index: 3; left: 285px; top:
29px" id="lag6">
    <img border="0" src="../Navigation/pictures.png" width="354" height="142"></div>
&nbsp;
<div class="rbroundbox">
    <div class="rbtop"><div>
        <div id="lag3">
            &nbsp;</div>
        <p>&nbsp;</div></div>
        <div class="rbcontent">
        <!--------------------------------------------------------------------------------------
-------------------------------------------->
    
    <br>
    <br>
    <br>
    <br>
    <br>
    
        <p></p>
        

        <div style="position: absolute; width: 100px; height: 100px; z-index: 4; left:403px;
top:95px" id="lag7">
&nbsp;<?php

include("functions.php");
$sort "";
$how "ASC";
$went 1;

if (
$_SERVER['REQUEST_METHOD'] == 'POST')
{
    
$ids $_POST['ids'];
    
$order implode(",",$_POST);
    
$order str_replace($ids,"",$order);
    
$order substr($order,0,strlen($order)-1);
    
$ids explode(",",$_POST['ids']);
    
$order explode(",",$order);
    
$x 0;
    
    foreach (
$order as $val)
    {
    
$id $ids[$x];
    if (!
is_numeric($id) || !is_numeric($val))
    {
    
$x++;
    continue;
    }    
    
$link "UPDATE projects SET sort='$val' WHERE id='$id'";
    
$res mysql_query($link) or die(mysql_error());
    
$x++;
    }

}
    

if (isset(
$_GET['action']))
{
    
$action clean($_GET['action']);
    
$user $_SESSION['user'];
    if (
$action == 1)
    {
        
$date date("n/j/Y");
        
$link "INSERT INTO projects VALUES ('-New
Project-','
$date','','','','','0',NOW(),'$user','')";
        
$res mysql_query($link) or die(mysql_error());
    }
    else
        echo 
"<p class='heading'>Invalid Action</p>";
}

if (isset(
$_GET['sort']))
{
    if (isset(
$_GET['went']))
    {
    if (
$_GET['went'] == 2)
    {
        
$how "DESC";
        
$went 1;
    }
    elseif(
$_GET['went'] == 1)
    {
        
$how "ASC";
        
$went 2;
    }
    else
    {
    
$how "ASC";
    
$went 1;
    }
    }
    else
    {
    
$went 1;
    }
    
$good = array("sort","name","date","cat","status","last_changed");
    
$sort $_GET['sort'];
    if (!
in_array($sort,$good))
    die(
"Invalid sort column.");
}

echo 
'<br /><a href="projects.php?action=1"></a><br /><br />';

if (empty(
$sort))
$sort "sort";

$link "SELECT * FROM projects ORDER BY $sort $how";
$res mysql_query($link) or die(mysql_error());
$total mysql_num_rows($res);

echo 
$tablehead '
<tr>
<td colspan="5" class="heading">projects</td>
</tr>
<tr align="center">
<td>
<a href="projects.php?sort=name&went=' 
$went '">name</a>
</td>
<td>
<a href="projects.php?sort=date&went=' 
$went '">date</a>
</td>' 

'<td>
<a href="projects.php?sort=cat&went=' 
$went '">category</a>
</td>
<td>
<a href="projects.php?sort=status&went=' 
$went '">status</a>
</td>' 
.
'<td>
<a href="projects.php?sort=last_changed&went=' 
$went '">change</a>
</td>
</tr>
<form action="" method="text">'
;

$ids "";
$x 0;

while (
$row mysql_fetch_assoc($res))
{

$name $row['name'];
$date $row['date'];
$des $row['des'];
$cat $row['cat'];
$status $row['status'];
$sort $row['sort'];
$private $row['private'];
$change $row['last_changed'];
$id $row['id'];
$ids .= $id ",";


echo 
'<tr><td nowrap><a href="editprojects.php?id=' $id '">' $name .
'</a>&nbsp;</td><td nowrap>' $date .  '&nbsp;</td>' 
'<td>' $cat '&nbsp;</td><td>' $status '&nbsp;</td><td nowrap>' $change .
'&nbsp;</td></tr>';
$x++;
}

$ids substr($ids,0,strlen($ids)-1);



$time date("h:i:s A");
$date date("n/j/Y");

?></div>
        

        </p></div><!-- /rbcontent -->
    <div class="rbbot"><div>&nbsp;</div></div>
</div><!-- /rbroundbox -->
<!-- phpmyvisites -->
<script type="text/javascript">
<!--
var a_vars = Array();
var pagename='';

var phpmyvisitesSite = 1;
var phpmyvisitesURL = "http://sebofdoom-designs.com/php-my-visites/phpmyvisites.php";
//-->
</script>
<script language="javascript"
src="http://sebofdoom-designs.com/php-my-visites/phpmyvisites.js"
type="text/javascript"></script>
</a>
<!-- /phpmyvisites --> 
</div></div>

    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</div>

</body>

</html>[/code]



Dato : 10.11.2009, 21:44

Visninger : 2653

Points : 50

 

Det er måske ikke en særlig god idé at du udgiver dine MySql-oplysninger.
Kan desværre ikke hjælpe dig.


Dato : 10.11.2009, 23:50

Kommentar af : Karoline  

 

Kan se du har et ekstremt forbrug af <br />-markører ... feks:
echo '<br /><a href="projects.php?action=1"></a><br /><br />';

En anden ting som giver mega space er:
</a></a>&nbsp;&nbsp
Den dobbelt </a>-markør ved jeg ikke rigtig hvad outputter, men formoder en er rigelig.

En sidste ting som giver mega linebreaks medmindre man har været grundig i sine
stylesheets er afsnitsmarkøren <p>
At sløjfe den helt definere sin tekstformatering i div-bokse giver mindre spacewasting.
Håber dette hjælper.

Og jeg vil også grundigt advære dig om at publicere fuld kildekode samt siteoplysninger
på denne måde. Læs, forstå og slet indlægget :P 


Dato : 15.11.2009, 08:39

Kommentar af : michel  




Login for at skrive et indlg :



   Brugernavn

Password
 

+ Opret en ny Bruger, Klik her

+ Glemt brugernavn/password

 

Send Artikel/anmeldelse til: phpuni@phpuniverset.dk

Tilbage til oversigt

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

Bund