Page 1 of 1

Update MySQL without changing pages

Posted: Tue Sep 14, 2010 8:27 am
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

Re: Update MySQL without changing pages

Posted: Tue Sep 14, 2010 2:09 pm
by bradbury
Yes it's 100% possible if you use AJAX and php.

Re: Update MySQL without changing pages

Posted: Tue Sep 14, 2010 4:05 pm
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!

Re: Update MySQL without changing pages

Posted: Tue Sep 14, 2010 10:11 pm
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.