MaxDisk
asked on
Problem with the apostrophe '
I try to display the message in the text box with php but it stop at the '
<input type="text" name="T1" size="40" value='<?php echo "Don\'t Know";?>'>
Only output Don, i like to be able to display the ' (apostrophe)
ASKER
nope I tested them both but the resulted is Don\\ and Don\
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
oops
still more problem
Strange after I submited the form and recall the value the value getting strange here
still Don\\
still more problem
Strange after I submited the form and recall the value the value getting strange here
still Don\\
ASKER
<?php if(isset($_POST['T1'])) { echo $_POST['T1'];} ?>
the result Don't after first submit
Do\\ after 2nd sumit
Do\\\\\\\\\ and goes on and on
<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1'])
ASKER
Nope still not working.
The result is just DON
<input type="text" name="'T1" size="40" value='<?php if(isset($_POST[''T1'])) { echo stripslashes($_POST[''T1'] ) ;} ?>'>
The result is just DON
not Don't Know.
The result is just DON
<input type="text" name="'T1" size="40" value='<?php if(isset($_POST[''T1'])) { echo stripslashes($_POST[''T1']
The result is just DON
not Don't Know.
here is my test form, which worked perfectly:
<form action="" method="post">
<input type="text" name="T1" size="40" value="<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1']) ;} ?>"></input>
<button type="submit"></button>
</form>
<form action="" method="post">
<input type="text" name="T1" size="40" value="<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1'])
<button type="submit"></button>
</form>
ASKER
thank you for the following this problem.
seems like it's working fine now.
I will post the message if I see any more problem.
The below is the working version.
Thank you every much.
//form Test_Opostrophe.php <p>
Normal echo>>>>
<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1']) ;} ?>
<form method="POST" action="Test_Opostrophe_su bmit.php">
Enter something with the backslash, the script will display all of the backslash perfectly now.
<br>
Notes if... wanted to pre-enter text within the text box or assign the string remember to put the backslash in font of the opostrope
<input type="text" name="T1" size="40" value="<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1']) ;} ?>"></input>
<input type="submit" value="Submit" name="B1">
</form>
<p> </p>
//form Test_Opostrophe_Submit.php <p>
<form method="POST" action="Test_Opostrophe.ph p">
Normal echo >>>>>
<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1']) ;} ?>
<p>Echo within the textbox</p>
<input type="text" name="T1" size="40" value="<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1']) ;} ?>"></input>
<input type="submit" value="Submit" name="B1"></form><BR>
seems like it's working fine now.
I will post the message if I see any more problem.
The below is the working version.
Thank you every much.
//form Test_Opostrophe.php <p>
Normal echo>>>>
<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1'])
<form method="POST" action="Test_Opostrophe_su
Enter something with the backslash, the script will display all of the backslash perfectly now.
<br>
Notes if... wanted to pre-enter text within the text box or assign the string remember to put the backslash in font of the opostrope
<input type="text" name="T1" size="40" value="<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1'])
<input type="submit" value="Submit" name="B1">
</form>
<p> </p>
//form Test_Opostrophe_Submit.php
<form method="POST" action="Test_Opostrophe.ph
Normal echo >>>>>
<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1'])
<p>Echo within the textbox</p>
<input type="text" name="T1" size="40" value="<?php if(isset($_POST['T1'])) { echo stripslashes($_POST['T1'])
<input type="submit" value="Submit" name="B1"></form><BR>
<input type="text" name="T1" size="40" value='<?php echo "Don\\\'t Know";?>'>
<input type="text" name="T1" size="40" value='<?php echo "Don\'\'t Know";?>'>