dmaru09 Posted August 4, 2009 Share Posted August 4, 2009 if(isset($_GET['update']) echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php?update='".$row['MAINT_ID']."'">'; else echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php">'; What is the correct format to include MAINT_ID in the link itself? I keep getting T_ECHO errors and cannot figure out the correct syntax. Any help would be greatly appreciated. Thank you in advance. Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/ Share on other sites More sharing options...
patrickmvi Posted August 4, 2009 Share Posted August 4, 2009 Try this: echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php?update='.$row['MAINT_ID'].'">'; or echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=InsertMC.php?update=".$row['MAINT_ID']."\">"; Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-890648 Share on other sites More sharing options...
dmaru09 Posted August 4, 2009 Author Share Posted August 4, 2009 Try this: echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php?update='.$row['MAINT_ID'].'">'; or echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=InsertMC.php?update=".$row['MAINT_ID']."\">"; Still no luck. =/ Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-890651 Share on other sites More sharing options...
dmaru09 Posted August 4, 2009 Author Share Posted August 4, 2009 Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-890709 Share on other sites More sharing options...
TeNDoLLA Posted August 4, 2009 Share Posted August 4, 2009 if(isset($_GET['update']) echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php?update=' .$row['MAINT_ID']. '">'; else echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php">'; Whoops.. lookes like to be the same as earlier was proposed. Anyway that should work just fine. Maybe the problem is not in formatting? Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-890710 Share on other sites More sharing options...
sawade Posted August 4, 2009 Share Posted August 4, 2009 if(isset($_GET['update']) echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php?update='".$row['MAINT_ID']."'">'; else echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php">'; What is the correct format to include MAINT_ID in the link itself? I keep getting T_ECHO errors and cannot figure out the correct syntax. Any help would be greatly appreciated. Thank you in advance. What it may be is you have extra " quote marks in the 1st line. Here - '".$row['MAINT_ID']."'" Trim it down to '.$row['MAINT_ID'].'" See if that helps. Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-890783 Share on other sites More sharing options...
dmaru09 Posted August 4, 2009 Author Share Posted August 4, 2009 Still getting this error for all suggested formats: Parse error: syntax error, unexpected T_ECHO in /export/home/oracle/itcrapp/ITInvoice/InsertMC.php on line 143 Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-890792 Share on other sites More sharing options...
dmaru09 Posted August 4, 2009 Author Share Posted August 4, 2009 if(isset($_GET['update']) echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php?update='".$row['MAINT_ID']."'">'; else echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php">'; What is the correct format to include MAINT_ID in the link itself? I keep getting T_ECHO errors and cannot figure out the correct syntax. Any help would be greatly appreciated. Thank you in advance. What it may be is you have extra " quote marks in the 1st line. Here - '".$row['MAINT_ID']."'" Trim it down to '.$row['MAINT_ID'].'" See if that helps. The normal format used throughout the code is ".$row['MAINT_ID']." I just cant get it to work inside that particular url. Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-890793 Share on other sites More sharing options...
sawade Posted August 4, 2009 Share Posted August 4, 2009 You know. Looking over it again. You are missing the {} brackets. Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-890802 Share on other sites More sharing options...
dmaru09 Posted August 4, 2009 Author Share Posted August 4, 2009 You know. Looking over it again. You are missing the {} brackets. From my understanding (newer to php) they're not needed if you only have one line of code. The 'if' or 'else' ends at the ; Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-890828 Share on other sites More sharing options...
premiso Posted August 4, 2009 Share Posted August 4, 2009 From my understanding (newer to php) they're not needed if you only have one line of code. The 'if' or 'else' ends at the ; Your understanding is correct. if(isset($_GET['update'])) // missing paran here echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php?update="'.$row['MAINT_ID'].'">'; else echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php">'; You had the quotes switched around. You needed it to start with and end with a single quote in the if statement $row maint_id part since that is what your echo starts and ends with. Should work, I may have missed something, but yea. Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-890834 Share on other sites More sharing options...
dmaru09 Posted August 5, 2009 Author Share Posted August 5, 2009 if(isset($_GET['update'])) // missing paran here echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php?update="'.$row['MAINT_ID'].'">'; else echo '<meta HTTP-EQUIV="REFRESH" content="0; url=InsertMC.php">'; You had the quotes switched around. You needed it to start with and end with a single quote in the if statement $row maint_id part since that is what your echo starts and ends with. Should work, I may have missed something, but yea. Perfect premiso, thank you very much! Quote Link to comment https://forums.phpfreaks.com/topic/168812-solved-htmlphp-formatting/#findComment-891298 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.