www.webdeveloper.com
Results 1 to 10 of 10

Thread: Read OK -- Write ability?

  1. #1
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,350

    Question Read OK -- Write ability?

    I have used AJAX to read a text file from the server. Very useful.


    Is it possible to use javascript and AJAX together to write to a text file or modify an existing text file?
    I know that it is not possible with JS alone.

    If yes, are there any example code or tutorials available to review?

  2. #2
    Join Date
    Mar 2010
    Posts
    2,803
    Is it possible to use javascript and AJAX together
    Firstly, you're misinterpreting javascript and ajax to be two different things when they are not.

    AJAX is just a particular way of using javascript.

    AJAX = Asynchronous Javascript And XML

    Anyway, to answer your question you can code the php script the ajax function calls to open, read, edit, save text files using the php file handling functions. They're all documented in the online php manual.

  3. #3
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,350
    Your answer would be fine if I had access to PHP on my server.
    I do not, so the bottom line is no.

    Thanks for the communication.

  4. #4
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    You have no server-side scripting available?
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  5. #5
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,350

    Talking

    Quote Originally Posted by svidgen View Post
    You have no server-side scripting available?
    True. Educational site (restrictive access).

    I can write text and JS and HTML files on server, but .php file extensions are not executed.

    If you know of a workaround, please PM me.

  6. #6
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    No cgi-bin? Have you spoken with a sysadmin?
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  7. #7
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,350

    Lightbulb

    Comments in red
    Quote Originally Posted by svidgen View Post
    No cgi-bin?
    Yes, have cgi-bin, but no user changes allowed by sysadmin
    Have you spoken with a sysadmin?
    Yes, they don't trust anyone messing with their cgi area at this university (paranoid?)
    Bummer dude!
    Thanks for the thoughts though.

  8. #8
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Weird that they would completely disabled cgi's ... Have you tried uploading a "standard" cgi script? ... You know, one of those archaic things that actually has to specify the executable needs to parse it?
    Code:
    #!/usr/bin/perl
    print "<html><body>wull hullo!</body></html>";
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  9. #9
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,350

    Arrow

    Maybe it my terminology your having trouble with.

    I can execute existing cgi programs
    I can read/write/execute (perl, html, JS) on my personal space.

    When I try to execute any <?php> tags in my space on the system, it just ignores my requests.
    I cannot modify anything in the university's cgi directory space without their expressed approval.

    Maybe my problem with sysadmin is the same I'm having with you.
    I may know just enough to get myself into trouble but cannot express it the way it should be expressed!

    I do appreciate your thoughts and will try again with the university's OIT. (Office of Information and Technology)

  10. #10
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    I can read/write/execute (perl, html, JS) on my personal space.
    If I'm understanding you correctly, this is all you need to be able to do. As long as your system's copy of perl is located in the traditional /usr/bin/perl path, the Hello World (wull hullo) script I supplied should be a suitable test.

    Drop it into the your web docs directory (preferably the cgi-bin folder, if it exists), chmod it to 755, and try to hit it in a web browser. If it displays "wull hullo" on the screen, you should be able to accomplish what you need. (Though I would advise against using perl scripts for AJAX -- or at all, if you can avoid it.)
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles