Current location: Hot Scripts Forums » General Web Coding » JavaScript » Writes to a text file


Writes to a text file

Reply
  #1 (permalink)  
Old 08-18-03, 08:08 PM
gamextremer2003 gamextremer2003 is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Writes to a text file

I imagin it would look something like:

fwrite:($textfile, $text message)

But what about
  • Writing to the end of the file
  • adding spaces between writings
  • setting what to write, such as if you want it not only to write a string, but a set message.

-----

I've heard rumors Javascript can't write to files, so how would I give php commands from a .js file?

-----
-----

Another question just came up...I'm working within a .js file, and how do I send a php file information?

For example:

(jsfile.js)
function send_message_to_php_file()
{
(((unknown code to send the php file the information "message_from_java")))
}

(phpfile.php - no need to write anything from php, I have this covered)
<?php
// simple display of the information the javascript file sent me
echo $message_from_java
?>
__________________
Gamex

Last edited by gamextremer2003; 08-18-03 at 09:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-21-03, 01:51 AM
nd2 nd2 is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
java script cannot write to files, this is a good thing imagin what a hacker or virus could do if it could write to your hard drive from the web very easily. ah.

you could submit from the url.

window.location='http://yourpage.com/script.php?mytext=hello my name is bob';

or you could post it.

there is one other method but i cannot remember the function names maybe ill post them later..
__________________
IonCMS (Coming Soon.)
http://ioncms.com
--
Ncaster (Free php/mysql cms)
http://ncaster.cjb.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-06-03, 03:42 AM
jewellgr jewellgr is offline
Wannabe Coder
 
Join Date: Aug 2003
Location: Michigan USA
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Why not use php for all of it.
php can be called from html pages using hidden iframes.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 09-10-03, 01:17 PM
perleo perleo is offline
Coding Addict
 
Join Date: Jul 2003
Location: Ireland
Posts: 269
Thanks: 0
Thanked 0 Times in 0 Posts
or if perl is anygood to you.

open(TEXT, ">>TEXT FILE PATH") or die "Cant open: $!";
@text=<TEXT>;

print @text "Text here";

close(TEXT);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 09-11-03, 10:43 AM
gamextremer2003 gamextremer2003 is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
I mean, writing to a file on the server..and I guess it'll have to be php then..
__________________
Gamex
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP code to edit a text file mdhall Script Requests 12 12-23-10 05:03 AM
text file to link rush989 Script Requests 3 08-29-03 07:12 PM
Need to submit form to database and text file - Any ideas how? dpreiss ASP 1 08-21-03 07:02 PM
Upload file type and size limiter! Arctic ASP 1 08-02-03 08:06 PM
replacing certain parts of certain strings in text files Archbob PHP 0 07-29-03 05:23 PM


All times are GMT -5. The time now is 02:25 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.