यह वास्तव में सिर्फ बीबीबी के जवाब का एक विस्तार है जो मेरे प्रयोग काम कर पाने के लिए करने के लिए नेतृत्व है।
यह स्क्रिप्ट बस "ओपन स्क्रिप्ट" कहने वाले बटन पर क्लिक करते समय एक फ़ाइल/tmp/testfile बनायेगी।
इसके लिए 3 फाइलों की आवश्यकता है।
- एक बटन के साथ वास्तविक HTML वेबसाइट।
- एक PHP स्क्रिप्ट जो स्क्रिप्ट
- एक स्क्रिप्ट
फ़ाइल ट्री कार्यान्वित:
[email protected]:/var/www/html# tree testscript/
testscript/
├── index.html
├── testexec.php
└── test.sh
1. मुख्य वेबपेज:
[email protected]:/var/www/html# cat testscript/index.html
<form action="/testscript/testexec.php">
<input type="submit" value="Open Script">
</form>
2. पीएचपी पृष्ठ है कि स्क्रिप्ट चलाता है और वापस मुख्य पृष्ठ पर रीडायरेक्ट:
[email protected]:/var/www/html# cat testscript/testexec.php
<?php
shell_exec("/var/www/html/testscript/test.sh");
header('Location: http://192.168.1.222/testscript/index.html?success=true');
?>
3।स्क्रिप्ट:
[email protected]:/var/www/html# cat testscript/test.sh
#!/bin/bash
touch /tmp/testfile
क्या आप उपयोगकर्ता की मशीन या सर्वर पर स्क्रिप्ट चलाने की कोशिश कर रहे हैं? सर्वर पर – Mat
। मैं डेबियन – dukevin
@Mat चला रहा हूं उपयोगकर्ता की मशीन पर स्क्रिप्ट चलाने के मामले के बारे में क्या? – iwantmyphd