dprichard Posted April 12, 2006 Share Posted April 12, 2006 I am not sure what I am doing wrong here, but I am trying to make a form that changes based on the status of a gallery in my script. Here is the If statement, but I am getting the followin error:Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\sitename\admin\admin-gallery-add-1.php on line 161Any help would be greatly appreciated. Thank you![code]<?php if ($row_galleries['gallery_status'] == 0) {echo "<input name="gallery_status" type="hidden" id="gallery_status" value="1"><input name="gallery_id" type="hidden" id="gallery_id" value="$row_galleries['gallery_id']"><input type="image" name="submit2" src="../images/icons/forbidden.png" width="16" height="16">"; } if ($row_galleries['gallery_status'] == 1) { echo '<input name="gallery_status" type="hidden" id="gallery_status" value="0"><input name="gallery_id" type="hidden" id="gallery_id" value="echo $row_galleries['gallery_id']"> <input type="image" name="submit2" src="../images/icons/add.png" width="16" height="16">'; } ?> [/code] Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 12, 2006 Share Posted April 12, 2006 Too many double quotes in this line:[code]<?phpecho "<input name="gallery_status" type="hidden" id="gallery_status" value="1"><input name="gallery_id" type="hidden" id="gallery_id" value="$row_galleries['gallery_id']"><input type="image" name="submit2" src="../images/icons/forbidden.png" width="16" height="16">";?>[/code]try[code]</phpecho '<input name="gallery_status" type="hidden" id="gallery_status" value="1"><input name="gallery_id" type="hidden" id="gallery_id" value="' . $row_galleries['gallery_id'] .'"><input type="image" name="submit2" src="../images/icons/forbidden.png" width="16" height="16">';?>[/code]You almost got it right with the second "echo", change it from:[code]<?phpecho '<input name="gallery_status" type="hidden" id="gallery_status" value="0"><input name="gallery_id" type="hidden" id="gallery_id" value="echo $row_galleries['gallery_id']"><input type="image" name="submit2" src="../images/icons/add.png" width="16" height="16">';?>[/code]to[code]<?phpecho '<input name="gallery_status" type="hidden" id="gallery_status" value="0"><input name="gallery_id" type="hidden" id="gallery_id" value="' . $row_galleries['gallery_id'] . '"><input type="image" name="submit2" src="../images/icons/add.png" width="16" height="16">';?>[/code]Ken Quote Link to comment Share on other sites More sharing options...
dprichard Posted April 12, 2006 Author Share Posted April 12, 2006 Thanks, that worked... Quote Link to comment 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.