Topic awaiting preservation: Something (Maybe PHP) to help me with JS |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: New York, USA |
posted 02-04-2005 07:46
I need something like a php script that will write to flat files, but I need it to create an ID that grows an incriment with each post... |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 02-04-2005 08:17
uh? |
Paranoid (IV) Inmate From: France |
posted 02-04-2005 13:50
Ensellitis: when you write your flat file, do you open it in a or a+ mode directly, or have you open and read completely before ? |
Bipolar (III) Inmate From: New York, USA |
posted 02-04-2005 16:53
I played around with different stuff after reading almost every little tutorial I could get my hands on, and after reading almost every doc on php.net... This was my final result... code: <?php
|
Paranoid (IV) Inmate From: France |
posted 02-04-2005 17:12
wow, you're using a gigantic hammer here. At the minimum you should replace the ALL the str_replace by : code: $xcode = htmlentities( strtolower( $xcode ) ); And actually if use the output of the flat file to feed a JavaScript function, you could easily replace your : code: opttext[ 7 ] = "whateverr" syntax by either : code: opttext.push( "whatever' ) or if you fear that the push() method is not supported by lame browsers and don't want to fix it yourself by creating a prototype, you could just use code: opttext[ opttext.length ] = "whateverr" Oh and of course, to load the content of your flat file you could also use a passthru( ) to make a tail myFlatFile.txt -5 |
Bipolar (III) Inmate From: New York, USA |
posted 02-05-2005 13:10
Is it possible to call a PHP file as a JS? |
Bipolar (III) Inmate From: New York, USA |
posted 02-05-2005 13:20
Poi, you smart SOB, opttext.push( "whatever" ) works perfectly, you have NO idea how easy you just made my job =) |
Bipolar (III) Inmate From: New York, USA |
posted 02-07-2005 03:36
Ok, now here is another question... code: opttext.push( "monkey" ) <!--added Feb 6, 05 (8:44.52 pm)-->
code: <?php
|
Bipolar (III) Inmate From: New York, USA |
posted 02-07-2005 05:08
NM, I should have tried before asking simply adding: code: $buffer=str_replace("opttext.push( \"","<font color='#ffffff'<b>",$buffer);
|
Paranoid (IV) Inmate From: France |
posted 02-07-2005 05:39
/!\ you forgot to close the opening FONT tag. Anyway, seeing the interrest you put on your site for the web standards I find weird that you use a deprecated tag and nest a useless B tag in it. |
Bipolar (III) Inmate From: New York, USA |
posted 02-07-2005 17:18
Well, right now I am just trying to get this stuff working, then I am going to convert everything to standard, or try too. One of my scripts goes haywire when I put the XHTML declarer in the pages... |