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

c++ - Cmake produces file extensions in static library archives -

c# - Roxy file manager in MVC doesn't accept session path -

c# - XML - Serialize class - Some questions -