Author Topic: Làm sao để hiển thị hình ảnh trong localhost khi copy từ live website?  (Read 3109 times)

henry14

  • PHP Starter
  • *
  • Posts: 4
    • View Profile
    • Email
Cho mình hỏi làm sao hiển thị đc hình ảnh ở  như là ở   đc :(?
Đây là live website của mình


Còn đây là local website sau khi mình transfer to localhost


Sau khi transfer to localhost xong(mình dùng Xampp) thì local web của mình run ok,ngoại trừ tất cả hình ảnh là không hiển thị đc.

Đây là source của live website


Đây là source của local website


Mình ko biết sao khi transfer to local web, the image link lại change
from :
<div class="product_image_div">
<img src="http://www.vplussupermarket.com/media/images/product/thumbnails/1256-1.jpg">
</div><div class="brand_name">&nbsp;</div><div class="product_name">Casserole Chuck Steak</div><br>

to:


<div class="product_listing" id="product1256"><div id="product_details1256">
<img src="http://localhost/vplussup/public_html/media/images/main/no_image.jpg
"><div class="brand_name">&nbsp;</div><div class="product_name">Casserole Chuck Steak</div><b>
« Last Edit: July 28, 2011, 07:09:43 PM by henry14 »

tpphu

  • PHP Intermediate
  • *
  • Posts: 192
  • Trần Phong Phú
    • MSN Messenger - tpphu@yahoo.com
    • Yahoo Instant Messenger - tpphu
    • View Profile
    • Email
Chào bạn,
Muốn được giúp bạn cần làm rõ một số ý sau:
1. "live website" là gì vậy?
2. Bạn copy là copy source code (thông qua FPT chẳng hạn) đúng không?
--------------
Anyway,
Muốn biết vì sao nó thay đổi link, thì cần mở cái source code ra xem nó làm thế nào?
Chứ view html lên sao mà nói được.
Thân,

henry14

  • PHP Starter
  • *
  • Posts: 4
    • View Profile
    • Email
Thanks bạn đã reply.
Live website là website mình up lên hosting đó bạn, nó giống như trang vnexpress.net vậy đó. Vì mình muốn update và testing nó nên mình đã xài Xampp để làm nó thành local website để tiện việc testing. Đây là lần đầu mình làm việc này nên mình ko rõ có thiếu sót bước nào ko. Khi mình down về thì minh đã vô application folder để edit lại config.php file và database.php file(mình thay đổi document root, username,password,database name để website chỉ đến localhost chứ không chỉ đến live website nữa). Mình dùng ftp để down source về.Cấu trúc của nó như sau:
/home/vplussup
               Application
                              admin
                                     config
                                            config.php
                                            database.php
                                     controller
                                     library
                                     models
                                     view
                              public
                                      config
                                            config.php
                                            database.php
                                     controller
                                     library
                                     models
                                     view
                                     
               Modules
               Public_html
                             admin
                                     media
                                             image
                                             css
                                             js
                                             scripts
                                     index.php
                             media
                                             image
                                             css
                                             js
                                             scripts
                             scripts
                             .htaccess
                             index.php
                             
               System
                        config
                                  captcha.php
                                  database.php
                                  image.php
                                  cookies.php
                                  routes.php
                                  view.php
                        core
                                   Benchmark.php
                                   Bootstrap.php
                                   Event.php
                                   Kohana.php
                                   utf8.php
                        controller
                                     captcha.php
                                     template_store.php
                                     template_admin.php
                        library
                                drivers
                                         Image
                                                  GD.php
                                                  GraphicsMagick.php
                                                   ImageMagick.php
                                         Database
                                                    Mssql.php
                                                    Mysql.php
                                                    Mysqli.php
                                                    Pdosqlite.php
                                                    Pgsql.php
                                         Captcha.php
                                         Database.php
                                         Image.php
                                         Session.php

                                Captcha.php
                                Controller.php
                                Database.php
                                Image.php
                                Model.php
                                ORM.php
                                ORM_Iterator.php
                                ORM_Tree.php
                                ORM_Versioned.php
                                Pagination.php
                                Router.php
                                Session.php
                                URI.php
                                Validation.php
                                View.php
                               
                        view
                             kohana
                                       template.php
                             pagniation
                             kohana_error_page.php
                             kohana_error.php
                             kohana_profiler.php
                             kohana_profiler_table.php
Bạn thấy cần code của file nào thì mình post lên, chứ nhiều file quá mình post ko hết.
Thanks again!


tpphu

  • PHP Intermediate
  • *
  • Posts: 192
  • Trần Phong Phú
    • MSN Messenger - tpphu@yahoo.com
    • Yahoo Instant Messenger - tpphu
    • View Profile
    • Email
À, mình hiểu rồi, cái source này xài Kohana, nhìn vào cái thông tin bạn đưa
-----------------------------------------------------------------------
Mình ko biết sao khi transfer to local web, the image link lại change
from :
<div class="product_image_div">
<img src="http://www.vplussupermarket.com/media/images/product/thumbnails/1256-1.jpg"></div><div class="brand_name">&nbsp;</div><div class="product_name">Casserole Chuck Steak</div><br>

to:


<div class="product_listing" id="product1256"><div id="product_details1256">
<img src="http://localhost/vplussup/public_html/media/images/main/no_image.jpg
"><div class="brand_name">&nbsp;</div><div class="product_name">Casserole Chuck Steak</div><b>
---------------------------------------------------------------------------
Cái này:
http://localhost/vplussup/public_html/media/images/main/no_image.jpg.
Cái link này không tồn tại:
Mình nghĩ vậy.
Cho nên bạn vào source code để chỉnh lại cái url chỗ đó cho phù hợp thôi.
« Last Edit: July 30, 2011, 09:52:58 AM by tpphu »