close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamic GET, Recordset not working

Thread began 1/21/2012 3:45 pm by keegan431775 | Last modified 1/25/2012 12:32 pm by keegan431775 | 1692 views | 15 replies |

keegan431775

Dynamic GET, Recordset not working

Hi.

I purchased this product to replace Kollection plugin that I used to use. I am in desperate need of basic functionality of this product or I can't justify that I spent so much money on this.

My issue is that I want to add dynamic variables into the redirect and hidden fields. I use the dynamic picker to choose either a URL variable or a recordset and it gives me nothing. What do I have to do to get this to work?

Example: I want to redirect to page.php?id=<?php echo $_GET['id']; ?>
Example: I want to put <?php echo $_GET['id']; ?> into a hidden field

Neither of these work. Please help ASAP! My time is very limited.

Thanks.
Keegan

Sign in to reply to this post

Ian S

Hi Keegan,

I am a little confused by your post.

What you describe below is basic dreamweaver / php recordset functionality and does not require any WebAssist products.

What are you trying to achieve with DataAssist?

Thanks
Ian

Sign in to reply to this post

keegan431775

I have a form that is on a page that also displays quote information from a record set. Ex: page.php?quote=12

I want to be able to put the quote number from the URL or recordset into the form on the same page. I also want to redirect back to the same page with the quote number in the URL like the original page.

I have used the dynamic button to access the binding code and place it in the form but it returns nothing. If I place the same code on the page it works. But doesn't work when placed in the field or the redirect field.

Thanks.
Keegan

Sign in to reply to this post

Ian S

Can you attach / paste the code of your page so that I can take a look at it ?

Cheers
Ian

Sign in to reply to this post

keegan431775

taccording etireye

Here is the code:


<?php
// WA Application Builder Insert
if (isset($_POST["ItemEntry_submit"])) // Trigger
{
$WA_connection = $MyLogin_db;
$WA_table = "item";
$WA_sessionName = "item_i_id";
$WA_redirectURL = "add_item.php?quote=".$row_rs_quote_details['q_id'] ."";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_indexField = "i_id";
$WA_fieldNamesStr = "quote|customer|model_num|description|price";
$WA_fieldValuesStr = "".$row_rs_quote_details['q_id'] ."" . "|" . "".$row_rs_quote_details['c_id'] ."" . "|" . "".((isset($_POST["fieldset_group_Model"]))?$_POST["fieldset_group_Model"]:"") ."" . "|" . "".((isset($_POST["fieldset_group_Description"]))?$_POST["fieldset_group_Description"]:"") ."" . "|" . "".((isset($_POST["fieldset_group_Price"]))?$_POST["fieldset_group_Price"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_MyLogin_db;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>

Sign in to reply to this post

Ian S

Thanks Keegan.

Is this Insert positioned after the recordset code for rs_quote_details?

Cheers
Ian

Sign in to reply to this post

keegan431775

Let me just state that this has nothing to do with there being a value available or not. It is pulling from a recordset that I have accessed on the page by a quote number. The page loads and pulls up all the info for the given quote number in the URL. Therefore I should be able to add this same value into the form and/or any other place. BUT for some reason when I add this to any of the DataAssist stuff, it doesn't pull up anything.

Thanks.
Keegan

Sign in to reply to this post

Ian S

I know, but when you post a form you load the page again.

Is the Insert code before or after the recordset code?

Also, your original problem was based on using the GET value in the redirect. Have you changed your mind as this isn't present in the code you posted.

Cheers
Ian

Sign in to reply to this post

Jason ByrnesWebAssist

Like Ian said, make sure that the insert code block comes after the recordset code block, in the redirect, you are using a recordset value not a querystring value.


you don't post the recordset code, but I'm guessing you have the recordset using the querystring variable for filtering. Bear in mind that when you submit a form, you are reloading the page. If the page requires a querystring variable when it loads initially, you will need to include that querystring variable as a part of the forms action.

in the form tag, use the following code for the action:

php:
 action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".htmlspecialchars($_SERVER["QUERY_STRING"]):""?>"




this will automatically include any query string variable that is used to load the page when the page is submitted.

Sign in to reply to this post

keegan431775

I'll give that a try but what about putting dynamic content in forms? I tried inserting the code using the entity/dynamic picker in DataAssist and it doesn't work. This worked in Kollection but yours doesn't work. That is a basic function that should work.

Thanks.
Keegan

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...