943,982 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 6604
  • PHP RSS
Nov 30th, 2005
0

JS Confirm in PHP

Expand Post »
Hi, i have a php script form, and i want to use the js confirmation alert, the problem is, this

echo "<script>
var yes=confirm('warever you want');
if (yes){}<---here i want to plase something in php code
else{}
</script>";

$confirm='yes'
how can i math bouth codes?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Zill is offline Offline
2 posts
since Nov 2005
Nov 30th, 2005
0

Re: JS Confirm in PHP

JavaScript is a client-side technology and PHP is a server-side technology. This means that the JavaScript code executes on the browser and the PHP code executes on the server. You cannot have server-side code execute based upon the logic executed by the client-side code, at least, not directly.

It would seem that you are wanting to do a check for the functionality of JavaScript. Is this correct? If so, there are many ways to do this, but none of them involve PHP.
Reputation Points: 38
Solved Threads: 25
Posting Shark
chrisbliss18 is offline Offline
902 posts
since Aug 2005
Sep 28th, 2010
0
Re: JS Confirm in PHP
PHP Syntax (Toggle Plain Text)
  1. <script type="text/javascript">
  2. function confirmation()
  3. {
  4. var yes = confirm("you want to delete record");
  5. if(yes)
  6. {
  7. return ture;
  8. }
  9. else
  10. {
  11. return false;
  12. }
  13. }
  14. </script>

note:-
PHP Syntax (Toggle Plain Text)
  1. <input type="submit" name="delete" value="delete" onclick="confirmation()" />
Last edited by Ezzaral; Sep 28th, 2010 at 12:43 pm. Reason: Added code tags. Please use them to format any code that you post.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Ithisham is offline Offline
1 posts
since Sep 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: upload and display images
Next Thread in PHP Forum Timeline: duplicates





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC