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
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...
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>...
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
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.
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...
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.