Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:22:59+00:00 2026-06-15T10:22:59+00:00

I created images slider in clear php and it was worked . but when

  • 0

I created images slider in clear php and it was worked . but when I changed it under Yii image not loaded because :
– java script block not load image numbers .
– I don’t know how I can load javascript block with change variables in yii like php

File :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
  <title>jquery sliders</title>
  <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
  <script type="text/javascript">var _siteRoot='index.html',_root='index.php';</script>
  <script type="text/javascript" src="js/jquery.js"></script>
  <script type="text/javascript" src="js/scripts.js"></script>
  <script type="text/javascript" src="jquery-1.4.2.min.js"></script>

<script type="text/javascript" src="newscript.js"></script>
 </head>
 <body>

  <!--/top-->
  <div id="header"><div class="wrap">
   <div id="slide-holder">
<div id="slide-runner">
<?php
            include("samiloxide.php");
//if(!$_POST['page']) die("0");


$section=intval($_GET['section']);

$i=1;
$j=array();

$sql=mysql_query(" select * from images order by section ");



while($rr=mysql_fetch_array($sql)){
  echo    "<a href=''><img id='slide-img-$i' src='$rr[image]' class='slide' alt='' /></a>";
       $j[]=$i;

       $i=$i+1;





        }     
   ?>



    <div id="slide-controls">
     <p id="slide-client" class="text"><strong>post: </strong><span></span></p>
     <p id="slide-desc" class="text"></p>
     <p id="slide-nav"></p>


    </div>
</div>

    <!--content featured gallery here -->
   </div>
   <script type="text/javascript">
    if(!window.slider) var slider={

    };
     slider.data=[
    <?php 
  foreach($j as $value){    

echo  "   
  { 'id':'slide-img-$value',
    'client':'First one ',
    'desc':'nature beauty photography'},
   " ;
   }  
   ?>


   ];
   </script>
  </div></div><!--/header-->
 </body>
</html>

Just I need to change javascript :

<script type="text/javascript">
        if(!window.slider) var slider={

        };
         slider.data=[
        <?php 
      foreach($j as $value){    

    echo  "   
      { 'id':'slide-img-$value',
        'client':'Some text  ',
        'desc':'image description '},
       " ;
       }  
       ?>


       ];
       </script>

To work under Yii ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:23:00+00:00Added an answer on June 15, 2026 at 10:23 am

    Try this,

    echo '<a href="#"><img id="slide-img-', $i, '" src="', $rr['image'], '" class="slide" alt="" /></a>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a function for splitting an image into multiple images, but when I
I have created jquery image slider and it is working good. However i have
So say I've got a series of images created with a php loop ->
I have created this slider using motiongallery.js (CMotion Image Gallery) from Dynamic Drive. I'm
I have created an image slider. This slider appears on every page of my
I've created a responsive image slider using jQuery cycle . The following setup I
I created a slider But I am going some where wrong in my logic.
I've created a simple image rotator with javascript, but it's slow with older browsers
I have created a script that slides images. Each image is contained in a
I created an slider that slide all images of my wordpress articles, and if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.