wie füge ich zu den koden die anderen kode rein
#1
Hi Leute habe ein folgendes problem.
Hab ei webtaplate das mit html geschrieben ist nun hab ich da aber meinen
php kod ist ein upload scricpt.
Nun hab ich ein problem wie füge ich die beiden zusammen.
ich muss es als php abscpeichern hab zihmlich viel rum gemacht.
wenn ich das ding als php abspeicher dann ist es das disign vom php wenn ich es als hatml abspeicher bekomm ich die befehl auf der seite zu sicht.
kann mir jemand helfen?

ich gib euch mal beide kode:
php code:
Code:
<?
    include("include/common.php");
    include("include/header.php");
    if($loggedin){
        include("include/accmenu.php");
    }
    if( $_POST['submit'] && $_FILES['attached']['name'] ){
        $ok_filetypes = explode("|",$att_filetypes);
        if (!$_FILES['attached']['error'] && $_FILES['attached']['size'] > $att_max_size*1024){
            errform('<CENTER>Resim Boyutu 3MB tan Büygk.Lütfen ufaltip Yeniden Yükle</CENTER><BR><BR>'); // #err
            $step = 1;
        }
        $filename = (!$_FILES['attached']['error'] ? substr( basename($_FILES['attached']['name']), -30 ) : '');
        $x = strtolower( substr($_FILES['attached']['name'], -3));
        if($filename && !in_array($x, $ok_filetypes) ){
            errform('<CENTER>Resim Formati geçerli degildir,geçerli bir Formata Çevir</CENTER><BR><BR>');
            $step = 1;
        }
        if(!$posterr){
            if(!isset($_GET["ipaddress]) || ($_GET["ipaddress] == "")) {
                $ipaddress = $_SERVER['REMOTE_ADDR'];
                $local = 1;
            } else {
                $ipaddress = $_GET["ipaddress];
                $local = 0;
            }
            $uniq = substr( md5(uniqid (rand())), 0, 10 );
            $ext = strtolower( substr($_FILES['attached']['name'], -3));
            move_uploaded_file($_FILES['attached']['tmp_name'], $att_path."/".$uniq.".".$ext );
            $strQuery  = "INSERT INTO images25 SET ";
            $strQuery .= "filename='".$uniq.".".$ext."',";
            $strQuery .= "ipaddress='{$ipaddress}',";
            $strQuery .= "date='".time()."',";
            $strQuery .= "pkey='{$uniq}',";
            if($myuid){
                $strQuery .= "user='{$myuid}',";
            }
            $strQuery .= "status='1'";
            $result = mysql_query($strQuery) or die( mysql_error() );
            $aid = mysql_insert_id();
            if($aid){
                $filen = $siteurl."/".str_replace('./', '', $att_path)."/".$uniq.".".$ext;
                $filen = str_replace('http://','%%',$filen);
                $filen = str_replace('//','/',$filen);
                $filen = str_replace('%%','http://',$filen);

                
                //ITS AN IMAGE
                if($x=="jpg" or $x=="jpeg" or $x=="gif" or $x=="png" or $x=="jif" or $x=="jfif")
                {
                    $filenx=$filen;
                }
                else
                {
                    include("include/const.inc.php");
                    $filenx = $siteurl."/icons/".$Icons[$ext];
                }


                $step = 2;
            }else{
                $step = 1;
            }
        }
    }else{
        $step = 1;
    }
    if($step == 1){
?>
        
<table border="0" cellpadding="0" cellspacing="0"  width="100%" height="100%" style="border-left:solid 1px  #000000;">
<tr>
<td class="left" ><img src="images/space.gif" width="40" height="1" border="0" alt=""></td>
<td valign="top" width="100%" height="100%"  >


<table border="0" cellpadding="0" cellspacing="0"  width="100%">

<tr>
<td class="in"  >
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <div align=center>
                <form ENCTYPE="multipart/form-data" method="post" name="form1">
                    <INPUT NAME="attached" TYPE="file"  size="50"><br>
                    Geçerli Format: <b><?=implode("</b>, <b>",explode("|",$att_filetypes))?></b><br>
                    Geçerli Boyut <b><?=$att_max_size?>KB</b>
                    <br><br>
                    <input type="submit" name="submit" value="Resimi Yükle File">
                </form>
                </div>
            </td>
        </tr>
        </table>
<?
    }else{    ?>
  <br>
</div>
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td><div align="center"><img src="<?=$filenx?>"></div></td>
        </tr>
        <tr>
            <td><div align="center"><br>
<table><tr><td><a href="meine seite"><font size="3"><b>Foruma geri dön</b></font></a></td></tr></table>
<br>
<div align="center"><b>Resmin Basariyla Yüklenmistir</b><br><br>
                Bu Resimi Forumlarda Göstermek için Bu Kodu kopyala ve Mesajkutusuna Yapistir<br>
                Kod:<br>
                <textarea name="textarea" cols="100" wrap="soft" rows="3">[img]<?=$filen?>[/img]</textarea>
            </div></td>
        </tr>
        <tr>
            <td><div align="center"><br>
                Resimi Arkadaslarini ve Ailene göstermek için bu kodu Kopyala: <br>
        <textarea name="textarea2" cols="100" rows="4"><?=$filen?></textarea>
      </div></td>
        </tr>
        <tr>
            <td><div align="center"><br>
                Resimi HTML Sayfalarinda göstermek için Bu kodu kopyala ve Yapistir<br>
                Kod:<br>
                <textarea name="textarea3" cols="100" wrap="soft" rows="3"><a href="<?=$filen?>" target="_blank"><img alt="File Hosted by <?=$sitename?>" src="<?=$filenx?>" /></a></textarea>
            </div></td>
        </tr>
        <tr>
            <td>&nbsp;</td>
        </tr>
        </table>
<?    }    ?>
<?
    include("include/footer.php");
?>

und das ist mein html tamplate code
Code:
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="robots" content="INDEX,FOLLOW">
<meta name="keywords"
content="homepage,dokument,webpage,page,web,netz,homepage dokument webpage page web netz">
<meta name="description"
content="homepage, dokument, webpage, page, web, netz" >
<title>homepage, dokument, webpage, page, web, netz, homepage dokument webpage page web netz</title>
<script>
<!--
function BlurLinks(){
lnks=document.getElementsByTagName('a');
for(i=0;i<lnks.length;i++){
lnks[i].onfocus=new Function("if(this.blur)this.blur()");
}
}

onload=BlurLinks;
-->
</script>
<link rel="stylesheet" href="format.css" type="text/css">

</head>
<body style="margin-top: 0px; margin-left: 10px; "  >




<table border="0" cellpadding="0" cellspacing="0"  width="100%" height="100%" style="border-left:solid 1px  #000000;">
<tr>
<td class="left" ><img src="images/space.gif" width="40" height="1" border="0" alt=""></td>
<td valign="top" width="100%" height="100%"  >


<table border="0" cellpadding="0" cellspacing="0"  width="100%">

<tr>
<td class="in"  >
Link 03 - Men&uuml; 2





</td>
</tr>
</table>












</td>

</tr>
</table>

</body>
</html>
hoffe mir kann jemand helfen
Zitieren
#2
Hi,

was Du hier vorhast geht ohne PHP und MySQL Kenntnisse nicht. Eine Datenbank brauchst Du hier nämlich auch, nebst dem Wissen wie man Datenbanktabellen anlegt und eine Datenbankverbindung herstellt.

Ich weiss ja nicht wo Du das (Teil)script herhast, es sieht aber so aus als wäre das Upload Script Teil eines anderen Scriptes. Denn hier werden noch weitere Dateien benötigt/includet (common.php, header.php) und auch ein Login (if($loggedin){) wird wohl geprüft.

Deshalb kann ich Dir auch nicht sagen wie Du was konkret machen sollst, da Du hier höchstwarscheinlich noch einige andere Schritte vorher tun musst.

Cu Helmut
Zitieren



Möglicherweise verwandte Themen...
Thema Verfasser Antworten Ansichten Letzter Beitrag
  Links zu anderen Seiten - erlaubt ? Seramis 2 1.125 27.02.2007, 14:52
Letzter Beitrag: Seramis