This topic is locked
[SOLVED]

 Pass values to another table

10/27/2015 7:51:57 AM
PHPRunner General questions
lefty author

I have a table with a field set to custom (fldcategory) . I have this code in the custom field ( view as )

$value = "<a href='Book_Display_add.php?&fldcategory='".$data["fldcategory"]."'&fldavail='".$data["Pos"]."'>Book This Display</a>";
I have both default values on the add page to be $_REQUEST["fldcategory"] for fldcategory field and $_REQUEST["Pos"] for fldavail field. ( fields are same values in main table as in dropdowns on other table dropdowns )
When I click on the link to the add page in other table the fields do not get filled.
The URL looks like this when clicking hyperlink.
http: disregard this so link does not show //www.mywebsite.com/output/Book_Display_add.php?&fldcategory= NOTHING HERE Also tried without & in url and only one field but same issue

just fldcategory= Nothing here . If I manually type in the url with values on the add page as a test the two dropdowns fill in.
These fields are dropdowns on the add page fldcategory is the first dropdown and fldavail is dependant on fldcategory. Is this why they won't fill . Also tried $_GET["fldcategory"] as default . URL goes to add page but no dropdowns are filled in.

lefty author 11/13/2015



I have a table with a field set to custom (fldcategory) . I have this code in the custom field ( view as )

$value = "<a href='Book_Display_add.php?&fldcategory='".$data["fldcategory"]."'&fldavail='".$data["Pos"]."'>Book This Display</a>";
I have both default values on the add page to be $_REQUEST["fldcategory"] for fldcategory field and $_REQUEST["Pos"] for fldavail field. ( fields are same values in main table as in dropdowns on other table dropdowns )
When I click on the link to the add page in other table the fields do not get filled.
The URL looks like this when clicking hyperlink.
http: disregard this so link does not show //www.mywebsite.com/output/Book_Display_add.php?&fldcategory= NOTHING HERE Also tried without & in url and only one field but same issue

just fldcategory= Nothing here . If I manually type in the url with values on the add page as a test the two dropdowns fill in.
These fields are dropdowns on the add page fldcategory is the first dropdown and fldavail is dependant on fldcategory. Is this why they won't fill . Also tried $_GET["fldcategory"] as default . URL goes to add page but no dropdowns are filled in.


Anyone have any ideas how to pass two fields from another table from a list page with a hyperlink? I know this has been done before . Just can't get it to work . I use dropdowns on table I am passing values to. But they match. dependancy.

HJB 11/14/2015

@John, I found this under http://stackoverflow.com/questions/4854754/how-to-set-a-session-variable-when-clicking-a-a-link
the basic code for the form is:
<form enctype="multipart/form-data" action="page-to-pass-to.php" method="post">

<input type="hidden" name="post-variable-name" value="value-you-want-pass"/>

<input type="submit" name="whatever" value="text-to-display" id="hyperlink-style-button"/>

</form>
the basic css is:

hyperlink-style-button{

background:none;

border:0;

color:#666;

text-decoration:underline;

}


hyperlink-style-button:hover{

background:none;

border:0;

color:#666;

text-decoration:none;

cursor:pointer;

cursor:hand;

}



HTH

lefty author 11/15/2015



@John, I found this under http://stackoverflow.com/questions/4854754/how-to-set-a-session-variable-when-clicking-a-a-link
the basic code for the form is:
<form enctype="multipart/form-data" action="page-to-pass-to.php" method="post">

<input type="hidden" name="post-variable-name" value="value-you-want-pass"/>

<input type="submit" name="whatever" value="text-to-display" id="hyperlink-style-button"/>

</form>
the basic css is:

hyperlink-style-button{

background:none;

border:0;

color:#666;

text-decoration:underline;

}

hyperlink-style-button:hover{

background:none;

border:0;

color:#666;

text-decoration:none;

cursor:pointer;

cursor:hand;

}
HTH


I took a look at it but with phprunner . the link is going to the add page and needs two dropdowns filled in . The code above would work , but it seems the dropdowns take over the autofill . and keep blank even with default values set to _Get or _Request. THey are just plain blank. Can do with on parameter to a text field . works fine . just not two parameters and them two being a dropdown.

I am trying to use same values on a custom view say a photo . Now the Item picked field and the category field is on this custom view page and the other table . I want them to see the image and then select the hyperlink which is over URL to the item field and category field. Like this
this is the value of one of the fields and set as custom view . basically just says book this.

$value = "<a href='Book_Display_add.php?&fldcategory='".$data["fldcategory"]."'&fldavail='".$data["Pos"]."'>Book This Display</a>";

I setup those fields as default _Get["fldcategor"] or tried _request["fldcagategory"] and same for fldavail , but the dropdowns for fldcategory and fldavail do not fill in when hyperlinking to that add page .

lefty author 11/22/2015



I took a look at it but with phprunner . the link is going to the add page and needs two dropdowns filled in . The code above would work , but it seems the dropdowns take over the autofill . and keep blank even with default values set to _Get or _Request. THey are just plain blank. Can do with on parameter to a text field . works fine . just not two parameters and them two being a dropdown.

I am trying to use same values on a custom view say a photo . Now the Item picked field and the category field is on this custom view page and the other table . I want them to see the image and then select the hyperlink which is over URL to the item field and category field. Like this
this is the value of one of the fields and set as custom view . basically just says book this.

$value = "<a href='Book_Display_add.php?&fldcategory='".$data["fldcategory"]."'&fldavail='".$data["Pos"]."'>Book This Display</a>";

I setup those fields as default _Get["fldcategor"] or tried _request["fldcagategory"] and same for fldavail , but the dropdowns for fldcategory and fldavail do not fill in when hyperlinking to that add page .


Anyone ever try to use hyperlink from another custom view to fill in data from same table to an add page in another view that was dependant dropdowns and was dependant on the first dropdown. I used both paremeters for the both dropdowns and cannot for the life of me understand why it won't fill in? see above example.

Admin 11/23/2015

I don't think anyone can answer this by just looking at this description. You need to have an access to the application in order to see what might.
I can only explain the basics of passing values via URL. It works in PHPRunner exactly the same way it works in any other web application. First, you pass some values via URL. Second you read those values on receiving page and do something with it.
Here is the typical URL with parameters:

somepage.php?value1=somevalue&value2=someothervalue


Now on somepage.php you can use $_GET["value1"] and $_GET["value2"]. So you need to make sure that:

  1. Correct URL with parameters in it is created
  2. You doing something with it on somepage.php. In case of PHPRunner you can $_GET["value1"] in any of that page events or as a default value.

lefty author 11/27/2015



I don't think anyone can answer this by just looking at this description. You need to have an access to the application in order to see what might.
I can only explain the basics of passing values via URL. It works in PHPRunner exactly the same way it works in any other web application. First, you pass some values via URL. Second you read those values on receiving page and do something with it.
Here is the typical URL with parameters:

somepage.php?value1=somevalue&value2=someothervalue


Now on somepage.php you can use $_GET["value1"] and $_GET["value2"]. So you need to make sure that:

  1. Correct URL with parameters in it is created
  2. You doing something with it on somepage.php. In case of PHPRunner you can $_GET["value1"] in any of that page events or as a default value.



Thanks admin for the info, but I do understand how to pass one value via link to add page . It seems it's two values that is not working . I'm trying to pass a field called link with a custom view on the list page of another table setup as
$value = "<a href=Book_Display_add.php?VALUE1='".$data["VALUE1"]."'&VALUE2='".$data["VALUE2"]."'>LINK HERE</a>";
When the link is pressed and goes to add page of another table , Nothing fills The two fields on the add page ( default value of fields is indeed now $_GET["VALUE1"] and the other one default value is $_GET["VALUE2"]
I have tested this with just two text fields and it works fine. The two fields that need to be filled are dropdowns VALUE2 is Dependant on VALUE1. ( That seems to be the problem ) As I can fill Value1 but Not VALUE2. On the table with the link the field VALUE2 matches the dependancy of VALUE1 so it should fill , but it does not. I can get VALUE1 to fill if I take out VALUE2 part of link. ( the only other thing I see is there are spaces in VALUE2 text name ).
It must be in my code above see BOLD . Can someone find an issue with this hyperlink? Thanks
I cannot upload to demo account as it is one too large and two for security reasons. But if neccessary I will give you access to server as it is INSPIRUNNER your server if neccessary.

Admin 11/28/2015

This post is a collection of huge amounts of confusion and misunderstandings. I'm closing it as non-constructive.
As I mentioned - nobody can troubleshoot it by just looking at this code. More than that, if you saying that the part of code that creates the URL with values in it works why you keep posting the same code? Instead of doing this from your code you can just easily craft the URL like somepage.php?value1=somevalue&value2=someothervalue and open it manually in the browser. If issue is still there is has nothing with passing parameters via URL. It is all about the receiving page setup and everything you saying about passing the parameters via URL confuses everyone who is trying to help you.