php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2004

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 04.09.2004, 10:08  
Gast
 
Beiträge: n/a
Standard download und Insert problem!

Hi,

Wie ihr schon im Topic seht hab ich 2 Probleme!

Zu 1:

Mache grad ne Page woe ich ein paar files runterladen kann und im adminbereich wieder hochladen kann! Aber ich weiss nich wie ich so ein download machen soll! hab da null ahnung! Ihr mal das wo ich bis jetzt via google herrausgefunden habe!

downloads.php(da ist der link zur File):

PHP-Code:
$eintragen "SELECT `ID`, `Name`,  `Kat`, `Info`,`download` from download where Kat = $Kat";


$result mysql_query($eintragen) Or die(mysql_error());
while(
$row mysql_fetch_array($result)) { 

        
$x=$row['ID'];

    echo 
"<tr width=\"100%\">"
            echo 
"<div class=\"downloads\">"
                echo 
"<td width=\"25%\">"
            echo 
$row['Name']; 
            echo 
"</td><td width=\"40%\">";            
                echo 
$row['Info'];  
            echo 
"</td><td width=\"10%\">";  
                echo 
"<a href=\"download.php?file=$x\">Download</a>"
           echo 
"</td>";            
                echo 
"    </div>\n"
                echo 
"</div>\n"
            echo 
"</tr>"


}} 
download.php:

PHP-Code:
@mysql_connect($MYSQL_HOST$MYSQL_USER$MYSQL_PASS) OR die(mysql_error());
mysql_select_db($MYSQL_DATABASE) OR die(mysql_error()); $eintragen =

"SELECT `ID`, `download` from download";

 
$result mysql_query($eintragen) Or die(mysql_error());
 
$row mysql_fetch_array($result);


$download=$row['download'];


$files = Array("1" => $download);
$filename "docs/".$files[$_GET[file]]; 

header("Content-Type: x-type/subtype"); 
header("Content-Length: ".filesize($filename)); 
header("Content-Disposition: attachment; filename=".$files[$_GET[file]]); 
readfile($filename); 
So in der DB hab ich dann den Path zur Datei angegeben!


ZU 2.

Habe ein Gb und auf der gleichen Seite wie eingetrgen wird sind posts! Das Problem ist das er mir ohne ein Fehler alles abschick aber irgendwie nichts in der Db steht! Hier mal den php Code:

gb.php

PHP-Code:
error_reporting(E_ALL);
include 
"inc/config.php";

if(isset(
$_POST['submit'])) { 

@
mysql_connect($MYSQL_HOST$MYSQL_USER$MYSQL_PASS) OR die(mysql_error()); 
mysql_select_db($MYSQL_DATABASE) OR die(mysql_error());

      
$Name $_POST['Name']; 
    
$Icq $_POST['Icq'];
    
$Homepage $_POST['Homepage'];
    
$Text $_POST['Inhalt'];

  
$eintrag "INSERT INTO GB (`Name`, `ID`, `Datum`, `Icq`, `Homepage`, `Text`) 
  VALUES ('"
.$Name."', '".$Icq."', '".$Homepage."', '".$Inhalt."',  NOW())";  
  
mysql_query($eintrag); 



Ich hoffe ihr könnt mir helden!

Ps: Hoffe ist nicht zu viel

mfg light!
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 04.09.2004, 14:12  
Gast
 
Beiträge: n/a
Standard

Kann mir keiner helfen!? Nicht auf einen Fehler hinweisen!?

Plz help !
 
Alt 04.09.2004, 14:41  
Gast
 
Beiträge: n/a
Standard

also eine sache die mir aufgefallen ist, ist dass du statt des apostrophes " ' " oft das franzoesische ding (das ich nicht schreiben kann ~~) " ` " benutzt hast. das sollte eigentlich nicht funktionieren.
das apostroph kriegst du auf deutschem layout mit shift + #.
 
Alt 04.09.2004, 14:48  
Gast
 
Beiträge: n/a
Standard

Also ich habe es bis jetzt immer so gemacht! Und es funktioniert! :/
 
Alt 04.09.2004, 16:51  
Gast
 
Beiträge: n/a
Standard

Keiner ne Idee !? Mindestens zu Problem 2 !?

Was mache ich da falsch!?
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Self Join / Nested Join ? Ich hab ne Blockade... iangillan Datenbanken 11 06.01.2008 21:37
Pathfinding Algorithmus optimieren? (Algorith. von Dijkstra) Martin13 PHP Tipps 2007 19 04.09.2007 19:20
Problem mit Download Smily0412 PHP Tipps 2006 7 07.12.2006 22:55
Insert Problem mit IP sperre.... Nosferatu PHP Tipps 2007 17 30.12.2005 12:35
PRoblem mit Cookie bei PHPbb-Board PHP Tipps 2007 8 12.12.2005 20:56
File up& download in MySQL // Problem hier: Filesize PHP Tipps 2005-2 1 20.09.2005 15:30
Problem mit binär (binary) Insert von PHP in MS SQL SERVER PHP-Fortgeschrittene 0 07.09.2005 20:34
mysql dump einspielen (ohne phpmyadmin) PHP Tipps 2005-2 6 18.06.2005 21:50
Insert Script Problem PHP Tipps 2005 11 08.04.2005 20:53
Problem mit Datei Download PHP Tipps 2005 5 13.03.2005 14:38
Problem mit MySQL-Tabelle und INSERT El Barto Datenbanken 1 14.02.2005 12:22
[Erledigt] ZIP Download - Header Problem PHP-Fortgeschrittene 1 19.08.2004 02:41
PHP Download Problem PHP Tipps 2004 4 05.07.2004 15:25
hab ein problem mit Sql INSERT PHP Tipps 2004 4 01.07.2004 18:40
[Erledigt] HILFE: Column count doesn't match value count at row 1 Datenbanken 17 12.06.2004 16:45


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:33 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.