php pop up message

Copy Code<?php
function  createConfirmationmbox(){
    echo '<script type="text/javascript"> ';
    echo 'var inputname = prompt("Please enter your name", "");';
    echo 'alert(inputname);';
    echo '</script>';
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Prompt Box by PHP</title>
<?php
    createConfirmationmbox();
?>
</head>
<body>
</body>
</html>

4
2
Yola 90 points

                                    Copy Code&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;JavaScript Alert Box by PHP&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot;&gt; &nbsp;function openulr(newurl) { &nbsp;if (confirm(&quot;Are you sure you want to open new URL&quot;)) { &nbsp; &nbsp;document.location = newurl; &nbsp;}}&lt;/script&gt;&lt;/head&gt;
&lt;body&gt;
&lt;strong&gt;&lt;a href=&quot;javascript:openulr('newurl.html');&quot;&gt;Open new URL&lt;/a&gt;&lt;/strong&gt;
&lt;/body&gt;
&lt;/html&gt;

4 (2 Votes)
0
3.89
9
Zaxvo 105 points

                                    Copy Code&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;JavaScript Alert Box by PHP&lt;/title&gt;
&lt;?php &nbsp;
echo '&lt;script type=&quot;text/javascript&quot;&gt;';
echo ' alert(&quot;JavaScript Alert Box by PHP&quot;)'; &nbsp;//not showing an alert box.
echo '&lt;/script&gt;';
?&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;

3.89 (9 Votes)
0
4
7
Unohu 115 points

                                    Copy Code&lt;?php
function &nbsp;createConfirmationmbox(){
&nbsp; &nbsp; echo '&lt;script type=&quot;text/javascript&quot;&gt; ';
&nbsp; &nbsp; echo ' function openulr(newurl) {';
&nbsp; &nbsp; echo ' &nbsp;if (confirm(&quot;Are you sure you want to open new URL&quot;)) {';
&nbsp; &nbsp; echo ' &nbsp; &nbsp;document.location = newurl;';
&nbsp; &nbsp; echo ' &nbsp;}';
&nbsp; &nbsp; echo '}';
&nbsp; &nbsp; echo '&lt;/script&gt;';
}
?&gt;
&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;JavaScript Alert Box by PHP&lt;/title&gt;
&lt;?php
createConfirmationmbox();
?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;strong&gt;&lt;a href=&quot;javascript:openulr('newurl.html');&quot;&gt;Open new URL&lt;/a&gt;&lt;/strong&gt;
&lt;/body&gt;
&lt;/html&gt;

4 (7 Votes)
0
3.33
3
DVyper 85 points

                                    Copy Code&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;JavaScript Alert Box by PHP&lt;/title&gt;
&lt;?php
function_alert(&quot;We welcome the New World&quot;);

function function_alert($msg) {
&nbsp; &nbsp; echo &quot;&lt;script type='text/javascript'&gt;alert('$msg');&lt;/script&gt;&quot;;
}
?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;

3.33 (3 Votes)
0
3.5
2
Jack Woods 80 points

                                    Copy Code&lt;script Type=&quot;javascript&quot;&gt;alert(&quot;JavaScript Alert Box by PHP&quot;)&lt;/script&gt;

3.5 (2 Votes)
0
3
1
Falc 85 points

                                    Copy Code&lt;script type=&quot;text/javascript&quot;&gt; var inputname = prompt(&quot;Please enter your name&quot;, &quot;&quot;);alert(inputname);&lt;/script&gt;&lt;/head&gt; 

3 (1 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source