Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I have real problems getting this PHP-script "search.php" that is called from a "form.htm" to work. What am I doing wrong here?
php $old_path = getcwd(); chdir('/var/www/html/SOKHJALPMEDEL/'); $term1 = $_POST['query1']; $argument1 = $_GET['$term1']; $term2 = $_POST['query2']; $argument2 = $_GET['$term2']; echo $nu_kor_vi1; $outcome = shell_exec("sokare $argument1 $argument2"); chdir($old_path); echo "$outcome"; ?>
$outcome
The script is calling a Bash-script "sokare" that is executable systemwide and residning in "/usr/local/bin". The variables $argument1 and $argument2 are passed from the "form.htm" via $term1 = $_POST['query1']; and $term2 = $_POST['query2']; . The Bash-script looks like this. It is supposed to search any PDF-files residing in "/var/www/html/SOKHJALPMEDEL/" for pages containing both searchwords.
#!/bin/bash pdfgrep -Hn $1 /var/www/html/SOKHJALPMEDEL/*.pdf | cut -f1,2 -d':' > /tmp/sok1.tmp pdfgrep -Hn $2 /var/www/html/SOKHJALPMEDEL/*.pdf | cut -f1,2 -d':' > /tmp/sok2.tmp grep -f /tmp/sok1.tmp /tmp/sok2.tmp exit 0
I keep on getting this error in "/var/log/apache2/error.log" : PHP Notice: Undefined index: $term2 in /var/www/html/SOKHJALPMEDEL/search.php on line 7, referer: http://localhost/SOKHJALPMEDEL/form.htm
Any help clearing my mess up is beautiful:-)
/Paul
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 10 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 9 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.