PHP задача фото галерея
От: MrGreen  
Дата: 27.08.09 05:45
Оценка:
Добры день

вот задача снизу
Я просто не совсем пойму как при нажатие на текст, получить обновления картинки (загрузка новой) то есть, меня не должно кинуть на другую страницу, а надо обновить уже загруженную при этом, перегрузить с сервера картинку. другими словами мне не понятно как грузить картинки, с оформлением проблем нету а вот с загрузкой новых картинок совсем плохо.
Также я понимаю что надо как то передавать информацию о том какая картинка загружена сейчас

To complete this stage you need to modify the files (main1.php, style1.css, definitions1.php) so that the user can browse through the entire collection of images by clicking on NEXT/PREVIOUS links. When the application starts the first image P71.JPG is displayed. Clicking on NEXT will display P72.JPG and clicking again, P73.JPG, and so on. The last one to be displayed is P76.JPG. (Other images are not needed for this stage.) Note that the NEXT link should not be displayed when the last image (here P76.JPG) is on display. Similarly, when the very first image is displayed PREVIOUS link should not be provided.

Some images will have descriptions provided in assign1_data/txt. Note that the file name matches the image name. If the description is there it should be used as caption otherwise the caption should read "No description".

main1.php must effectively use each of the three variables set in definitions1.php. Modify paths as needed.

Modify style so that the display looks like this picture shows. You may modify the provided style1.css and/or use some internal/inline style, if convenient.

вот 3 файла
//  main.php

<?php
require("definitions1.php");

$id = 71;

$last = 76;
$first = 71;

$file = "../../assign1_data_stage1/jpg/P71.JPG";

$caption = "No description";

echo "<html><head>";
echo "<title>Flowers Gallery</title>";
echo "</head><body>";
echo "<h1>Spring Flowers Gallery</h1>";
echo "<p><img src=\"$file\"></p>";
echo "</body></html>";

?>



// definition.php
<?php 
  $jpgdir = "ass1_data_stag1/jpg/";
  $descdir ="ass1_data_stage1/txt/";   
  $self = $_SERVER['PHP_SELF'];
?>


//  style.css
html {
    font-family: serif; 
    font-style: normal; 
    font-variant: normal; 
}


на данном этапе должно выгледить так сверху картика снизу под ней NEXT/PREVIOUS но на примере слова не вызлядят как гипер текст тоесть подчеркнутые, выглядят как простой текст
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.