Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP/Javascript passing message to another page
    text
    copied!<p>So let me explain:</p> <p>I basically want so when you post a comment, (i use a js/jquery script to send string to insert.php which inserts to the database) you will receive 2+ points. Now i have done so you get +2 points, BUT i want to display a message like stackoverflow. I already know how to display a message like stackoverflow, but in somehow i need to send from insert.php(after you inserted), this:</p> <pre><code>&lt;div id='message' onclick="closeNotice()" style="display: none;"&gt; Hey, &lt;b&gt;&lt;? echo $pusername; ?&gt;&lt;/b&gt; - You've just got +&lt;? echo $gpm; ?&gt; points for your comment! &lt;a href="#" class="close-notify" onclick="closeNotice()"&gt;X&lt;/a&gt; &lt;/div&gt; </code></pre> <p>to index.php..</p> <p>I was thinking of maybe coding into my current script(that are sending string to insert.php) that it should find #message and throw it in #box (div called "box" in index.php).</p> <p>But how should i do this? Should i like, after you got through insert.php, then you activate a function in javascript that does: </p> <pre><code>function showmessage() { $("#box").html(data).find("#message").fadeIn("slow") } </code></pre> <p>and as i said you activate the script doing:</p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; showmessage(); &lt;/script&gt; </code></pre> <p>after you succesfully have inserted to database and gived points to the user? Ive just tested this, and i cant get it to work. my site is integrated with sessions from the phpBB login (phpBB forum i've got), so i don't think i can use $_SESSION. And the insert.php is opened in a frame. My problem is that the action, and the displaying of the confirmation take place on different pages.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload