
October 9th, 2003
08:08 PM
Neversidian
Status: Offline!
you need to use a wyiswyg editor and get rid of the one that you are using right now.
and yeah i really really miss the double click copy, and the old php syntax where one line was really one line, not this double spacing crap. however the new quickedit and a few other little gems definately make up for it for the time being
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

October 9th, 2003
08:11 PM
Neverside Newbie
Status: Offline!
Triple click the text area you want to copy, then right click, copy.
EDIT: Nevermind, that only select one line, not multiple lines 

October 9th, 2003
09:45 PM
with Mr. Jones
Status: Offline!
When it "doesn't work" do you get any errors? use error_reporting('E_ALL');
___________________
http://www.philbrodeur.com - Expert PHP Development and Tutorials

October 10th, 2003
12:32 AM
add.htm:
<?php
<body>
<form method="post" action="fwrite.php">
<p>Name: <input type="text" name="name" /></p>
<p>Comment: <input type="text" name="comment" /></p>
<input type="submit" value="Add your Comment" />
</form>
</body>
?>
fwrite.php:
<?php
$filename = "halo2.txt";
$name = isset( $_POST['name'] );
$comment = isset( $_POST['comment'] );
$somecontent = $name ." - ". $comment;
if ( is_writable( $filename ) ) {
if ( !$handle = fopen( $filename, 'a' ) ) {
echo "Cannot open file ". $filename;
exit;
}
if ( !fwrite( $handle, $somecontent ) ) {
echo "Cannot write to file ".$filename;
exit;
}
echo "Success, wrote ".$somecontent." to file ".$filename;
fclose( $handle );
} else {
echo "The file ".$filename." is not writable.";
}
?>
That works, but when it adds to the file, it appends directly after the last comment. Also i have removed all your error checking. You can sort out that stuff yourself 
___________________
~rovman

October 10th, 2003
12:34 AM
Neverside Newbie
Status: Offline!
The reason it's appending is because you set the file open mode that way. fopen( $filename, 'a' )
a = append.
You should always use error_reporting('E_ALL') on all your stuff, just do yourself a favor and use it. 
___________________
Travis Farrell


October 10th, 2003
06:23 AM
Originally posted by Motorspin
You use to be able to double click on the code and it'd copy to your clipboard but I don't know where that went.
sorry to jump in here but, I just double clicked and it copied the code(s) for me 

October 10th, 2003
10:13 AM
with Mr. Jones
Status: Offline!
Originally posted by Ron
sorry to jump in here but, I just double clicked and it copied the code(s) for me
Its working on a per skin basis i think
___________________
http://www.philbrodeur.com - Expert PHP Development and Tutorials

October 10th, 2003
02:23 PM

Rovman's script dos'nt work (it's uploaded) but it does exactly the same as the others, it come up as a blank source (which is what is expected) but there is nothing added to the halo2.txt file. :confused:
My original script worked perfectly if I did'nt get varibles form the url and used the same scentance every time but it was when I added these varibles in that I ran into problems
Is there any way I can make the php script get the varibles from the URL (using $_GET['name'] and/or $_POST['name']) before thae script processes the writef command?
I've tryed these:
<?php
$filename_=_'halo2.txt';
// I've changed this line
$name_=_"$_GET['name']";
$comment_=_"$_GET['comment']/n";
if_(is_writable($filename))_{
____if_(!$handle_=_fopen($filename,_'a'))_{
_________print_"Cannot_open_file_($filename)";
_________exit;
____}
// Iand this one
____if_(!fwrite($handle,_$name - $comment))_{
________print_"Cannot_write_to_file_($filename)";
________exit;
____}
____
____print_"Success,_wrote_($somecontent)_to_file_($filename)";
____
____fclose($handle);
____________________
}_else_{
____print_"The_file_$filename_is_not_writable";
}
?>
and:
<?php
//I've changed the
$_GET /* to */ $_POST
// (and in the form) but it still dos'nt work help
?>
::jaguar::
___________________


October 10th, 2003
02:25 PM
without the underlines of course (just ignore them iv'e got mac os 9 and it's not so great at some things!) oh but the servers not so don't
oh and whats error_reporting('E_ALL')?
___________________

Last edited by KoolAsIce, October 10th, 2003 02:28 PM (Edited 1 times)

October 10th, 2003
04:43 PM
Neversidian
Status: Offline!
Originally posted by Ares
When it "doesn't work" do you get any errors? use error_reporting('E_ALL');
Btw ares, E_ALL is a constant, you dont need to send it as a string to error_reporting()
just error_reporting(E_ALL); will work
$name_=_"$_GET['name']";
WHY DO YOU PUT THE VARIABLE IN A STRING?!?!?!
Arrgh!
i posted the good script to grab the value
___________________
Jeremie - Used to be the Director of Community Development