hi all,
could you show me php code to display a message box (similar to alert("..") function in html)?
E.g.
<?php
if(isset($_POST['form_Submit']))
{
alert('Is sent by submit button');//message box
}
?>
acturally, my purpose is for contacting to mysql, if the user doesn't exist, php will show a message box - anyway, code above is simple.
thanks
how to display a message box in php (newbie)?
Moderator: General Moderators
-
php12342005
- Forum Commoner
- Posts: 79
- Joined: Mon Mar 21, 2005 3:35 am
Code: Select all
if( isset($_POST['form_Submit']) )
{
echo '<script language="javascript">alert(\'Rwar\')</script>';
}Code: Select all
if( isset($_POST['form_Submit']) )
{
echo <<<JAVASCRIPT
<script language="javascript">alert('Rwar')</script>
JAVASCRIPT;
}OR if you wish to make it a bit more standards compliant HTML
Code: Select all
<?php
if(isset($_POST['form_Submit']))
{
echo <<<JAVASCRIPT
<script type="text/javascript">
document.onLoad=alert('Rwar')
</script>
<noscript><p>Rwar</p></noscript>
JAVASCRIPT;
}
?>