Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by 01chris

  1. 01chris

    $webdata=<<END; adds extra line: Probably a simple problem

    Thank you both very much for the prompt and helpful replies. MillerH: Thank you for that chomp command, it has done the trick. stevexff: Thanks for the response, I had intended for there to be a blank line at the top. Problem solved! Chris
  2. 01chris

    $webdata=<<END; adds extra line: Probably a simple problem

    Why, when I use the following code, does my script add an extra blank line after the last </user> tag? $webdata=<<END; <User Name="$FORM{'username'}"> <Option Name="Pass">$md5</Option> <Option Name="Group">users</Option> <Option Name="Bypass server userlimit">2</Option> <Option Name="User...
  3. 01chris

    How do I write a script to modify an XML file?

    Just a little question: When I use $webdata=<<END; <User Name="$FORM{'username'}"> <Option Name="Pass">"$FORM{password}"</Option> <Option Name="Group">users</Option> <Option Name="Bypass server userlimit">2</Option> <Option Name="User Limit">0</Option> <Option Name="IP Limit">0</Option>...
  4. 01chris

    How do I write a script to modify an XML file?

    Please see my post from 15:52
  5. 01chris

    How do I write a script to modify an XML file?

    Please ignore my last post, I was trying to make it more complicated than it needed to be. I think I have done it now, so thank you very very much for all your help and for being so patient with me. I may need to re-post but I doubt it now. Thanks once again Chris
  6. 01chris

    How do I write a script to modify an XML file?

    Thanks, but I wanted it to work out the MD5 of what was entered into the form and assign that to the $md5 variable, not just assign md5_hex... to it.
  7. 01chris

    How do I write a script to modify an XML file?

    Thank you very much for all your help, I think I am nearly there now. Just one last thing, how do I assign use Digest::MD5 qw(md5_hex); md5_hex("$FORM{$password}") to $md5. So I can put $md5 every time I want to use the MD5 of what ever the user entered in the "password" field of the form.
  8. 01chris

    How do I write a script to modify an XML file?

    Sorry about this but I have yet another question (or 2). How do I enter a few lines of text rather than just one word? For example, after the last </user> tag I want to make a new line then add the following code: <User Name="$FORM{'name'}"> <Option Name="Pass"> MD5 </Option> <Option...
  9. 01chris

    How do I write a script to modify an XML file?

    Thanks again TonyGroves, I ran the script you posted and it opened the file ok but added "hello" after the 1st </user> tag rather than the last one. Also, could I change "$webdata" to "$FORM{'username'}"? Finally, if I changed "abc-out.xml" to "abc.xml" would it overwrite the unmodified...
  10. 01chris

    How do I write a script to modify an XML file?

    TonyGroves, thank you very much for your prompt reply however I'm not sure i understand it. I tried: #!c:\Perl\bin\perl.exe abc.xml=~s/(.*<\/user>)/hello/i; just to try it out but it didnt work. (I was hoping that it would add "hello" on a new line after the last </user> tag but the script...
  11. 01chris

    How do I write a script to modify an XML file?

    I am very new to both Perl and XML but was wondering how I could write a script which would take data from a web form and add it to an XML file. Basically I just wanna add users to my Filezilla server from a web form. The script needs to take the data from the form, add it to the XML file (in...

Part and Inventory Search

Back
Top