Jump to content

Getting Parse error: syntax error, unexpected '<' in


Recommended Posts

Well that fixed that problem, thank you very much. Now I have a boat load more coming up. This code is all wrong.

 

Parse error: syntax error, unexpected T_IF, expecting T_VARIABLE or '$' in /home/ianapps/public_html/globetrotters/common.php on line 278

 

and im sure there are 100's more.

I think im gonna try echoing it, everytime I put <? or <?php I get the parse error

 

Thats because you HAVE to close off the php section with ?> before the html section starts. I have been coding html for 12 or so years, but started php about 3 weeks ago - been a massive learning curve getting the site updated, but thanks to the books I have purchased, google, and also help from people in here, I have managed to end up with what I think is a reasonably functioning site, but I am still learning HEAPS, and have a lot more to learn.

Probably not a bad idea to start a bit of study on how php and html work. I guess this is code you have sourced from elsewhere, and you are trying to adapt it to your page. I guess this is a good (but steep) learning curve for you lol

lol yep, its not my code entirely. I did write some of it, probably all the errors lol. I have been looking at this code for weeks to no avail. If you want to try and look at it I will send it to you, if not no worries. im just getting an aneurism from it lol

lol yep, its not my code entirely. I did write some of it, probably all the errors lol. I have been looking at this code for weeks to no avail. If you want to try and look at it I will send it to you, if not no worries. im just getting an aneurism from it lol

 

Tbh, if you're going to actually use php, you should probably learn it properly. If you don't understand the difference between php and html, you should probably learn it.

If your still getting the error.

 

function GetInTradesSideBar ($user) {
  global $logtrade_table;
  $result = Query ("SELECT id,unix_timestamp(date) as datets,uid_from,what,amt,what_req,amt_req,auth FROM $logtrade_table WHERE uid_to=$user and hide=0 and auth=0 ORDER by date DESC"); // get trades coming into you
$i=0;
if (mysql_num_rows ($result) == 0)
  return "<br/>.";
$a = '<table>';
  while ($row = mysql_fetch_array ($result)) {
    $u = $row['uid_from'];
    $a .= '<tr><td bgcolor="#eaeaea"><fb:profile-pic uid="'.$u.'"/>  <br/><fb:name uid="'.$u.'"/></td><td bgcolor="#eaeaea">' . date ("F j", $row['datets'] ) . ' - <b><a href="?id=trade">View</a></b></td></tr>';
    $i++;
  }
  $a .= '</table>';
  return $a;
}
function GetOutTrades ($user) {
  global $logtrade_table;
  $result = Query ("SELECT id,unix_timestamp(date) as datets,uid_to,what,amt,what_req,amt_req,auth,hide FROM $logtrade_table WHERE uid_from=$user ORDER by date DESC limit 50 "); // get trades coming into you
  $i=0;
  while ($row = mysql_fetch_array ($result)) {
    $out[$i]['id'] = $row['id'];
    $out[$i]['date'] = $row['datets'];
    $out[$i]['uid_to'] = $row['uid_to'];
    $out[$i]['what'] = $row['what'];
    $out[$i]['amt'] = $row['amt'];
    $out[$i]['what_req'] = $row['what_req'];
    $out[$i]['amt_req'] = $row['amt_req'];
    $out[$i]['auth'] = $row['auth'];
    $out[$i]['hide'] = $row['hide'];
    $i++;
  }
  return $out;
}
// some php
function ParseInTrades ($data) {
global $db_to_desc_send;
  if (!count($data))
    return;
  global $facebook;
}
?>
<table border="0" colspacing="2" colpadding="2">
  <tr> <th width="100"> <h3 class="subtitle">Date</h3> </th> <th width="120"> <h3 class="subtitle">Name</h3> </th> <th width="120"> <h3 class="subtitle">You Get</h3> </th> <th width="120"> <h3 class="subtitle">They want</h3> </th><th width="80"> <h3 class="subtitle">Action</h3> </th>
  </tr>

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.