flemingmike Posted October 12, 2010 Share Posted October 12, 2010 hello, i cant figure this out, i feel like ive tried every variety. any help is appreciated $statusout='<form method="POST"> <input type="hidden" name="id" value="$sid"> <input type="hidden" name="eid" value="$seid"> <input type="hidden" name="jobnumber" value="<?php echo "$sjobnumber"; ?>"> <input type="submit" value="Sign In" name="signin"> </form>'; Quote Link to comment https://forums.phpfreaks.com/topic/215731-cant-grasp-or/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 12, 2010 Share Posted October 12, 2010 $statusout=' .... '; You are already in some php code, assigning a string to a variable ^^^. Therefore, you don't use php tags in it. If your goal is to get the $sjobnumber variable to be replaced by its contents, you either need to use double-quotes at the start and end of the string (which would require that you either escape any double-quotes inside of the string or change the quotes inside of the string to single-quotes) or you could use concatenation to make the $sjobnumber variable part of the string (which would allow you to leave the content you already have the way it is.) Quote Link to comment https://forums.phpfreaks.com/topic/215731-cant-grasp-or/#findComment-1121601 Share on other sites More sharing options...
flemingmike Posted October 12, 2010 Author Share Posted October 12, 2010 i need the $sjobnumber to be submitted in the form. as far as ive learned, the form is done with html, thats why i broke back into php. i never broke out of php though, thats why im so confused. is there a way i can do $jobnumber=?> HTML <?php ; Quote Link to comment https://forums.phpfreaks.com/topic/215731-cant-grasp-or/#findComment-1121604 Share on other sites More sharing options...
flemingmike Posted October 12, 2010 Author Share Posted October 12, 2010 here is a bit more code. i think it may be a bigger issue. if("$sstatus" == "1") { $statusout='<form method="POST"> <input type="hidden" name="id" value="<?php echo $sid; ?>"> <input type="hidden" name="eid" value="<?php echo $seid; ?>"> <input type="hidden" name="jobnumber" value="<?php echo $sjobnumber; ?>"> <input type="submit" value="Sign In" name="signin"> </form>'; } elseif("$sstatus" == "2") { $statusout='<form method="POST"> <input type="submit" value="Sign Out" name="signout"> </form>'; } else { } echo "<tr>"; echo "<td align='center'>" . $sdate1 . "</td>"; echo "<td align='center'>" . $sjobnumber . "</td>"; echo "<td align='center'>" . $sstart1 . "</td>"; echo "<td align='center'>" . $jcustomer . "</td>"; echo "<td align='center'><a target='_blank' href='http://mapof.it/" . $jlocation . "'>" . $jaddress . "</a></td>"; echo "<td align='center'>" . $statusout . "</td>"; echo "</tr>"; Quote Link to comment https://forums.phpfreaks.com/topic/215731-cant-grasp-or/#findComment-1121618 Share on other sites More sharing options...
roopurt18 Posted October 13, 2010 Share Posted October 13, 2010 Once you type one <?php you can not type another until you've closed the first one with ?>. <?php if("$sstatus" == "1") { $statusout='<form method="POST"> <input type="hidden" name="id" value="' . $sid . '" /> '; ?> Quote Link to comment https://forums.phpfreaks.com/topic/215731-cant-grasp-or/#findComment-1121622 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.