I have a been developing an Online auction website using PHP and Mysql for the last few weeks. I have implemented everything including the 'bidding', 'buy it now' options of the auction etc.
I don't know much about AJAX to be honest, but I think it is the technology I need for this... My requirement is to devise a way of updating (in real-time) the current price of a particular auction product as more and more users bid on the item. Once a user bids on the item, the bid table of the database is updated with the highest bidders price. So once this value changes in the database, would it be possible to update the price on the webpage? Obviously, it is important for this update to be as accurate as possible to maintain the integrity of the auction.
I have been trying to figure out how to go about making a table of comments auto-refresh when someone inserts from a comment form without refreshing the whole page.I've tried looking into AJAX for this, but everything I have looked at, in terms of tutorials, just flies right over my head, and I can't really make much sense of it.
I am working on a chat program. When a user logs in, a value in the database is set to 1 (online), and when he/she logs out it is set to 0 (offline). The problem is, when the user exits the browser, naturally the value is still set to 1.
I'm trying to update a sql table from mi php Ajax web page, which stores dynamically a table into the page by table.appendChild(row) , so that the user can verify the information he is inserting before the actual database update.
For instance, Box A has a blank entry and I enter in 5. Box B I enter in 6 so in Box C it should automatically give me 11 (if the code I put in is to add box A and B). Then in Box D I put in 3 (say to subtract from A and B combined) so then Box C adjusts to give me 8.
Don't worry about the math as that's all taken care of it, I just need to be able to know how to update on the fly like this.
This is my first venture in this forum and also my first attempt at some programming for a fair few years and I have run into a problem i cannot for the life of me see the answer to. I am fairly sure I am just missing something stupidly obvious, but like I said its been a few years since I did any programming so I'm a bit behind with my knowledge!
I was wondering if someone could help me out with the following.I'm developing a webshop CMS in which you can create categories. By using jquery's ajax method I'm making a POST request to a PHP script which then handles all the data supplied to it. This works good and all except for the fact that after the query is being executed my HTML doesn't get updated, at least not as well as I want it to.I understand that the common way of working here is to update HTML in the success callback of the ajax method. But the thing is that every category is being displayed as a list item with an id attribute, this id corresponds to the id the category has in the database.If$.ajax tells me that everything went down smoothly and my query has been executed then there's still no way for me to know which id this new category has been given so that I can update the HTML accordingly.
What would be a "smart" way to tackle this? The first thing that comes to my mind is simply calling another script which figures out the last inserted id on the db but that would mean doing an ajax request in the callback of another ajax request? That doesn't sound right to me..
the way i have the database set up for this is with the following fields: id (the rating's unique id) listingid (the listing that the rating corresponds to) userid (the user that entered the rating) rating (the rating itself)
i use php to communicate with a mysql database. the file im going to write will check to see if there is already a rating entered in from the logged in user. if there is, it will update it. if not, it will insert it, then it will calculate the average of all votes for that listing (rounded up) and return the new rating to the page and set the stars to reflect that rating... ive tweaked the code a bit to represent a 5 star system instead of a 10 star system and also so it can be used multiple times on a page.
heres what ive been playing with:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
I have the code written out but I am running into an error with Safari 4.
Here's my code:
what I have is a code containing 2 iframes inside a div.what I'd like to do is refresh one of the iframes when it's page recieves an update from another user.
perhapse I could load the page on the document load, and store those contents in a var.then have a code that will compair the remote page to the var every second or so.if the page compairs differently, update the var info and refresh the iframe.
Is there a plugin that will do this? Or does anyone have an idea about how to implement something like this? The idea is for a sign company to have customers customize the text for their signs. They want to allow users to input text and have it update the sign image live with the text and resize it if the text string get's too long.
I was wondering if there is a way to have a page with a starting price of $299 (lets say a basic vacuum) then below that are 20 or so customizable add-ons to choose from through simple checkboxes. That (to me) should be easy enough, but I would love to have the grand total at the bottom of the page be updated in real time as the user checks or unchecks certain add-ons (kind like how apple.com does it).
What is a good starting point for this, and would it be possible to send out the order as an email with the total price sent to the business owner.
What is a good starting point for this, and would it be possible to send out the order as an email with the total price sent to the business owner. Like I said, I can sorta get my way around this stuff
I'm working on a project which requires a small portion from a large table of information to be displayed on a webpage (sort of like a magnifying glass). The display will be a table of fixed size (m by n cells). Some of the cells will be merged. When the table updates, different sets of cells may be merged.
The second way would be to have the script draw the table on its own in a canvas.
User events (such as arrow keys on the keyboard) will change the position of the focus (move the magnifying glass in a cardinal direction).
I hit a small snag with the first solution - Is it possible to update the table on the page (including changing the structure of it) without having to refresh?
sample code, whereby if I change a field value in a web form (from a drop-down list for example), the value shown in another field is automatically updated to show the needed value for that selected option?
I'm making a somewhat unusual web page that will feature a showroom (this showroom will have images/video/qtvr/etc). If a pre-determined user comes to the page and views the showroom, I am essentially controlling it on my end by changing the database. The page needs to check the database every 2 seconds and refresh if the database value is different from what it currently is. The issue with using iframes or a meta refresh is that if a video is loaded, it will never play, because the page will always be refreshing.
So, that is where the XMLHttpRequest function comes in. I believe I have all of the basic code completed, but it of course does not work and I am probably missing something really simple or perhaps my approach is off. Code: