combining PHP with JS
| From: | Grega Leskovšek | Date: | Wed, 20 Apr 2011 15:48:48 +0000 |
| Subject: | combining PHP with JS | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-312459@lists.php.net to get a copy of this message | ||
I have case sentences in PHP and on certain step I want to ask user if
he wants to save the file.
IF this is true I would do nothing, but if he doesn't want to save it
I want to trigger break; in PHP not to do the next case sentence where
I save the file.
I've tried this, but it wouldn't even trigger confirm and I do not
know where is/are mistake-s?
Please help me. Here is an excerpt:
<?php
case 'm': #change mode ->that's autosave
$changeMode = $_SESSION['adminType'];
$_SESSION['adminType']=$userType;
?>
<script type="text/javascript">
var answerSave = confirm("Save?");
if (!answerSave){
<?php
break;
?>
}
</script>
<?php
case 's': #start of save file
-- When the sun rises I receive and when it sets I forgive ->
http://moj.skavt.net/gleskovs/
Always in Heart, Grega Leskovšek