473,395 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

String escaping problem (post back form data)

194 100+
hi everybody,

please tell me how i can get red of escaping problem. im not very much familiar with PHP so i hope anybody can help me here

I am trying to get the values in a form if back button of browser is used.

here is the code that im using:

Expand|Select|Wrap|Line Numbers
  1.  echo('
  2.     <table cellpadding="3" cellspacing="2" border="1" width="75%" align="center">
  3.     <form method="post" action="home.php">
  4.  
  5.     <tr>
  6.     <td>CID No.</td><td><input type="text" name="cid" value="<?php echo $cid; ?>" /></td>
  7.     </tr>
  8. </form></table>');
  9.  
this is what im getting at field cid: <?php echo $cid; ?>
i want to print here the value of the variable $cid what was posted by the form but it is not happening. please tell me how i can achieve this. thank you.
Jul 20 '09 #1
5 3500
dlite922
1,584 Expert 1GB
When that form is submitted your value should be in $_POST['cid'] in home.php page.

My I suggest some PHP tutorials. w3cschools.org is a great site to start. Google can help.



Dan
Jul 20 '09 #2
mfaisalwarraich
194 100+
thanks for your suggestions. but im trying to escape one single and then double quote. this is what i dont understand. please tell me how i can do this. like im writing double quote inside a single quote and then i have to escapte $cid from dat. please tell me how i can do dat
Jul 20 '09 #3
Dormilich
8,658 Expert Mod 8TB
the general escape character is the backslash, though it only works in parsed strings.
Jul 20 '09 #4
Dheeraj Joshi
1,123 Expert 1GB
Probably you can take form data into $cid=$_POST["cid"]

and do the string operation on $cid.

For this refer PHP docs.
Jul 21 '09 #5
mfaisalwarraich
194 100+
thanks for helping me. i found the solution and its very easy :)) sometimes u dont understand what you have to do and dat pose problems. but its very easy.

Expand|Select|Wrap|Line Numbers
  1.    $_SESSION['cid'] = $_POST['cid'];
  2.  
  3.     echo('
  4.     <td>CID Number </td><td colspan="5">'. $_SESSION['cid'] .'</td></tr>
  5.     ');
  6.  
  7.  
thank you once again for helping me.
Jul 22 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Pjotr Wedersteers | last post by:
I am using a function that does a very basic encryption (rotation based) of data. Data is a string which may contain a..z,A..Z,0..9,,(),|,{}"', length limited to 255 chars. The problem I have...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
8
by: moondaddy | last post by:
I need to convert a byte array to a string and pass it as a parameter in a URL and then convert it back to the original byte array. However, its getting scrambled in the conversion. In short,...
8
by: Jacob Arthur | last post by:
How would I go about using a custom select string that is passed from a form to the SelectCommand parameter of SqlDataSource? I tried: SelectCommand = "<% Request.Form("hdnSelect") %>" but I...
3
by: edoardo.poeta | last post by:
I'm a dummy. I have a basic knowledge of javascript and I want to split a string, but I receive an error at line 15. Where my error in make the array? Why? Can someone help me to resolve? Thank's....
23
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of...
11
by: RipperT | last post by:
Don't know if this group covers web apps, but here goes. In VS 2005, I am trying to get variables to hold thier values during postback from the server. I convert a text box's user-keyed value to an...
7
by: php_mysql_beginer911 | last post by:
Hi .. hope someone will help i am trying to figure it out why i cannot post string "union select" every time i try to post data which content union and select .. the page doesn't get posted and...
14
by: Arjen | last post by:
Hi, I have a string with this value 07/11/2008. As you see no time included. How can I parse this string to a datetime variable? I tried to do this but I get the exception that the format is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.