Jetzt Mitglied werden

Kostenlos registrieren und die vielen Vorteile der Webmasterpro-Mitgliedschaft nutzen.

Login für Mitglieder

Forum - Entwicklung

Info: Der Stern signalisiert, dass neue Beiträge vorhanden sind.

Über Webmasterpro.de

Das Portal wird betrieben und entwickelt durch die Team23 Agentur. Die Augsbuger Agentur hat sich auf Community Software und die Entwicklung von Webportalen spezialisiert.

Skriptsprachen (PHP, Javascript, etc.) - Forum

Derzeit sind Sie als Gast in unserem Forum aktiv. Für das Schreiben registrieren Sie sich bitte. Unser Forum ist eine Austauschplattform für Webworker zum Kommunizieren, Helfen, Informieren und Hilfe finden. Auf der rechten Seiten finden Sie eine Forenübersicht über alle Bereiche des Webmaster-Forums. Unterhalb finden Sie alle aktuellen Themen.

Diskutieren Sie hier über die serverseitige Skriptsprachen PHP und Python und über dynamische Webseitenerstellung mit Javascript und Ajax.


piXo
Beiträge: 23

PN schreiben
Profil ansehen
User ist offline

Youtube Video per Formular ausgeben

Link zur Antwort auf "Youtube Video per Formular ausgeben" von piXo piXo, am Sonntag den 09.10.2011 um 00:11:14

Hallo liebe Mitglieder,

ist es möglich, dass ich durch ein Formular einen Link von einem Youtube Video angebe, dieser in der Datenbank gespeichert wird mit einer ID und ich diesen dann auslesen kann? Es geht darum, dann über die Videos abzustimmen.

Würde das gerne über eine Datenbank machen, das heißt jedes Video eine ID geben, dieser wird in der Datenbank eingegeben und dann z. B. per iFrame ausgegeben.

Ist ads möglich?


piXo
Beiträge: 23

PN schreiben
Profil ansehen
User ist offline
Link zur Antwort auf "Youtube Video per Formular ausgeben" von piXo piXo, am Sonntag den 09.10.2011 um 00:48:01

Bitte löschen! Danke.


piXo
Beiträge: 23

PN schreiben
Profil ansehen
User ist offline
Link zur Antwort auf "Youtube Video per Formular ausgeben" von piXo piXo, am Sonntag den 09.10.2011 um 12:10:01

Ich bin es doch nochmal :( Also ich habe ein Bewertungsscript für Bilder - jetzt wollte ich das so umschreiben, dass mein einen Link eingibt under den in der DB anspeichert und dann das Video wiedergibt, leider funktioniert das alles nicht.

Blicke nicht so durch, ob ich alles richtig geändert habe, total unübersichtlich.

Würde sich jemand bereiterklären mir zu helfen, bzw. mir das zu ändern?

Danke.


piXo
Beiträge: 23

PN schreiben
Profil ansehen
User ist offline
Link zur Antwort auf "Youtube Video per Formular ausgeben" von piXo piXo, am Sonntag den 09.10.2011 um 12:11:12

Und tut mir leid das ich nerve, bin nicht so der PHP Profi - hoffe ihr könnt mir helfen!


Findom
Beiträge: 521

PN schreiben
Profil ansehen
User ist offline
Link zur Antwort auf "Youtube Video per Formular ausgeben" von Findom Findom, am Sonntag den 09.10.2011 um 12:38:23

Musst uns schon bissl Code zeigen und einigermassen eingrenzen, wo die Probleme sind.


piXo
Beiträge: 23

PN schreiben
Profil ansehen
User ist offline
Link zur Antwort auf "Youtube Video per Formular ausgeben" von piXo piXo, am Sonntag den 09.10.2011 um 12:44:29

Entschuldigung - du hast natürlich recht! Es ist ein fertiges Script was ich im Internet gefunden habe ...

www.test.pixodesign.de/finale

config.php

 
PHP
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
/* ######################## DATABASE ######################## */

  // Database server
  $db_server = "localhost";
  
  // Database name
  $db_name = "...";
  
  // Database username
  $db_user = "...";

  // Database password
  $db_password = "...";
  
  // Database table to store image information
  // (will be created automatically)
  $db_table_pictures = "image_voting_pictures";
  
  // Database table to store the comments
  // (will be created automatically)
  $db_table_comments = "image_voting_comments";

/* ##################### CONFIGURATION ###################### */

  // Complete URL of the script
  // (begins with http://, ends with slash)
  $url = "http://test.pixodesign.de/umfrage_03/";
  
  // Relative path to the images folder
  // (folder where the images are stored).
  // Must be empty (then images are stored in the same folder
  // where the script is running) or relative with an ending
  // slash.
  //
  // Example 1 (Windows):
  //   Script folder: C:\apache\htdocs\site\php\image_voting\
  //   Images folder: C:\apache\htdocs\site\img\upload\
  //   --> $img = "../../img/upload/";
  //
  // Example 2 (Unix):
  //   Script folder: /var/www/html/site/php/image_voting/
  //   Images folder: /var/www/html/site/img/upload/
  //   --> $img = "../../img/upload/";
  //
  // The images folder must be writable!
  // (Windows: adjust security, Unix: chmod 777)
  $img = "images/";

  // Maximum length of comments (maximum 255)
  $comment_size = 255;
  
  // Maximum points for voting
  $max_points = 10;
  
  // Minimum votes for pictures to appear in toplist
  $min_votes = 1;

  // Maximum image width
  $img_width = 640;
  
  // Maximum image height
  $img_height = 480;
  
  // Image format
  // 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF
  $img_format = 2;

  // Maximum file size of images
  // 102400 = 100KB
  $img_size = 102400;

  // Email-address of administrator
  // (will be informed on new pictures
  $webmaster = "jens.reinemer@pixodesign.de";
  
  // Administration password
  $password = "admin";
  
  // Number of images to be shown on the administration page
  $admin_show = 10;

  // Title (will be displayed in the browser's header
  $title  = "Image voting";

/* ######################### LAYOUT ######################### */

  // Header to be used on each page
  $header = <<<EOT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="style.css" rel="stylesheet" type="text/css">
    <title>$title</title>
  </head>
  <body>
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="$img_width">
      <tr>
        <td align="center" colspan="2">
          <a href="index.php">Vote!</a> |
          <a href="toplist.php">Toplist</a> |
          <a href="create_new.php">Upload image</a> |
          <a href="admin.php">Administration</a>
      <hr>
        </td>
      </tr>
      <tr>
        <td align="center" colspan="2">
EOT;

  // Footer to be used on each page
  $footer = <<<EOT
        </td>
      </tr>
    </table>
  </body>
</html>
EOT;

  // Login form
  $login = <<<EOT
          <form action="admin.php" method="get">
            Password: <input name="pw" type="password"> <input type="submit" value="Login">
          </form>
EOT;

/* ############# SCRIPT (EDIT AT YOUR OWN RISK) ############# */
  switch($img_format){
    case 1:
      $img_format_info = ".gif";
      break;
    case 2:
      $img_format_info = ".jpg";
      break;
    case 3:
      $img_format_info = ".png";
      break;
    case 4:
      $img_format_info = ".swf";
      break;
  }
?>
 
PHP
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/* ########################## INFO ##########################

                          Image voting
                          Version 1.0

         Free script from WB - Webdesign for beginners.
          Visit http://plohni.com/wb for more scripts.
               Feel free to modify this script.
                              lgp

/* ########################## INFO ########################## */
/* ###################### INSTALLATION ###################### */

   // a) Adjust the configuration variables in config.php to
   //    your needs
   // b) Copy the PHP files to your server using ASCII mode
   // c) Make the image folder writable (Windows: adjust
   //    security, Unix: chmod 777)
   // d) Call install.php in your webbrowser

/* ###################### INSTALLATION ###################### */
/* ############# SCRIPT (EDIT AT YOUR OWN RISK) ############# */

  //load configuration
  require("config.php");
  
  //connect to database
  @mysql_connect($db_server,$db_user,$db_password) or die("Database server connection failed. Check variables \$db_server, \$db_user and \$db_password in config.php");
  @mysql_select_db($db_name) or die("Selecting database failed. Check variable \$db_name in config.php");
  
  //error switch
  $error = false;

  //create table for image information
  if(@mysql_query("CREATE TABLE $db_table_pictures (id INT UNSIGNED NOT NULL PRIMARY KEY,creator VARCHAR(50) NOT NULL,comment VARCHAR(255) NOT NULL,points INT UNSIGNED NOT NULL,votes INT UNSIGNED NOT NULL);") && @mysql_query("INSERT INTO $db_table_pictures VALUES(1,'charge','charge',0,0);")){
    ?><p>Table <?php echo $db_table_pictures; ?> created successfully.</p><?php
  }else{
    ?><p>Could not create table <?php echo $db_table_pictures; ?>: <?php echo @mysql_error(); ?></p><?php
    $error = true;
  }

  //create table for comments
  if(@mysql_query("CREATE TABLE $db_table_comments (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,id_pic INT UNSIGNED NOT NULL,name VARCHAR(50) NOT NULL,text VARCHAR(255) NOT NULL,date INT UNSIGNED NOT NULL);")){
    ?><p>Table <?php echo $db_table_comments; ?> created successfully.</p><?php
  }else{
    ?><p>Could not create table <?php echo $db_table_comments; ?>: <?php echo @mysql_error(); ?></p><?php
    $error = true;
  }

  //drop tables if error occurred
  if($error){
    @mysql_query("DROP TABLE $db_table_pictures;");
    @mysql_query("DROP TABLE $db_table_comments;");
    ?><p>Could not create all required tables. Existing tables have been deleted. Please check the configuration in config.php and call install.php again.</p><?php
  //successful
  }else{
    ?><p>All tables have been created successfully. To avoid unexpected trouble please remove this file. You need to upload at least one picture. <a href="create_new.php">Click here to continue.</a></p><?php
  }

  //close database connection
  @mysql_close();
?>

index.php

 
PHP
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
  //load configuration
  require("config.php");
  
  //connect to database
  @mysql_connect($db_server,$db_user,$db_password) or die("Database server connection failed. Check variables \$db_server, \$db_user and \$db_password in config.php");
  @mysql_select_db($db_name) or die("Selecting database failed. Check variable \$db_name in config.php");

  //update votes
  $id = $_POST["id"];
  $vote = $_POST["vote"];
  
  if(isset($id) && isset($vote)){
    @mysql_query("UPDATE $db_table_pictures SET points=points+$vote,votes=votes+1 WHERE id=$id;");
  }

  //store comment
  $comment_name = $_POST["comment_name"];
  $comment_text = $_POST["comment_text"];
  
  if(isset($comment_name) && isset($comment_text) && strlen($comment_name)>2 && strlen($comment_text)>2){
    $comment_name = str_replace("<","&lt;",$comment_name);
    $comment_name = str_replace(">","&gt;",$comment_name);
    $comment_name = stripslashes($comment_name);

    $comment_text = str_replace("<","&lt;",$comment_text);
    $comment_text = str_replace(">","&gt;",$comment_text);
    $comment_text = stripslashes($comment_text);

    @mysql_query("INSERT INTO $db_table_comments (id_pic,name,text,date) VALUES({$_POST["show"]},'$comment_name','$comment_text',".time().");");
  }

  //image to be displayed
  if(!isset($_GET["show"]) && !isset($_POST["show"])){
    //random image
    $ids = array();
    $result = @mysql_query("SELECT id FROM $db_table_pictures;");
    list($min) = @mysql_fetch_row(@mysql_query("SELECT id FROM $db_table_pictures WHERE id>1 ORDER BY id ASC;"));
    list($max) = @mysql_fetch_row(@mysql_query("SELECT id FROM $db_table_pictures WHERE id>1 ORDER BY id DESC;"));
    
    while(list($ids[]) = @mysql_fetch_row($result));
    
    while(true){
      srand((double)microtime()*1000000);
      
      $show = rand($min,$max);
      
      if(array_search($show,$ids)){
        break;
      }
    }
  }else{
    //specific image
    $show = isset($_GET["show"]) ? $_GET["show"] : $_POST["show"];
  }

  $row = @mysql_fetch_array(@mysql_query("SELECT * FROM $db_table_pictures WHERE id=$show;"));
  list($next) = @mysql_fetch_row(@mysql_query("SELECT id FROM $db_table_pictures WHERE id>$show ORDER BY id ASC LIMIT 0,1;"));

  //calculate points
  if($row["points"] != 0){
    $row["points"] = number_format($row["points"]/$row["votes"],2,".","");
  }

  //next image
  if(!$next){
    list($next) = @mysql_fetch_row(@mysql_query("SELECT id FROM $db_table_pictures WHERE id>1 ORDER BY id ASC LIMIT 0,1;"));
  }
  
  //print header
  echo $header;
  
  //print html
          ?><form action="index.php" method="post">
            <table align="center" border="0" cellpadding="2" cellspacing="0">
              <tr>
                <td rowspan="2">schlecht</td>
                <td rowspan="2" width="10">&nbsp;</td><?php

  //voting form
  for($i=1;$i<=$max_points;$i++){
                ?><td align="center"><?php echo $i; ?></td><?php
  }

                ?><td rowspan="2" width="10">&nbsp;</td>
                <td rowspan="2">sehr gut</td>
              </tr>
              <tr><?php

  for($i=1;$i<=$max_points;$i++){
                ?><td align="center"><input type="radio" name="vote" value="<?php echo $i; ?>" onclick="submit();"></td><?php
  }

              ?></tr>
            </table>
            <input name="show" type="hidden" value="<?php echo $next; ?>">
            <input name="id" type="hidden" value="<?php echo $row["id"]; ?>">
          </form>
        </td>
      </tr>
      <tr>
        <td colspan="2" height="8">&nbsp;</td>
      </tr>
      <tr>
        <td align="center" colspan="2" height="<?php echo $img_height; ?>"><img alt="" border="0" src="<?php echo $img.$show.$img_format_info; ?>"></td>
      </tr>
      <tr>
        <td colspan="2" height="10">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top" width="50%">Hochgeladen von <b><?php echo $row["creator"]; ?></b><br><br><?php echo $row["comment"]; ?><br><br></td>
        <td align="right" valign="top" width="50%">Punkte: <b><?php echo $row["points"]; ?></b> (<?php echo $row["votes"]; ?> Stimmen)<br><br></td>
      </tr>
      <td colspan="2">
        <hr><?php

  $result = @mysql_query("SELECT * FROM $db_table_comments WHERE id_pic={$row["id"]} ORDER BY date DESC;");

  if(@mysql_num_rows($result) == 0){
    ?>Kein Kommentar<?php
  }else{
    while($row = @mysql_fetch_array($result)){
        ?><b><?php echo $row["name"]; ?></b> schreibt sein Kommentar am  <?php echo date("d/m/Y",$row["date"]); ?> um <?php echo date("h:i a",$row["date"]); ?>:<br>
        <?php echo $row["text"]; ?>
        <br><br><?php
    }
  }

        ?><hr>
        <b>Schreibe ein Kommentar:</b>
        <form action="index.php" method="post">
          <table align="center" border="0" cellpadding="5" cellspacing="0">
            <tr>
              <td>Vor- und Nachname:</td>
              <td><input maxlength="50" name="comment_name" size="30" type="text"></td>
            </tr>
            <tr>
              <td valign="top">Kommentar:</td>
              <td><textarea cols="70" name="comment_text" onkeyup="this.value=this.value.slice(0,<?php echo $comment_size; ?>);" rows="6"></textarea></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><input type="submit" value="Abschicken"></td>
            </tr>
          </table>
          <input name="show" type="hidden" value="<?php echo $show; ?>">
        </form><?php
  
  //print footer
  echo $footer;

  //close database connection
  @mysql_close();
?>

creat_new.php:

 
PHP
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?php
  //load configuration
  require("config.php");
  
  //connect to database
  @mysql_connect($db_server,$db_user,$db_password) or die("Database server connection failed. Check variables \$db_server, \$db_user and \$db_password in config.php");
  @mysql_select_db($db_name) or die("Selecting database failed. Check variable \$db_name in config.php");
  
  //print header
  echo $header;
  
  //print html
        ?><form action="create_new.php" enctype="multipart/form-data" method="post">
            <table border="0" cellpadding="0" cellspacing="15" width="<?php echo $img_width; ?>">
              <tr>
                <td colspan="2"><?php

  //upload image (form submitted)
  if(isset($_POST["submit"])){
    $file = $_FILES["file"];
    $name = $_POST["name"];
    $email = $_POST["email"];
    $comment = $_POST["comment"];
    $error = false;
    $error_file = false;

    //check name
    if(strlen($name) < 3){
      $name = "<b>At least three characters.</b>";
      $error = true;
    }

    //check email
    if($email && !ereg('^[-^!#$%&\'*+\/=?`{|}~._a-z0-9]+@([-a-z0-9]+(\.[-a-z0-9]+)*\.[-a-z0-9]{2,6}|\[[0-9]{1,3}(\.[0-9]{1,3}){3}\])$',$email)){
      $email = "<b>Must be valid.</b>";
      $error = true;
    }

    //check file
    if($file == ""){
      $file = "<b>No file chosen.</b>";
      $error_file = true;
      $error = true;
    }

    //check comment
    if(strlen($comment) < 3){
      $comment = "<b>At least three characters.</b>";
      $error = true;
    }

    //file uploaded
    if(!$error_file){
      $file_info = getimagesize($file["tmp_name"]);
      $file_size = filesize($file["tmp_name"]);

      //check image width
      if($file_info[0] > $img_width){
        $message_width = "<b>{$file_info[0]} - image is ".($file_info[0] - $img_width)." pixels too broad.</b>";
        $error = true;
      }else{
        $message_width = $file_info[0]." pixels - ok";
      }

      //check image height
      if($file_info[1] > $img_height){
        $message_height = "<b>{$file_info[1]} - image is ".($file_info[1] - $img_height)." pixels too high.</b>";
        $error = true;
      }else{
        $message_height = $file_info[1]." pixels - ok";
      }

      //check image format
      if($file_info[2] != $img_format){
        $message_type = "<b>Image format must be $img_format_info.</b>";
        $error = true;
      }else{
        $message_type = $img_format_info." - ok";
      }

      //check image size
      if($file_size > $img_size){
        $message_size = "<b>".number_format($file_size/1024,0,",","")." - filesize is ".number_format(($file_size - $img_size) / 1024,0,",","")."KB too large.</b>";
        $error = true;
      }else{
        $message_size = number_format($file_size/1024,0,",","")."KB - ok";
      }
    }

                ?>&nbsp;
                </td>
              </tr>
              <tr>
                <td>Name:</td>
                <td><?php echo $name; ?></td>
              </tr>
              <tr>
                <td>Email address:</td>
                <td><?php echo $email; ?></td>
              </tr>
              <tr>
                <td>Image:</td><?php

    //no error with image
    if(!$error_file){
                ?><td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;&nbsp;&nbsp;- Width:</td>
                <td><?php echo $message_width; ?></td>
              </tr>
              <tr>
                <td>&nbsp;&nbsp;&nbsp;- Height:</td>
                <td><?php echo $message_height; ?></td>
              </tr>
              <tr>
                <td>&nbsp;&nbsp;&nbsp;- Type:</td>
                <td><?php echo $message_type; ?></td>
              </tr>
              <tr>
                <td>&nbsp;&nbsp;&nbsp;- Size:</td>
                <td><?php echo $message_size; ?></td>
              </tr><?php
    //error with image
    }else{
                ?><td><?php echo $file["name"]; ?></td>
              </tr><?php
    }

              ?><tr>
                <td>Comment:</td>
                <td><?php echo $comment; ?></td>
              </tr><?php

    //error message
    $error_goback = <<<EOT
              <tr>
                <td align="center" colspan="2">
                  <br><br>
                  <b>Your image could not be uploaded. Please click <a href="javascript:history.back();">hier</a> to return to the upload form.</b>
                </td>
              </tr>
EOT;

    //error occurred
    if($error){
      echo $error_goback;
    //store image
    }else{
      //get next id
      $row = @mysql_fetch_array(@mysql_query("SELECT id FROM $db_table_pictures ORDER BY id DESC LIMIT 0,1;"));
      $id = $row["id"] + 1;

      //copy image
      if(!(@copy($file["tmp_name"],$img.$id.$img_format_info))){
        echo $error_goback;
      }else{
        //insert into database
        @mysql_query("INSERT INTO $db_table_pictures VALUES('$id','$name','$comment',0,0);");
    
        //send mail to user
        @mail($email,"Thank you for uploading your image at $title!","Your image has been uploaded successfully at $title!\n\nView image: {$url}index.php?show=$id\nView toplist: {$url}toplist.php\nVote for images: {$url}\nUpload another image: {$url}create_new.php","From: $webmaster <$webmaster>\n");
    
        //send mail to administrator
        @mail($webmaster,"New image at $title","A new image has been uploaded at $title.\n\nName: $name\nEmail:    $email\nComment: $comment\n\nView image: {$url}index.php?show=$id\nView toplist: {$url}toplist.php\nVote for images: {$url}\nUpload an image: {$url}create_new.php","From: $name <$email>\n");

              ?><tr>
                <td align="center" colspan="2">
                  <br><br>
                  <b>Your image has been uploaded successfully! <a href="index.php?show=<?php echo $id; ?>">Click here to continue.</a></b>
                </td>
              </tr><?php
      }
    }

            ?></table>
          </form><?php

  //print upload form
  }else{
                  ?>Upload your own picture and let others vote for it.
                  <br><br>
                </td>
              </tr>
              <tr>
                <td>Your name:</td>
                <td><input maxlength="50" name="name" size="30" type="text"></td>
              </tr>
              <tr>
                <td>Your email address:</td>
                <td><input name="email" size="30" type="text"></td>
              </tr>
              <tr>
                <td>Choose file:</td>
                <td><input name="file" size="30" type="file"></td>
              </tr>
              <tr>
                <td valign="top">Comment:<br>(max. <?php echo $comment_size; ?> characters)</td>
                <td><textarea cols="70" name="comment" onkeyup="this.value=this.value.slice(0,<?php echo $comment_size; ?>);" rows="6"></textarea></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><input name="submit" type="submit" value="Upload image"></td>
              </tr>
            </table>
          </form><?php
  }
  
  //print footer
  echo $footer;

  //close database connection
  @mysql_close();
?>


Findom
Beiträge: 521

PN schreiben
Profil ansehen
User ist offline
Link zur Antwort auf "Youtube Video per Formular ausgeben" von Findom Findom, am Sonntag den 09.10.2011 um 20:49:45

http://www.test.pixodesign.de/finale/index.php?show=1

Da ist ja noch garnix drin, deshalb läuft sich die Schleife ab Zeile 43 in der index.php tot und das Script bricht ab.

Stell was ein und kämpfe dann weiter.