Problem using echo

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
qasim_353
Forum Newbie
Posts: 9
Joined: Sun Aug 07, 2011 8:41 pm

Problem using echo

Post by qasim_353 »

I am having problem in output. when i output the following it shows something else:

Code: Select all

echo "<form method= "POST " action= "confirm.php?uid=<?php echo $uid; ?> "\>
<div class= "right "><input name= "Button " type= "button " onClick= "location.href='?uid=<?php echo $uid; ?>&sendmsg=1' " value= "Resend "\></div>
<span><input name= "code " type= "text " maxlength= "32 " style= "width:150px;text-align:left " value= " " tabindex= "1 " class= "form "\></span>
<input type= "submit " name= "Submit " value= "Confirm " tabindex= "2 " onClick= " "\>
</form>";
Last edited by qasim_353 on Thu Aug 18, 2011 4:26 am, edited 1 time in total.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Problem using echo

Post by Christopher »

You cant put <?php echo $uid; ?> inside PHP code. Just do:

Code: Select all

echo "<form method= "POST " action= "confirm.php?uid=$uid;"\>
(#10850)
phphelpme
Forum Contributor
Posts: 261
Joined: Sun Nov 21, 2010 3:32 pm

Re: Problem using echo

Post by phphelpme »

You might also need to put your back slash in your script for your echo statements:

Code: Select all

echo "<form method=\"POST\" action=\"confirm.php?uid=".$uid."\"\>";
Best wishes
Post Reply