Jump to content

[SOLVED] HTML/PHP Formatting


dmaru09

Recommended Posts

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.

Link to comment
Share on other sites

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. =/

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

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.