mikesta707 Posted September 11, 2009 Share Posted September 11, 2009 I'm so confused right now. I'm trying to do something very simple. I have a form, of type get, that is supposed to work. it looks like this $get ="<form name=\"getForm\" method=\"get\" action=\"".$action."\"> <input type=\"text\" name=\"".$getID."\" id=\"".$getID."\" /> <input type=\"submit\" value=\"".$value."\" /> </form>"; //added line breaks for clarity When I submit this its not sending anything. The variables are set, and it looks like its supposed to. On my specific page, it looks like this <form name="getForm" method="get"> <input type="text" name="tableName" id="tableName" /> <input type="submit" value="Change Table" /> </form> I create these gets with a function I have, that looks like this public function createGet($getID, $value = "Submit", $action = null){ if (!$action){ $get = "<form name=\"getForm\" method=\"get\"><input type=\"text\" name=\"".$getID."\" id=\"".$getID."\" /><input type=\"submit\" value=\"".$value."\" /></form>"; } else { $get = "<form name=\"getForm\" method=\"get\" action=\"".$action."\"><input type=\"text\" name=\"".$getID."\" id=\"".$getID."\" /><input type=\"submit\" value=\"".$value."\" /></form>"; } echo $get; } On a different page I use this function, with slightly different variables than I use in the one that isn't working, and it works perfectly. I'm so confused right now, and angry. Does someone see anything wrong? Quote Link to comment https://forums.phpfreaks.com/topic/173914-solved-get-not-being-sent/ Share on other sites More sharing options...
iPixel Posted September 11, 2009 Share Posted September 11, 2009 isnt your form missing action="phpfilename.php" ? Quote Link to comment https://forums.phpfreaks.com/topic/173914-solved-get-not-being-sent/#findComment-916773 Share on other sites More sharing options...
PFMaBiSmAd Posted September 11, 2009 Share Posted September 11, 2009 When I submit this its not sending anything How do you know that? Does the URL that is requested contain the ?tableName=xxxx value? What is the code on your page that is using the $_GET['tableName'] variable? Is there any chance of nested <form></form> tags as that would make your HTML invalid? And you do know that without an action="" attribute that the request is for the current page? Quote Link to comment https://forums.phpfreaks.com/topic/173914-solved-get-not-being-sent/#findComment-916775 Share on other sites More sharing options...
mikesta707 Posted September 11, 2009 Author Share Posted September 11, 2009 When I submit this its not sending anything How do you know that? Does the URL that is requested contain the ?tableName=xxxx value? What is the code on your page that is using the $_GET['tableName'] variable? Is there any chance of nested <form></form> tags as that would make your HTML invalid? And you do know that without an action="" attribute that the request is for the current page? yes there is no ?tableName=xxxx value. there is one line, that is as follows that uses the get $table = (isset($_GET['tableName']) && !empty($_GET['tableName'])) ? "'".$_GET['tableName']."'" : 'STG_LPS_INCOME'; nope no nested form tags. and yes I do realize that the action tag is missing, and this is what I want. I seem to be getting an unrelated error however which is leading things to fail. Hold on a bit let me tinker with it Quote Link to comment https://forums.phpfreaks.com/topic/173914-solved-get-not-being-sent/#findComment-916788 Share on other sites More sharing options...
mikesta707 Posted September 11, 2009 Author Share Posted September 11, 2009 ok nevermind. I realize what happened. this line $table = (isset($_GET['tableName']) && !empty($_GET['tableName'])) ? "'".$_GET['tableName']."'" : 'STG_LPS_INCOME'; was messing up my oracle query, which I guess decided to destroy everything else on the page. I changed to this $table = (isset($_GET['tableName']) && !empty($_GET['tableName'])) ? $_GET['tableName'] : 'STG_LPS_INCOME'; and it worked fine. phew crisis averted Quote Link to comment https://forums.phpfreaks.com/topic/173914-solved-get-not-being-sent/#findComment-916789 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.