PHP jQuery code mix -


If someone takes time to read my code then I would be very grateful and I got the variable $ kakka in the script below So that it does not work anymore $ kakka has no value because php code is below sorry, i do not understand anything about jquery, but i need to do this function work.

Markup and jQuery

  & lt; Head & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = utf-8" & gt; & Lt; Script src = "http://code.jquery.com/jquery-latest.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; Var refreshId = setInterval (function () {$ ('# puu'). Feid ("slow"). FadeIn ("slow");}, 5000); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt;  

PHP

  & lt ;? Php $ rs = mysql_query ("Choose * from id = '$ _ session [user_id]'); while ($ line = mysql_fetch_array ($ rs)) {$ starter = $ line ['id']; $ user_name = $ String ['user_name'];} $ starter id = $ starter; $ CompanyID = $ _ receive ['id']; $ input = $ _POST ['viesti']; date_default_timezone_set ('Europe / Helsinki'); $ timestamp = Date ('h: i', time ()); $ file = $ companyID. "And" .starterID. " Txt "; if (file_exists ($ file)) {$ kakka = $ companyID." And "$ StarterID." Txt ";} and {$ kakka = $ starterID." And ". $ CompanyID." Txt ";} $ Current = file_get_contents ($ kakka); if (isset ($ _ POST ['viesti']) and $ _POST ['viesti'] = = null) {$ streams = $ current" & lt; B & gt; $ User_name & lt; / B & gt; & Lt; Br> $ Input $ timestamp \ n & lt; Br> "$ Shipuli =" & lt; B & gt; $ User_name & lt; / B & gt; & Lt; Br> $ Input $ timestamp \ n & lt; Br> "; File_put_contents ($ kakar, $ streams);} resonance '& lt; div id =" puu "& gt;' $ current. $ Shipuli. '& Lt; / div & gt;'; & Gt;  

  & lt; php $ rs = mysql_query ("selection * * $ User_name = $ row ['user_name']; $ user = '$ user_name = $ row [user_id]';); ($ line = mysql_fetch_array ($ rs) ];} $ Starter id = $ starter; $ CompanyID = $ _ receive ['id']; $ input = $ _POST ['viesti']; date_default_timezone_set ('Europe / Helsinki'); $ timestamp = date ('h: i ', Time ()); $ File = $ companyID. "And". $ StarterID. ".txt"; If (file_exists ($ file)) {$ kakka = $ companyID. "And" $ StarterID. " Txt ";} and {$ kakka = $ starterID." And ". $ CompanyID." Txt ";} $ Current = file_get_contents ($ kakka); if (isset ($ _ POST ['viesti']) and $ _POST ['viesti'] = = null) {$ streams = $ current" & lt; B & gt; $ User_name & lt; / B & gt; & Lt; Br> $ Input $ timestamp \ n & lt; Br> "$ Shipuli =" & lt; B & gt; $ User_name & lt; / B & gt; & Lt; Br> $ Input $ timestamp \ n & lt; Br> "; File_put_contents ($ kakar, $ streams);} resonance '& lt; div id =" puu "& gt;' $ current. $ Shipuli. '& Lt; / div & gt;'; & Gt; & lt; top & gt; & gt; Meta http-equiv = "content-type" content = "text / html; Charset = utf-8 "& gt; & lt; script src =" http://code.jquery.com/jquery-latest.js ">  gt; & lt; script & gt; Fade In ("slow"). Text ('& lt ;? php echo $ kakka;? & Gt;') FadeIn ("slow");}, 5000); & lt; / script & gt; & lt; / Head> Body & gt;  

Keep some things in mind

  • Mysql_query is deprecated < / Li>
  • The latest use of jquery is not recommended in production

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -