simzam Posted December 21, 2010 Share Posted December 21, 2010 i'm having issue related getting URL content properly FB:LIKE first link work properly but other links wouldn't work properly mypage.php code is simple mysql connectivity $httplink = "localhost/mypage.php?mypage=" ; while($row = mysql_fetch_assoc($rs)) { echo "<tr>"; echo "<td> {$row['id']}</td>"; echo "<td><fb:like href=\"{$httplink}{$row['id']}\" layout=\"button_count\" show_faces=\"false\" width=\"100\" font=\"tahoma\" colorscheme=\"dark\"></fb:like></td>"; echo "<td> {$row['title']} </td>" ; echo "<td> <a href =\"{$row['http']}{$row['link']}\" target = \"_blank\" >{$row['http']}{$row['link'] }</a> </td>" ; echo "</tr>"; } mypage.php : <?php $link = mysql_connect('localhost', 'root', '1234'); if (!$link) die('Could not connect: ' . mysql_error()); $status = mysql_select_db('fblike', $link ); if(!$status) die("Failed to select database!"); if (!empty($_GET['mypage'])) { $result = mysql_query("SELECT * FROM mytable WHERE id={$_GET[mypage']} "); if (!$result) die('Invalid query: ' . mysql_error()); $rows = mysql_fetch_row($result); echo "<html>"; echo "<head>"; echo "<title>{$rows[1]} </title>"; echo "</head>"; echo "<body>"; echo "{$rows[1]} "; echo "</body>"; echo "</html>"; } mysql_close($link); ?> Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted December 21, 2010 Share Posted December 21, 2010 that code doesn't parse Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ']' in /Users/lesbrown/Sites/site1/phpFreaks/test.php on line 9 are you not getting this syntax error? if not, you need to turn on error_reporting. Quote Link to comment Share on other sites More sharing options...
simzam Posted December 21, 2010 Author Share Posted December 21, 2010 above code is part of script and its not giving any error i having problem getting URL content bec it get it from database Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted December 21, 2010 Share Posted December 21, 2010 mypage.php will not parse. it will not work at all as it is posted. do you have a version that will parse without error? Quote Link to comment Share on other sites More sharing options...
simzam Posted December 21, 2010 Author Share Posted December 21, 2010 no errors at all mypage.php is successfully connected and fetch im not getting any errors and its exactly same code above im running Quote Link to comment Share on other sites More sharing options...
simzam Posted December 21, 2010 Author Share Posted December 21, 2010 try this ! now it will not give any error <?php error_reporting(-1) ; $link = mysql_connect('localhost', 'root', 'redrose'); if (!$link) die('Could not connect:' . mysql_error()) ; $status = mysql_select_db('fblike', $link ); if(!$status) die("Failed to select database!"); if (!empty($_GET['mypage'])) { $result = mysql_query("SELECT * FROM mytable WHERE id={$_GET['mypage']} "); if (!$result) die('Invalid query: ' . mysql_error()); $rows = mysql_fetch_row($result); echo "<html>"; echo "<head>"; echo "<title>{$rows[1]} </title>"; echo "</head>"; echo "<body>"; echo "{$rows[1]} "; echo "</body>"; echo "</html>"; } mysql_close($link); ?> 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.