Jump to content

[SOLVED] Noobs needs help please.


triporia

Recommended Posts

Hey guys.

 

Im am brutally new at php and I am trying to remove a part of code from the following but it keeps giving me an error. 

 

The error is this: Syntax error, unexpected T_IF

 

I'm lead to understand that if I remove the part of code that I want to, the "IF" statement will not function properly.

 

 

This is the section I want to remove:

'<tr class="c1"> '.

' <td align="right"><b>' . MSG_FULL_ADDRESS . '</b></td> '.

' <td>' . $user->full_address($user_details) . '</td> '.

'</tr> ';

And this is the entire section of code I believe:

if ($user_id > 0)

{

$user_details = $db->get_sql_row("SELECT u.email, u.name, u.address, u.city, u.zip_code, u.phone,

c.name AS country_name, s.name AS state_name, u.state FROM " . DB_PREFIX ."users u

LEFT JOIN " . DB_PREFIX . "countries s ON u.state=s.id

LEFT JOIN " . DB_PREFIX . "countries c ON u.country=c.id WHERE u.user_id=" . $user_id);

 

$user = new user();

 

$contact_details .= '<tr class="c1"> '.

' <td align="right"><b>' . MSG_FULL_NAME . '</b></td> '.

' <td>' . $user_details['name'] . '</td> '.

'</tr> '.

'<tr class="c1"> '.

' <td align="right"><b>' . MSG_FULL_ADDRESS . '</b></td> '.

' <td>' . $user->full_address($user_details) . '</td> '.

'</tr> ';

if ($setts['enable_display_phone'])

{

$contact_details .= '<tr class="c1"> '.

' <td align="right"><b>' . MSG_PHONE . '</b></td> '.

' <td>' . $user_details['phone'] . '</td> '.

'</tr> ';

}

$contact_details .= '<tr class="c1"> '.

' <td align="right"><b>' . MSG_EMAIL_ADDRESS . '</b></td> '.

' <td>' . $user_details['email'] . '</td> '.

'</tr> ';

}

}

}

 

 

PLEASE HELP!!

Link to comment
https://forums.phpfreaks.com/topic/122482-solved-noobs-needs-help-please/
Share on other sites

edit this:

 

$contact_details .= '<tr class="c1"> '.
               '   <td align="right">' . MSG_FULL_NAME . '</td> '.
               '   <td>' . $user_details['name'] . '</td> '.
               '</tr> '.
               '<tr class="c1"> '.
               '   <td align="right">' . MSG_FULL_ADDRESS . '</td> '.
               '   <td>' . $user->full_address($user_details) . '</td> '.
               '</tr> ';

 

to this:

 

$contact_details .= '<tr class="c1"> '.
               '   <td align="right">' . MSG_FULL_NAME . '</td> '.
               '   <td>' . $user_details['name'] . '</td> '.
               '</tr> ';

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.