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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.