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
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?

Link to comment
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?

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.