how preserve the content of the text box

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how preserve the content of the text box
# 1  
Old 10-25-2009
how preserve the content of the text box

I have used get method in my form and retrieving the content of text box in
$value using:
$buffer = $ENV{'QUERY_STRING'};

Now I want to preserve my text box:
I had tried:
print "<form action='/cgi-bin/abcd.cgiv' method='get'>";
  print "<input name='search' size =30 value='$value'>";
print "<\/form>";

Now wen i write therock'ravi

the text box only shows therock and it removes everything after ' (including ')..

any solution...

# 2  
Old 10-25-2009

Not sure. Is that a single quote in your input?

Perhaps you need to use "addslashes" on $value to escape that.
# 3  
Old 10-25-2009
Can you please elaborate it coz I've tried everything...

---------- Post updated at 06:58 AM ---------- Previous update was at 06:45 AM ----------

I think we use addslashes in php...
there is no such thing in perl....

pls help me out..
# 4  
Old 10-25-2009

Sorry, I thought it was PHP. I do need new glasses Smilie

My meaning was to escape the single quote:

$value =~ s/'/\\'/g;

Last edited by Scott; 10-25-2009 at 09:17 AM.. Reason: I didn't even read your original post properly. Maybe I need new eyes instead!
# 5  
Old 10-25-2009
Its printing '
But now its not working for "

I even tried:

$value =~ s/"/\\"/g;

But not working...

---------- Post updated at 07:19 AM ---------- Previous update was at 07:17 AM ----------

Its displaying \ in the place of '
after trying
$value =~ s/'/\\'/g

# 6  
Old 10-25-2009
Try the HTML code for '
value =~ s/'/& #39;/g

(without the space between & and #)
# 7  
Old 10-25-2009
Its working...
thanx a lot scottn...

But now it created another problem:
when I type therock&quot;
I get therock" in my text box..

Still my text box is not totally preserved...

pls help me out..


Last edited by therockravi; 10-25-2009 at 06:12 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to preserve the same text and modify the same text to append?

Hi, I have an issue modifying a file. Below is the content of the file. File name - a.txt SELECT LISTAGG(SCORE), LISTAGG(VB), LISTAGG(SCORE*12 + 3), LISTAGG(DOB) from T_CONCAT ; SELECT LISTAGG(SCORE), LISTAGG(VB), LISTAGG(SCORE*100 + 3), from... (1 Reply)
Discussion started by: Mannu2525
1 Replies

2. Web Development

How to copy a selected value of list box into a text box in html form?

hi, i have a list box , a text box and a button in a html form. list box displays some values, when a user selects a value from the list box and press the button. the selected value should be copied to the text box value. can any1 give me a html and javascript code to do this facility. ... (1 Reply)
Discussion started by: Little
1 Replies

3. Shell Programming and Scripting

To compare the content of two text files

I have two files, sec.txt(1st File) 3172 disp.txt(2nd file) the file name is *********** 45676 Now i want to compare the value in sec.txt file with disp.txt file Excatly i want to compare the value 3172 in first file and 45676 in second file. i want to compare the first line of... (11 Replies)
Discussion started by: rammm
11 Replies

4. Shell Programming and Scripting

Script to create a text file whose content is the text of another files

Hello everyone, I work under Ubuntu 11.10 (c-shell) I need a script to create a new text file whose content is the text of another text files that are in the directory $DIRMAIL at this moment. I will show you an example: - On the one hand, there is a directory $DIRMAIL where there are... (1 Reply)
Discussion started by: tenteyu
1 Replies

5. Shell Programming and Scripting

how to get the specified content of the text into a variable.

I am having one string like ./usr1/Server/temp/app.env ./usr1/Server/temp/upp/app.env ./usr1/Server/ORIG_temp/app.env ./usr1/Server/ORIG_temp/upp/app.env ./usr1/Server/work_temp_40/app.env ./usr1/Server/work_temp_40/upp/app.env ./usr1/fd/app.env ./usr1/PurgeArchive/app.env ./usr1/bm/bin/app.env... (6 Replies)
Discussion started by: dineshmurs
6 Replies

6. UNIX for Dummies Questions & Answers

Content format in a text file

Hi, I need to format the content in a text file as below format. Can some one help me how to approach? Also whether is it possible to convert the output to excel in column wise? Present: ============================================================================= Name: vinodh Status:... (1 Reply)
Discussion started by: vino_hymi
1 Replies

7. Web Development

how to get newline in a text box

Hi, plz ignore the error in subject. i need new line in text area. I am designing a JSP in which i have to display a field taken from oracle DB table in a text area.. field is first selected from oracle thru C++ and passed to jsp in a variable as one long string. the problem is while inserting... (2 Replies)
Discussion started by: suresh_kb211
2 Replies

8. Shell Programming and Scripting

FTP some text files from Windows box to unix

hi all, can anybody help me with script or command to ftp some text file from windows machine to AIX machine. this is shud be done by executing a shell script. (1 Reply)
Discussion started by: suprithhr
1 Replies

9. Shell Programming and Scripting

gui text box code snippet?

Hello, I have written some scripts that query the user and waits for keyboard input for an answer. I was wondering if there is any generic code snippets out there that would allow me to run this as a GUI. I am thinking of a simple dialogue box that would display the question and have a text... (1 Reply)
Discussion started by: Allasso
1 Replies

10. Shell Programming and Scripting

Auto sending text files from SCO box to a PC via serial cable

I have an SCO system with several PC's hooked up via ProComm and serial cabling (no Ethernet). I want to occasionally transfer a small text file from the UNIX system to a specific PC without the PC operator having to do anything (she may be out to lunch or doing other work during the transfer) ... (0 Replies)
Discussion started by: gbrowne
0 Replies
Login or Register to Ask a Question