![]() |
|
#1
|
||||
|
||||
Little Help pleaseI have been working on a script for few days now and I can't seem to get it right, I have a simple txt based database file. I found a script that I use sometime back that adds edits and delete entries in the file. The problem I'm having is that the txt file needs the file written a certain way to be read by another script.
EX. What the file needs to look like for the other script to work Text|text|http://www.text.com||#text#| But the script keeps writing it this way Text|text|http://www.text.com|text| I'm not sure how to get the script to write it the right way. Thank you in advance any help that anyone can offer me. |
||||
|
#2
|
||||
|
||||
|
the last time i looked at perl scripts, I was still hosted at Tripod; so I apologise if this doesn't help...
if i were u, i'd look for the line where it adds the data into your database.txt file. I looked and found this line that i think is that line (which i modified for clarity / brevity) in edit.cgi: Code:
i would try... Code:
let me know if my guess was right? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
||||
|
||||
|
The code you posted really help me out. It added the || | to the data.txt file. I worked with the script for a little bit but I think the reason that it wouldn't add the #personal# I think and I may be wrong but the # is the comment tag for perl. But I edited the edit_record.cgi and added a drop down menu to the form and put the #personal# in there and it works.
Thank you ever much for your help I also needed to know if you would know ever I could get a web besed editor for my site. I downloaded CSCreate script from cgiscript.net. But it doesn't seem to be working I'm going to work with it for a few more days. But I may need a little help with it. But thanks greatly for the help.. Later |
|
#4
|
||||
|
||||
|
ofcourse, how silly of me :
try Code:
the backslash is for 'escaping' any special characters like the # __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#5
|
||||
|
||||
|
ok I edited the file again and its right, The last problem is that if I edit one entry in data.txt it erase the format of the other entry.
EX Before I edit..... test|test|www.test.com||#personal#| test|test|www.test.com||#personal#| test|test|www.test.com||#personal#| after i edit one entry..... test|test|www.test.com||#personal#| test|test|www.test.com||##| test|test|www.test.com||##| I think it may be in the view.cgi file somewhere. because when I edit the data.txt using the script the last entry is always blank Any ideas? Thanks I uploaded the file I've been working with. |
|
#6
|
||||
|
||||
|
without having looked at the file yet, how does the script know which record to edit if there's no unique id for each line of record?
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#7
|
||||
|
||||
|
I'm not really sure. I've been looking at the script last night and this morning. I'll look into it and see. This is a little different from the last time I use this script I'll I had to do was change the Fields and a small edit here and there but I never tried to add a field. But I'll play around with it to day and I'll see if I can found out.
Thank you for the help. |
|
#8
|
||||
|
||||
|
ok I think that I may have found the problem. in the edit.cgi script on the line
Code:
ok to explain the $cat is the var that I gave the 4th field in the script but I think the problem lies in the database.txt file I don't think it can read the 4th field. it I exe the script with the above line that when it erases the 4th field but if I change the code to Code:
it still will not work but it will write personal in the 4th field on all but the one I edit. I hope this make sence I'm not very good and explaining it. |
|
#9
|
||||
|
||||
|
in php if i had to do something like that, it would be
PHP Code:
PHP Code:
hope u see what i am trying to say here __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#10
|
||||
|
||||
|
Ok I'm getting closer I know that the reason it will not display it is in the view.cgi file in this line maybe I've been playing with it but no luck yet.
Code:
|
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The