ich hab mich mal wieder an was rangwagt wo ich absolut keine Ahnung von habe, soviel gleich vorweg, also bitte nicht erschlagen!
Ich möchte auf Basis von phpFlickr ein Photoblog erstellen das automatisch meine aktuellsten Bilder von Flcikr abholt und diese darstellt.
Eigentlich bin ich schon erstaunt das dies soweit finktioniert, jedoch gibt es ein paar Fehler die ich alleine nicht so schnell lösen kann.
Schaut euch das ganze doch bitte unter folgender Adresse an und gebt als Usernamen jwildefeld ein, dann kommen meine Bilder:
http://photofeld.janwildefeld.de/
Meine Probleme:
1. Es wird folgende Warnmeldung ausgegeben:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/u0025194115/public_html/photofeld/index.php:7) in /home/u0025194115/public_html/photofeld/phpFlickr.php on line 18
ich weiß das es damit zu tun hat das ich vor dem php Code bereits html (den #header DIV) erzeuge. Wie kann ich das denn anders lösen!? Ich weiß nciht wie das in php geht!
2. Ich muss im Moment immer noch meinen Usernamen in dem Formular eingeben...möchte aber das das Formular komplett weg ist und ich meinen Usernamen nur einmal im php Code angeben muss.
Hier der Code:
Alles anzeigen
Ich möchte auf Basis von phpFlickr ein Photoblog erstellen das automatisch meine aktuellsten Bilder von Flcikr abholt und diese darstellt.
Eigentlich bin ich schon erstaunt das dies soweit finktioniert, jedoch gibt es ein paar Fehler die ich alleine nicht so schnell lösen kann.
Schaut euch das ganze doch bitte unter folgender Adresse an und gebt als Usernamen jwildefeld ein, dann kommen meine Bilder:
http://photofeld.janwildefeld.de/
Meine Probleme:
1. Es wird folgende Warnmeldung ausgegeben:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/u0025194115/public_html/photofeld/index.php:7) in /home/u0025194115/public_html/photofeld/phpFlickr.php on line 18
ich weiß das es damit zu tun hat das ich vor dem php Code bereits html (den #header DIV) erzeuge. Wie kann ich das denn anders lösen!? Ich weiß nciht wie das in php geht!
2. Ich muss im Moment immer noch meinen Usernamen in dem Formular eingeben...möchte aber das das Formular komplett weg ist und ich meinen Usernamen nur einmal im php Code angeben muss.
Hier der Code:
Quellcode
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
- <head>
- <title>Photofeld - Jan Wildefelds Photoblog</title>
- <link rel="stylesheet" href="photofeld.css" type="text/css" media="screen,projection" />
- <!--[if lte IE 6]>
- <style type="text/css" media="screen, tv, projection">
- body { behavior: url(assets/js/csshover.htc); } /* hover:anything support */
- /* Add any IE-specific styling here */
- </style>
- <![endif]-->
- </head>
- <body>
- <div id="header"></div>
- <?php
- require_once("phpFlickr.php");
- $f = new phpFlickr("flickr id");
- if (!empty($_POST['username'])) {
- // Find the NSID of the username inputted via the form
- $person = $f->people_findByUsername($_POST['username']);
- // Get the friendly URL of the user's photos
- $photos_url = $f->urls_getUserPhotos($person['id']);
- // Get the user's first 36 public photos
- $photos = $f->people_getPublicPhotos($person['id'], NULL, 10);
- // Loop through the photos and output the html
- foreach ($photos['photo'] as $photo) {
- echo "<div id=\"outerdiv\">\n";
- echo "<div id=\"photodiv\">\n";
- echo "<a href=$photos_url$photo[id]>";
- echo "<img border='0' alt='$photo[title]' ".
- "src=" . $f->buildPhotoURL($photo, "Medium") . ">";
- echo "</a>";
- echo "</div>\n";
- echo "</div>\n";
- $i++;
- // If it reaches the sixth photo, insert a line break
- if ($i % 1 == 0) {
- echo "<br>\n";
- }
- }
- }
- ?>
- <h3>Enter a username to search for</h3>
- <form method='post'>
- <input name='username'><br>
- <input type='submit' value='Display Photos'>
- </form>
- </body>
- </html>