473,789 Members | 2,898 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

String escaping problem (post back form data)

194 New Member
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 3517
dlite922
1,584 Recognized Expert Top Contributor
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 New Member
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 Recognized Expert Moderator Expert
the general escape character is the backslash, though it only works in parsed strings.
Jul 20 '09 #4
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
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 New Member
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
1391
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 is the following: Let's say my $string is 'This is a string' At a given moment encrypt ($string) yields '6noq4oq4"q6{o]3' as a result. When I decrypt that I get my original string back. But if I send the
32
14902
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 ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
8
4207
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, here's the code: ====================================== Dim textConverter As New ASCIIEncoding Dim sParam As String = "This is my cool param" Dim bytParam() As Byte 'load the byte array here...
8
1996
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 got an error about putting <% %> tags in a literal. I tried taking out the quotes (the " ") and it didn't do any good. I'm trying to use the built in ASP.NET 2.0 DataList control, but I haven't come up with anything.
3
6390
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. The name of file is E:\delibere test\pdf\2002\2002-01-01-GC-000-Testo.pdf <HTML> <HEAD> <SCRIPT LANGUAGE=JAVASCRIPT>
23
14523
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 the visitors will retype it all so i'm asking: "how to preserve POST-data when clicking the back-button?" i've already tried to print post data as a value in a HTML tag but
11
2259
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 integer and assign it to a module level variable, then convert the variable and assign it to a hidden text box, setting it's EnableViewState to true so it returns with the reload. Then in the form's load event, I attempt to convert the contents...
7
2938
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 it shows error page not found on this server i googled and found some people use union and select to hack sites (mysql injection) i guess the server i am using has some kind of filter and if a post string content "union select" ... it simply...
14
21221
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 incorrect. Any ideas? I tried both convert... and datetime.par...
0
10410
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.