I have searched a lot and can't seem to find what I am looking for.
I have a .js
field, and I really need help with some php code
in side it. I have no idea how to put them together and would really appreciate some help.
The Javascript code(This code is inside the js file):
<span class="gravatar"><img src="',params.gravatar, '" width="23" height="23" onload="this.style.visibility=\'visible\'" />
where the <img src="',params.gravatar,'">
I want to add:
<?php
$con=mysqli_connect("localhost","root","","facebook");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM login WHERE username='$username'");
$username = $_SESSION['username'];
while($row = mysqli_fetch_array($result))
{
echo $row['profilepic'];echo "<br>";
mysqli_close($con);
}
?>
Insted of ,params.gravatar,
<img src="<?php echo $row['profilepic']; ?>" />
– Shomz Jun 21 '13 at 18:54