homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

send to database on click

 12:42 pm on Oct 25, 2008 (gmt 0)

I got a list of keywords on a page and i want to send a keyword to a database only if a user clicks on it.
Can i do it with php only or i need to add javascript for that ?
How can i perform that ?


brotherhood of LAN

 1:00 pm on Oct 25, 2008 (gmt 0)

I assume you don't wan't the page to reload, otherwise you could use a form with a submit button(s)?

[edited by: brotherhood_of_LAN at 1:01 pm (utc) on Oct. 25, 2008]


 5:29 am on Oct 26, 2008 (gmt 0)

I'm pretty sure you'll have to add Javascript for that.

You need to start using AJAX if you want to interact to your Database without refreshing the page. I'd start using a Javascript AJAX framework if I were you.

Personally, I like Prototype.


 7:27 am on Oct 26, 2008 (gmt 0)

ajax would keep the visitor clicking on the same page, what i am actually looking for is when the visitor clicks :
1-the word is sent & stored into mysql
2-the visitor is redirected to a result page containing a list of results related to the word he clicked on.

i think in this case perhaps javascript would be more appropriate.


 6:41 pm on Oct 26, 2008 (gmt 0)

Nope, just use PHP. I believe the header [uk.php.net] function is what you need.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved