drblhw5731 2018-04-19 06:16
浏览 49
已采纳

如何使用codeigniter生成具有相同代码的HTML文件并将其保存到特定文件夹中

I want to generate a html file in codeigniter with same ready code as below: and save it into folder and save the file path into db to echo this file path with an anchor tag.

For Example: I have multiple services Card with short info on homepage page, and every services are anchored (linked) with HTML Detail page of each services. e.g. 1st Service linked with services1.html file and 2nd Service linked with Services2.html and so on. When user click on services button the specific service page open within same homepage using javascript/ajax colorbox popup with out redirecting or changing page url. Now i want to generate services for homepage, from admin-side include its html detail file and image. how can i do this process please help how can perform this process in codeigniter. for more idea clearance you may check the team section of below template link:

http://revolution2.boston.wp.themeforest.createit.pl

HTML file Ready Code

<div class="container">
<div class="row text-center">
    <h2>Heading <span class="color-font light">Here</span></h2>
    <h3>CEO</h3>
</div>
<div class="row">
    <div class="col-md-6 col-sm-6">
        <div class="person-image">
            <img src="images/t1.jpeg" alt="">
        </div>
    </div>
    <div class="col-md-6 col-sm-6">
        <h3>About Me</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Proin nibh augue, suscipit a, scelerisque sed, lacinia in, mi. Cras vel lorem. Etiam pellentesque aliquet tellus. Phasellus pharetra nulla ac diam. Quisque semper justo at risus. Donec venenatis, turpis vel hendrerit interdum, dui ligula ultricies purus, sed posuere libero dui id orci. Nam congue, pede vitae dapibus aliquet.</p>            
        <h3>Certifications</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Proin nibh augue, suscipit a, scelerisque sed, lacinia in, mi. Cras vel lorem. Etiam pellentesque aliquet tellus. Phasellus pharetra nulla ac diam. Quisque semper justo at risus. Donec venenatis, turpis vel hendrerit interdum, dui ligula ultricies purus, sed posuere libero dui id orci. Nam congue, pede vitae dapibus aliquet.</p>

        <h3>Socialise with me</h3>
        <ul class="social-links">
            <li><a class="fa fa-facebook fa-4x" href="#" onMouseOver="this.style.color = '#3B5998'" onMouseOut=" this.style.color='#ffffff' "></a></li>
            <li><a class="fa fa-twitter fa-4x" href="#" onMouseOver="this.style.color = '#33CCFF'" onMouseOut=" this.style.color='#ffffff' "></a></li>
            <li><a class="fa fa-instagram fa-4x" href="#" onMouseOver="this.style.color = '#DA3073'" onMouseOut=" this.style.color='#ffffff' "></a></li>
            <li><a class="fa fa-google-plus fa-4x" href="#" onMouseOver="this.style.color = '#dd4b39'" onMouseOut=" this.style.color='#ffffff' "></a></li>
        </ul>

    </div>
</div>

  • 写回答

1条回答 默认 最新

  • duanbiyi7319 2018-04-20 10:37
    关注

    There are two ways to do that:

    1. Using PHP copy() function

    2. Using file_get_contents() and file_put_contents()

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址
  • ¥15 elmos524.33 eeprom的读写问题
  • ¥15 使用Java milo连接Kepserver服务端报错?
  • ¥15 用ADS设计一款的射频功率放大器
  • ¥15 怎么求交点连线的理论解?
  • ¥20 软件开发方法学习来了
  • ¥15 微信小程序商城如何实现多商户收款 平台分润抽成