Jump to content

[SOLVED] Get not being sent


mikesta707

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/173914-solved-get-not-being-sent/
Share on other sites

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?

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

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.