Jump to content

url not loading content Help needed !


simzam

Recommended Posts

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);

?>

Link to comment
https://forums.phpfreaks.com/topic/222316-url-not-loading-content-help-needed/
Share on other sites

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.

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);
?>

 

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.