MySQL Forums
Forum List  »  PHP

Forms - $PHP_SELF - how to access variable -- URGENT!!!
Posted by: Salim Vayalkeloth
Date: December 28, 2005 06:40PM

This is a repeat posting...

Hi,

I have a very basic question pertaining to the piece of code pasted below. I need to play around and manipulate value of field <$num_main_cols> inside EXTERNAL file <gh_do_query.php>. How do I do this? How do I get the value chosen for field <$num_main_cols> into EXTERNAL file <gh_do_query.php>?

What change should I make to the code pasted below in order to do this..or is there something else I need to do with the .php file?

A gentleman in this forum suggested that I use the $_SERVER['PHP_SELF'] --> but when I use it in the script all it does is return the absolute path to the script in which I use this? Instead what I need is the chosen value of field <$num_main_cols>..I think I am missing somethign here..please help....basically I think I have't properly understood the concept of passing field values from a form back to a script......

*****************CODE STARTS HERE****************************
if (empty($num_main_cols)) { //detemines if the variable passed is empty
$num_main_cols = 5;
}
//passing method in below line is SELF
echo "<form name=\"choose_max_cols\" method=\"post\" action=\"" . $PHP_SELF . "max_col_update\">\n";
echo "<font size='3' face='verdana'>";
echo "<B>Choose number of Die-Rev Combination</B>";
echo "<select name=num_main_cols size=1 onchange=\"this.form.submit();\">";
for ($i = 1; $i < 6 ; $i++) {
echo "<option value=\"$i\"";
if ($i == $num_main_cols) {
echo " selected ";
}
echo ">$i\n";
}
echo "</select>";
echo "</form>\n";
echo "<form name=\"query\" action=\"gh_do_query.php\" method=post>";
*****************CODE ENDS HERE****************************

Options: ReplyQuote


Subject
Written By
Posted
Forms - $PHP_SELF - how to access variable -- URGENT!!!
December 28, 2005 06:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.