dingleberry
Programmer
Hey All, I recently installed php 4.3.0 on my bsd server running apache as a module. I think I have done something wrong because I have a form called search.html using fields named "searchtype" and "searchterm" being posted to this php file called results.php. Now I think .php files are being parsed because <? echo "hello world"; ?> works like a champ in printing hello world to my browser when I call it however I'm having a helluva time getting much further. basically just to test that my form names are being sent over I am using
<?
echo "$searchtype";
echo "$searchterm";
?>
in my results.php thinking it will display the contents of those variables but to no avail... I then tried declaring them like
$HTTP_POST_VARS["searchtype"];
$HTTP_POST_VARS["searchterm"];
before echoing them and still nothing. I'm stumped. I've even gone into my /usr/local/etc/php.ini-dist file and changed register_globals to On and then did a
/usr/local/sbin/apachectl restart
and still nothing. I'm really confused. Any ideas? For some reason, the form is not sending over the variables. attached is a copy of the .html file and the .php file. They are both in the same directory.
(search.html)
<html>
<head>
<title>Book-O-Rama Catalog Search</title>
</head>
<body>
<h1>Book-O-Rama Catalog Search</h1>
<form action="results.php" method="post">
Choose Search Type:<br>
<select name="searchtype">
<option value="author" selected>author</option>
<option value="title">title</option>
<option value="isbn">isbn</option>
</select>
<br>
Enter Search Term:<br>
<input type="text" name="searchterm" size="20" maxlength="20">
<br>
<input type=submit value="Search">
</form>
</body>
</html>
and results.php
<?
$HTTP_POST_VARS["$searchterm"];
$HTTP_POST_VARS["$searchtype"];
echo "$searchterm";
echo "$searchtype";
?>
sorry about the 10 page post. I'm just a little baffled. Any help would be hugely appreciated. Also, does changing php.ini-dist change anything, or am I changing the wrong file alltogether.
-Dan
<?
echo "$searchtype";
echo "$searchterm";
?>
in my results.php thinking it will display the contents of those variables but to no avail... I then tried declaring them like
$HTTP_POST_VARS["searchtype"];
$HTTP_POST_VARS["searchterm"];
before echoing them and still nothing. I'm stumped. I've even gone into my /usr/local/etc/php.ini-dist file and changed register_globals to On and then did a
/usr/local/sbin/apachectl restart
and still nothing. I'm really confused. Any ideas? For some reason, the form is not sending over the variables. attached is a copy of the .html file and the .php file. They are both in the same directory.
(search.html)
<html>
<head>
<title>Book-O-Rama Catalog Search</title>
</head>
<body>
<h1>Book-O-Rama Catalog Search</h1>
<form action="results.php" method="post">
Choose Search Type:<br>
<select name="searchtype">
<option value="author" selected>author</option>
<option value="title">title</option>
<option value="isbn">isbn</option>
</select>
<br>
Enter Search Term:<br>
<input type="text" name="searchterm" size="20" maxlength="20">
<br>
<input type=submit value="Search">
</form>
</body>
</html>
and results.php
<?
$HTTP_POST_VARS["$searchterm"];
$HTTP_POST_VARS["$searchtype"];
echo "$searchterm";
echo "$searchtype";
?>
sorry about the 10 page post. I'm just a little baffled. Any help would be hugely appreciated. Also, does changing php.ini-dist change anything, or am I changing the wrong file alltogether.
-Dan