Solved

rating product with ajax script 5star

Posted on 2014-04-29
4
911 Views
Last Modified: 2014-05-01
I am almost a New in php and also in programming, but I need to do some things in my web. I want to put ajax rating script with 5 stars in my website, but i dont know how to correctly put in my folders. I am using Codeignter and my web folder is calling "svetaine" .

Where i get code is here http://coursesweb.net/php-mysql/rating-stars-script-ajax-php_s2

My code php is looking like this:


    <h3>Mobilieji Telefonai</h3>
    <form method='get'>
    <?php
     //check if the starting row variable was passed in the URL or not
     if (!isset($_GET['startrow']) or !is_numeric($_GET['startrow'])) {
     //we give the value of the starting row to 0 because nothing was found in URL
     $startrow = 0;
     //otherwise we take the value from the URL
    } else {
    $startrow = (int)$_GET['startrow'];
    }
     //this part goes after the checking of the $_GET var
     $fetch = mysql_query("SELECT * FROM telefonai order by prioritetas LIMIT $startrow,  5")or
     die(mysql_error());
    $num=Mysql_num_rows($fetch);
        if($num>0)
        {
        echo "<table border=2  >";
        echo "<tr><td>Telefono pavadinimas</td><td>Nuotrauka<td>Kaina</td>   <td>Parduotuve</td><td>Nuoroda</td></tr>";
        for($i=0;$i<$num;$i++)
        {
        $row=mysql_fetch_row($fetch);
        echo "<tr>";
        echo"<td>$row[1]</td>";
		echo "<td>   <img src=\"{$row[5]}\"  width=75  height=75/>    </td>";
        echo"<td>$row[2] LT</td>";
		echo"<td>$row[3]</td>";
	    echo "<td><a href=\"{$row[4]}\"><img   src=\"".base_url()."images/parduotuve.png\" /></a></td>";
        echo"</tr>";
        }
        echo"</table>";
        }
    //now this is the link..
    echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.($startrow+10).'">Sekantis</a>';

    $prev = $startrow - 10;

    //only print a "Previous" link if a "Next" was clicked
     if ($prev >= 0)
    echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.$prev.'"> Buves</a>';
    ?>
    </form>
    </body>
    </html>

Open in new window


Have product database, and need that product should have rating and rating_counts. I Think this script can do this. So from where start to put script in my web folders?
0
Comment
Question by:Nekasas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 40029824
If you're new to PHP and want to get a foundation in how web applications work, you may find this article helpful.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html

The design for a voting and star rating system is shown in this article:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/A_5256-Simple-Vote-Counting-in-PHP-and-MySQL.html
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 40034264
@Nekasas: Please explain why you gave a marked-down grade without comment or any followup questions.  We don't do something like that at EE without giving our colleagues an explanation.

For your reference you may find the Grading Guidelines here:
http://support.experts-exchange.com/customer/portal/articles/481419

Looking forward to hearing from you. ~Ray
0
 

Author Comment

by:Nekasas
ID: 40034287
I am sorry if I offend you. Maybe then I want more than just link's, but I realized no one can do my jobs except me, so I will just keep doing my job and in another question I will be more friendly
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 40034290
I'm not offended -- I just want to understand if my answers were deficient, what was expected?  Work in an online forum like EE often requires a little more conversation!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question