Results 1 to 2 of 2

Thread: Some Ajax Help

  1. #1
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default Some Ajax Help

    Ok i've been trying to get my head around ajax... but it seems to be too overcomplicated for me... I'm trying to do a simple function like put text somewhere or execute a SQL function when a user clicks on a link... I'm confused with all the other junk...
    Thanks

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Can we see your code? Or do you just wanna know how to do that?
    I am sorta familiar with ajax. So what you would do is in the php page something like this[page.php]:
    PHP Code:
    if($_GET['page'] == 'sql_f'){
    $var $_POST['text'];
    mysql_query("INSERT INTO `table`(text) VALUES ($var)")or die(mysql_error());

    And then in the ajax page you would use post data to send a the field text. With that your gonna need to send it to the page:
    Code:
    page.php?page=sql_f
    Hope this helps.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •