PHP form editing sql without any page reload/load

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ohgodpleasehelp
Forum Newbie
Posts: 1
Joined: Sun Aug 24, 2008 8:49 pm

PHP form editing sql without any page reload/load

Post by ohgodpleasehelp »

I am making a website which indexes videos from youtube into categories and then lets you view them at random based on those categories. Since I am allowing users to upload videos I am, of course, expecting some videos to be in the wrong category or to be removed by youtube. For this reason I want to make a 'report' button.

I figured out how to use the type hidden which allows for me to simply pass the variable of 1 (reported videos will be flagged as 1 so that I can easily find and edit them using an admin page) but I want to do this without any page load/reload on the users end. To make it as clear as possible here is a step by step breakdown of what I hope to be able to do.

1. User views a video. Said video is broken/tagged wrongly/etc. User hits the report button.
2. By hitting the report button that video has its value changed from 0 to 1 in the database.
3. The text "Thanks!" or something appears next to the report button to indicate that all has gone well and that the user can carry on knowing that he/she has reported it successfully.

What I do not want to have happen is any kind of page load or reload on the users end. Is this possible? If so which function(s) should I look into? Thanks!
User avatar
Ziq
Forum Contributor
Posts: 194
Joined: Mon Aug 25, 2008 12:43 am
Location: Russia, Voronezh

Re: PHP form editing sql without any page reload/load

Post by Ziq »

Look at AJAX technology.

Maybe you will be interested JsHttpRequest
Post Reply