Jump to content

How to send a string by a form


umekille78
 Share

Recommended Posts

Hi!Im using a form to send a text from one page to another.Like this:

$StartText="The text that is sent.";<input type='hidden' name='message' value=$StartText>

The problem is when i use $message in the other page it only returns "The" not all of the text. I try to use the text in second form.Like this:

<input type=text size=50 name=message value=$message>

Can anyone help me figure out why I only get "The" and not the full string??/Per

Link to comment
Share on other sites

You need quotes around the attributes. Ideally, all of your attributes should have quotes around them. Do either of these:

<?php echo "<input type=\"hidden\" name=\"message\" value=\"{$StartText}\">";?>

<input type="hidden" name="message" value="<?php echo $StartText; ?>">

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...