php - If condition not checking the condition -


  समारोह pokemon2 () {include 'details.php'; $ क्षति = $ _POST ['हमला']; $ Oppo_health = $ _SESSION ['oppo_health']; अगर ($ oppo_health & lt; 0) {गूंज "मर गया!"; } और {$ oppo_path = $ _SESSION ['पथ']; गूंज "& lt; br / & gt;"; गूंज $ oppo_path; गूंज "& lt; br / & gt;"; $ Oppo_health = $ oppo_health - $ क्षति; गूंज $ oppo_health; $ _SESSION ['हमले'] = $ क्षति; $ _SESSION ['oppo_health'] = $ oppo_health; }}   

यदि कोड $ oppo_health 0 से नीचे जाता है तो कोड 'मर गया' प्रदर्शित होना चाहिए! लेकिन ऐसा नहीं होना चाहिए जैसा कि यह होना चाहिए ?? तर्क सही है और कोई भी त्रुटि दिखाई नहीं दे रही है।

आपको session_start () विधि का प्रयोग करके एक सत्र शुरू करने की आवश्यकता है।

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c++ - Redefined variable in the other module -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -