Posts

reddit style voting in php mysql jquery

Image
This tutorial will show you how to create such a voting system with jQuery, PHP and MySQL. I created a table called entries where there are 5 columns: id — The unique id associated with each entry title — The title of the entry to be shown as a link to the site votes_up — The total number of people who voted up. votes_down — The total number of people who voted down. Fetch The Data Now, we have the table and the data. Let's show the data. We create a config.php file that holds all our database credentials. <? $hostname = "localhost"; $db_username = "your_username"; $db_password = "your_password"; $db_password = "your_database"; $link = mysql_connect($hostname, $db_username, $db_password) or die("Cannot connect to the database"); mysql_select_db($db_password) or die("Cannot select the database"); ?> What we did is just connect to the database. Do replace your_username, your_password and your_datab...

twitter style update message display script

Hello Friends Here is the script to display confirmation or error message in twitter style.  You just need to write the message in   <div id="alert"> ...............</div> whatever you want . After that add the javascript code written below. <style type="text/css"> body { background-color: #ccc; color: #000; } #alert { overflow: hidden; width: 1260px; text-align: center; position: absolute; top: 0; left: 0; background-color: #fff; height: 0; color: #000; font: 20px/40px arial, sans-serif; opacity: .9; } </style> <div id="alert"> Thank you. Your message has been sent </div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $(function () { var $alert = $('#alert'); if($alert.length) { var alerttimer = window.setTimeout(function () { ...

What is Ajax

Image
AJAX = Asynchronous JavaScript and XML AJAX is not a new programming language, but a new technique for creating better, faster, and more interactive web applications. With AJAX, a JavaScript can communicate directly with the server, with the XMLHttpRequest object. With this object, a JavaScript can trade data with a web server, without reloading the page. AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages. The AJAX technique makes Internet applications smaller, faster and more user-friendly. AJAX is based on the following web standards: JavaScript XML HTML CSS   AJAX applications are browser- and platform-independent. AJAX uses the XMLHttpRequest object With AJAX, your JavaScript communicates directly with the server, through the JavaScript XMLHttpRequest object. By using the XMLHttpRequest object, a web developer can update a pa...

contactus form using jquery slideup and slidedown effect

Image
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. .slideUp( [ duration ], [ callback ] ) The .slideUp() method animates the height of the matched elements. This causes lower parts of the page to slide up, appearing to conceal the items. Once the height reaches 0, the display style property is set to none to ensure that the element no longer affects the layout of the page. Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively. If any other string is supplied, or if the duration parameter is omitted, the default duration of 400 milliseconds is used. .slideDown( [ duration ], [ callback ] ) The .slideDown() method animates the height of the mat...

Privacy and Policy

Copyright © 2009 Ankit Kumar Chauhan Permission is hereby granted, free of charge, to any person obtaining a  copy of this script and associated documentation files (the "script"), to deal  in the Software without restriction, including without limitation the rights to  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of  the Software, and to permit persons to whom the Software is furnished to do so,  subject to the following conditions: The above copyright notice and this permission notice shall be included in  all copies or substantial portions of the Scripts. THE Script IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER  IN AN ACTION OF CONTRACT, TORT ...

pagination using jquery

Image
jPaginate is a jQuery pagination plugin that comes with a twist: animated page numbers. The user can slide through the available page numbers by clicking or just hovering over the arrows. Shortlinks to the first and last page are available as well. You can call the plugin in the following way:$(elementID).paginate() You can configure the plugin with the following properties: count : The total number of pages start : With which number the visible pages should start display : How many page numbers should be visible border : If there should be a border (true/false) border_color : Color of the border text_color : Color of the text/numbers background_color : Background color border_hover_color : Border color when hovering text_hover_color : Text color when hovering background_hover_color : Background color when hovering images : If the arrows should be images or not (true/false) mouse : With value “press” the user can keep the mouse button pressed and the page numbers will k...

PayPal Website Payment Pro Script in php

Paypal Website Payments Pro is a new, easy way of accepting online credit card and paypal payments. It allows you to accept CC payments on your website without going through a gateway or setting up a merchant account. This script/module allows you to easily connect to the Paypal Pro servers and process credit cards. This script works with any PHP or HTML form! PayPal Pro Direct Payments & Express Checkout Script in PHP <?php define('API_USERNAME', 'Your_API_USERNAME'); define('API_PASSWORD', 'YourAPI_PASSWORD'); define('API_SIGNATURE', 'Your_API_SIGNATURE'); define('API_ENDPOINT', 'https://api-3t.paypal.com/nvp'); define('USE_PROXY',FALSE); define('PROXY_HOST', '127.0.0.1'); define('PROXY_PORT', '808'); define('PAYPAL_URL', 'https://www.paypal.com/webscr&cmd=_express-checkout&token='); define('VERSION', '53.0'); echo ...