Update MySQL without changing pages

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
kinger88
Forum Newbie
Posts: 12
Joined: Thu Apr 09, 2009 10:08 am

Update MySQL without changing pages

Post by kinger88 »

Hi all,

I would like to know if it's possible to update a MySQL table by calling a PHP page without moving from the current page

For example, their are download scripts which you can call such as download.php?file=filename and the current page won't change but the file will pop up to save

I would like to implement something like this but for adding current contacts to mailing lists

Example: Call addtolist.php and send in contact id and mail list id then it gets added without any changes to current page

Is it possible to do something like this?

Thanks in advance
User avatar
bradbury
Forum Commoner
Posts: 40
Joined: Wed Aug 25, 2010 11:21 am
Location: Eugene, OR

Re: Update MySQL without changing pages

Post by bradbury »

Yes it's 100% possible if you use AJAX and php.
kinger88
Forum Newbie
Posts: 12
Joined: Thu Apr 09, 2009 10:08 am

Re: Update MySQL without changing pages

Post by kinger88 »

OK thanks, just making sure i'm not gonna hit a dead end

I've never used Ajax so I guess i'll have to get learning!
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Update MySQL without changing pages

Post by Jonah Bron »

Assuming I understand correctly, if you give download.php the correct headers, you won't leave the page. Just link to it and the file will download.
Post Reply