php-windows Digest 23 Jan 2001 08:55:32 -0000 Issue 410 Topics (messages 5144 through 5148): Re: fwrite is adding extra text, why? and where is it coming from???? 5144 by: alain samoun Automating web data input and extraction 5145 by: Emore, Emmanuel Re: [PHP-Win2000 IIS5] File Uploading 5146 by: Mitesh Patel Re: createing a php script with reloadable modules. 5147 by: kill-9 Random Code 5148 by: Sigurd Magnusson Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
It seems that you forgot the quotes inside your html statements. Like: print "<form name=\"myform\" action= \"fileio.php\">"; etc... Alain Joey Garcia wrote: > > I an using the fwrite command to show how it works but it is writing extra > data. For example, I have a Form text box that prompts for a new string of > data then on submit it writes this to the text file and for just a test I > wrote "this is a test" and I got the text below. I don't understand why?? > > this is a testy> > </html> > / / DTD HTML > > I put a space between the two slashes otherwise Outlook puts a "file:" in > front of it like this // > > Here is a snippet of my code for performing the write, there is enough here > show you my approach. > > print "<form name=myform action=fileio.php>"; > > $filename="c:\\Program Files\\Apache Group\\Apache\\htdocs\\testfile.txt"; > $fp=fopen($filename, "r+"); > > if (!empty($newText)){ > fwrite($fp, $newText); > fclose($fp); > $fp=fopen($filename, "r+"); > $contents=fread($fp, filesize($filename)); > }else { > $contents=fread($fp, filesize($filename)); > } > fclose($fp); > > print "The content of the file is: <p><b>".nl2br($contents)."</b>"; > print "<br><p>Enter some text to write to the file.<br>"; > print "<input type=text name=newText size=30><br>"; > print "<input type=submit value='write text'>"; > > Note: I know I probably shouldn't write to a file and then reopen it, but I > am trying to demonstrate that I am actually reading and writing so I didn't > want to cheat and say I was actually reading it when I wasn't. > > The resulting text always has the "testy> > </html> > // DTD HTML " text appended after it. (???????) > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
I am looking for a way to automatically enter data into a web form and extract the result of the search to a mysql database. The information I am trying to retrieve resides on a separate server/site that I have no control over. The only access is through the web pages/forms. I am running PHP 4.0.4/Apache/MySQL on WinNT. Thanks
Do you get any error ??? what error do you get , may be script error or else also it may be the security of the server which may be having readonly rights for internet users if possible give the script and what error does it give?? ----- Original Message ----- From: NX Dev <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 22, 2001 5:58 PM Subject: [PHP-WIN] [PHP-Win2000 IIS5] File Uploading > [ PHP-Win] > Server: Windows2000 IIS5 > Issue: File Uploading using POST > I have it where the PHP Script knows all about using the _name/_size > things. My Problem is that i cannon get PHP to copy()/move() the file > from the TMPDIR location to where i want it to be. > > Bob > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Ok feelings are also welcome :) yes the script will be running 24 hours a day 7 days a week. I need the script to pick up the changes I make. I assumed that php would cashe the script it was curtly running and there for not pick up any changes I made while I was running it. which is what I need it to do. kill-9 ----- Original Message ----- From: "phobo" <[EMAIL PROTECTED]> To: "kill-9" <[EMAIL PROTECTED]>; "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Sent: Monday, January 22, 2001 6:24 PM Subject: Re: [PHP-WIN] createing a php script with reloadable modules. > My feeling ... > > Your script wont be running for 24hours, so you can just edit the PHP file > directly, can't you? Make a copy of your main PHP file, make the changes you > need, and copy/overwrite the existing one. I assume the PHP engine doesn't > read the file a line at a time but instead caches the whole script, so you > wont have any problems of the php script failing because it was changes > 'half way through' > > Siggy > > ----- Original Message ----- > From: "kill-9" <[EMAIL PROTECTED]> > To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > Sent: Monday, January 22, 2001 9:26 PM > Subject: [PHP-WIN] createing a php script with reloadable modules. > > > Ok guys I need your help I'm banging my head against the wall on this one. > > I need to do something like modules in a script. The main script runs 24/7 I > want to be able to change the modules run time. have some kind of flag set > to have it update/reload the module. I cant do something like an include > with the modules because they wont be refreshed that and you cant > re-included a function that has already been include once and include_once > wont work either because that wont refresh the module. > > here are my thoughts. > > if I use system or pass thru to set off the modules. but the question is I > need to pass the module a file pointer. and so far I have been unable to > pass a file pointer to another script. > > another option would be to use fopen to buffer the module and using exec to > execute this new module. I could reload the module by re reading the file. > would this work? > > all comments ,opinions , ideas , and wild guesses are welcome. I'm stuck > and need some new ideas on how to do this. > > > thanks > > kill-9 > www.kill-9.dk > > > > >
Whats the best way to make a completely random, unique code in the format "ABCD-1234" where each of the 8 characters can be alphanumerc; 0-9,A-Z... I thought about generating a 36^4 number, converting to to base '36', and repeating the process. What's a good way to ensure the code is not repeated, though? Siggy