I've searched a lot and can not find what I'm looking for.
I have a Javascript code (this code is inside the JS file): I want to add: setting, params.gravatar, I accept you Which means that the HTML snippet you are posting is inside a separate JS file. If this is the case, then you can assign a profile picture url to your PHP code in the global JS variable: Your PHP file: and your .js field, and I really need help with some
php code I do not know how to get them together And really will appreciate some help.
& lt; Span class = "Gravatar" & gt; & Lt; Img src = "'params.gravatar," "width =" 23 "height =" 23 "onload =" this.style.visibility = \' visible \ "/> < P> Where
& lt; img src = "', params.gravatar," "& gt;
& lt ;? 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 $ line ['profiles']; Echo "& lt; br & gt;"; Mysqli_close ($ thief); }? & Gt;
& lt ;? Php // your DB call code goes here ...? & Gt; & Lt; Script & gt; Var ProfilePic = '& lt ;? = $ Row ['Profile']? & Gt; '; & Lt; / Script & gt; & Lt; Script src = "/ your / jsfile.js" & gt; & Lt; / Script & gt;
jsFile.js :
var img = '& lt; Span class = "gravatar" & gt; & Lt; IMG src = "'+ + ProfilePic +" "width =" 23 "height =" 23 "/>';
No comments:
Post a Comment