SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help with ajax code

    Hi everyone

    I'm not sure exactly where to post this as there doesn't seem to be a specific section for Ajax code! I guess this is as good a place as any!! Forgive me if it's not!

    I have a need for a simple, one line comment capture code that will display a users comments on a web page (php). I don't want a full blown blog page or forum board!

    I have found this very interesting code, it seems exactly what I need:
    http://www.kawa.net/works/ajax/ajaxc...-e.html#format


    But alas, it doesn't work when I install it! So, I realise this is a stab in the dark, but i'm hoping some kind friend out there will be curious enough and willing to assist me in getting in running (if only for the sake of a challenge lol)

    I've uploaded the files and the comment box appears on the page fine, but when I try to make a comment it says "your comment was not posted".

    Problems I can see that might be causing it to fail:

    1) If you visit the above link, you will see that according to the install, you have to set the permissions for :
    com/ajaxcom-data/ permition (sic) 777 (rwxrwxrwx) and
    com/ajaxcom.cgi permition (sic) 755 (rwxr-xr-x)

    Q: How do you set permissions for a file on the webserver?


    2) According to "Configurations", it says "You have to edit ajaxcom.js before using it' - but it doesn't really explain what to edit it to! Any clues?





    TIA

  2. #2
    SitePoint Guru alecrust's Avatar
    Join Date
    Jun 2007
    Location
    London, UK
    Posts
    728
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sol07
    I'm not sure exactly where to post this as there doesn't seem to be a specific section for Ajax code! I guess this is as good a place as any!! Forgive me if it's not!
    AJAX is JavaScript, so this should be in the JavaScript forum.

    Not setting the file permissions to what it says in the instalation instructions will not allow the script to modify files/directories and hence not work.

    You need to CHMOD those files. Have a look at this tutorial or, failing that search Google for CHMOD tutorials.

    So reading up on CHMOD will explain how to set permissions on your server.

    Have a look through ajaxcom.js code and it should be commented where you are supposed to edit. If you still can't figure it out post the code here.
    Honda Civic Forum - UK Civic Forum
    Web Host Reviews - Independent, honest host reviews
    My Portfolio - Simplicity is the ultimate sophistication

  3. #3
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,345
    Mentioned
    192 Post(s)
    Tagged
    5 Thread(s)
    RTFM
    The link to which you pointed us shows exactly what needs to be edited. Your specific url must be used in place of '/service/com/ajaxcom-data'.
    Some FTP programs provide the capability to CHMOD (change file permissions). Also, your host control panel - if it offers a File Manager - will give you this same ability.
    Last edited by ParkinT; Jan 15, 2008 at 05:46. Reason: It was not my intention to be rude. I was, however, blunt.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  4. #4
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks guys, still not quite there!

    I appreciate your comments and have now downloaded the CHMOD extension for dreamweaver, so that was a good learning point!

    So I've made the adjustments to the files' permissions no problem, and the following changes, but still this script isn't working.

    Here is my test page:
    http://www.thesallyconnection.com/te...page/copy.html


    I have followed the Config Instructions (found here)

    ...edit ajaxcom.js before using it.
    /service/com/ directory is used to install it in this site e.g.

    Code:
        AjaxCom.prototype.url_receive = '/service/com/ajaxcom-data';
        AjaxCom.prototype.url_post    = '/service/com/ajaxcom.cgi';
    My file:

    Code:
    AjaxCom.prototype.url_receive   = 'public_html/testing/newpage/ajax/ajaxcom-data';
    AjaxCom.prototype.url_post      = 'public_html/testing/newpage/ajax/ajaxcom.cgi';

    I have also updated ajaxcom-main.pl as instructed like this

    Code:
        my $URL_ROOT = "http://domain.name";
        my $DOC_ROOT = "/home/htdocs/domain.name";

    and here's my code for that
    Code:
        my $AJAXCOM_DATA = "ajaxcom-data";
        my $URL_ROOT     = "http://www.thesallyconnection.com";
        my $DOC_ROOT     = "public_html/www.thesallyconnection.com";

    Code within the page itself:
    <link href="/testing/newpage/ajax/ajaxcom.css" rel="stylesheet" type="text/css" />
    <script src="/testing/newpage/ajax/ajaxcom.js"></script>
    <div id="ajaxcom_here"></div>
    <script>(new AjaxCom("ajaxcom_here")).load();</script>


    I know I am getting close!! Any obvious errors you can see?

    TIA


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
  •