Jump to content

cant grasp " or '


flemingmike

Recommended Posts

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>';

Link to comment
https://forums.phpfreaks.com/topic/215731-cant-grasp-or/
Share on other sites

$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.)

Link to comment
https://forums.phpfreaks.com/topic/215731-cant-grasp-or/#findComment-1121601
Share on other sites

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>";

Link to comment
https://forums.phpfreaks.com/topic/215731-cant-grasp-or/#findComment-1121618
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.