Recordset pageing and unencoded ampersands in URLs
Hi
In DW8 the code written by the record set paging object fails w3c validation because of unencoded ampersands in URLs
ie
page.php?pageNum_portfolio=1&totalRows_portfolio=52
rather than
page.php?pageNum_portfolio=1&totalRows_portfolio=52
Can anyone advise how I resolve this?
Has this been fixed in a later release of DW?
Thanks
http://www.lamtha2.co.uk/portfolio.php?pageNum_portfolio=1&totalRows_portfolio=52
Are you using Dreamweaver 8.0.2? If not, get the updater from http://www.adobe.com/support/dreamweaver/downloads_updaters.html#dw8. You will also need to install the PHP extension fix for 8.0.2. Get it from the link in the first paragraph on the following page: http://kb2.adobe.com/cps/000/b6c2ae2a.html.
I have just compared the code from a site made in DW 8.0.2 with one made in DW CS4. It's identical, and it correctly encodes the ampersand.
If you're using 8.0.2, and the ampersand is not correctly encoded, it could be the version of PHP you're using. Try the following:
<?php printf('&'); ?>
Load that into a browser and view the source. In PHP 5.3, it outputs it as the correct HTML entity.
Similar Messages
-
Problems with recordset paging and dynamic menu displaying all the options
Hi hope someone can help on this - I've posted the code on the FoEd Backend Blight - with no takers/success yet -
I've created a jobs page using DWCS3 which has a dynamic drop down menu filtering the 'countries' that jobs are located in. When I introduce a recordset page only those countries associated with the jobs on that particular page are shown in the dynamic menu above, not all of the countries listed in the database. When I get to the second page of results - again - only those jobs' countries are shown in the menu (and not the previous pages/next pages as well).
I'd clearly like a user to be able to select from the menu of countries available for all the jobs in the database, and not just those on the page. Any ideas?
On a similar strain - my country menu/filter is wrapped up in a form above the list of jobs. On loading the page, only the search and menus appear. No jobs are shown until I hit submit. Is there a way to have all the jobs display on first load, and then for the search/menu filter to work on the displayed jobs. I've tried altering the variables on the search to 1 from -1, and other options but I can't seem to get a page of content on first load.
I'd really appreciate any pointers on the above, as this would help solve the final stage of my project. The full post and code can be seen on the friendsofed website under backend blight.
Many thanks in advance.
MattI'm still stuck on getting the page to load with some actual content, however. I'm just getting the search box and country filter displaying on first load.
Pages 584-6 explain why you get nothing when a page first loads. Dreamweaver sets the default value to -1. The problem with trying to change the default value even to an empty string or % is that Dreamweaver's security function, GetSQLValueString() changes an empty string to NULL and wraps % in quotes, so neither will work.
One way to display all records when the page first loads is to create another recordset that selects all records. Wrap the code in a conditional statement that checks whether the $_GET array contains any values:
if (!$_GET) {
// recordset to retrieve all records here
This means that you need two repeat regions to display the results. Wrap both of them in conditional statements:
if (isset($fullRecordsetName)) {
// display the full recordset
} elseif (isset($searchResultsRecordsetName)) {
// display the search results
You also need to wrap the mysql_free_result() statements in conditional statements at the end of the page:
if (isset($fullRecordsetName)) mysql_free_result($fullRecordsetName);
if (isset($searchResultsRecordsetName)) mysql_free_result($searchResultsRecordsetName);
Another way to do it is to use just one recordset, but split the SQL query into two sections:
$query_RecordsetName = "SELECT * FROM myTable";
if (isset($_GET['searchTerm')) {
$query_RecordsetName .= sprintf(" WHERE searchTerm LIKE %s",
GetSQLValueString("%" . $colname_RecordsetName . "%", "text"));
This uses the combined concatenation operator to add the WHERE clause to the query only if $_GET['searchTerm'] has been set. Notice that you need a space before the "WHERE". -
Ampersands not being encoded in recordset paging
Trying to validate a page and it appears that the ampersands
are not being encoded, thus not validating the page. When I create
a link and use parameters the ampersands get encoded correctly, its
just the next/previous links that don't appear to get encoded. Any
ideas how to overcome this? The links in Dreamweaver are just
variables, and I could try to replace the & in the function
that creates them with &Amp; but I would have to do this
everytime I used recordset paging.
SteveI used the wrong syntax for the URLEncode, here is what made
it work:
<%
MM_moveFirst = Server.URLEncode(MM_moveFirst)
MM_moveLast = Server.URLEncode(MM_moveLast)
MM_moveNext = Server.URLEncode(MM_moveNext)
MM_movePrev = Server.URLEncode(MM_movePrev)
%>
Once I had sorted these I had to also sort all the other
ones, and am still struggling to get it to validate, it seems like
a lot of work, so will leave it for another day. -
I'm sure this is something simple, but...
I have a recordset that pages at 25 records. The first asp
page comes up fine but when I advance the recordset, it adds a
directory prior to the index.asp page.
As in
http://www.thequestfor.com/
- becomes - http://www.thequestfor.com
/TQF/index.asp?offset=25
The directory layer it's adding is a valid directory (it's
actually the root of the domain) but any idea why it's being added?
And what's pulling it?
Any help would be appreciated.
Thanks,
RonRon,
This can only be a problem with the link the recordset
navigation has created. If you can't edit out the directory
manually then i'd say look at the point when you created the
recordset paging/navigation. There is a dropdown to choose the link
you want to use. I can only assume that this process has somehow
added the extra directory. You should have code that looks like
this:
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveNext%>">Next</a>
<% End If ' end Not MM_atTotal %>
I'd be happy to look at your code for you if you post it
here.
Regards
Paul -
Spry Tabbed Panel Defaults to home page with recordset paging
I have Spry ver. 1.6.1. A Spry Tabbed Panel titled "Check Ride Activity Report" (Tab 6) accesses a mysql database and shows the records in a table format. Instead of having all the records display at once I want to limit the records displayed to a few at a time. e.g. 5 per page. I added a recordset navigation bar and set the $maxRows_GetChkRideRecs = 5; It works but each time the navigation bar "Next" or "Last" or "First" or "Previous" is clicked the page reloads with the default Home page Tab displayed. The user then has to click on Tab 6 to view the new results. The url where this can be viewed is at http://Training.reliantair.com. Is there a way to code this tab so that Tab 6 remains the default tab once it is selected until the user selects another tab?
I want to avoid putting another button on the page to accomplish this as shown in the spry utils samples where the user clicks to set the default tab.
Can this be done within the recordset paging code similar to how it is done on a form submit to keep the focus on the current tab?I didn't try the cookie method suggested. The tab method listed in spry utils does work but requires an additional button, so I came up with this solution.
In the Head of the HTML document I put this code. It searches for the query string in the HREF when any of the record paging buttons is pressed.
<script type="text/javascript" src="SpryURLUtils.js"></script>
<script type="text/javascript">
var params = Spry.Utils.getLocationParamsAsObject();
if (location.href.indexOf("GetChkRideRecs") != -1 && location.href.indexOf("tab") == -1)
location.href +="&tab=5#TabbedPanels1";
</script>
Then in the body of the HTML document at the bottom of the page the tabbed panel widget is changed like this:
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1",{defaultTab: (params.tab ? params.tab:0)});
The first time a recordset paging link is clicked the HREF attribute of &tab=5#TabbedPanels1 is added to the location HREF. Subsequent clicks of any of the links do not change the HREF because the code looks for "tab" and does nothing if it is found. -
After Creating a RecordSet using Wizard, Unable to Create RecordSet Paging - Error Occurs
I created a record set using the wizard and it tested just fine using the test button. So my next step was to create the "RecordSet Paging" "Move to First Record", whe I select this I get the error "Before using this Server Behavior, please create a record set"
The record set is there, it is even checked off in the binding list as being there, yet I can not do anything, I even went in and deleted it and tried again with the same result, this is getting very annoying and is causing me a lot of extra work.
Is this a BUG!!!
I have seen this issue several times now.
Running Version 11.0 build 4993
Signed
Frustrated!!!!!Hi,
For questions regarding dynamic site development, hop over to the following forum. You'll get better answers there.
Dreamweaver Application Development Forum
http://forums.adobe.com/community/dreamweaver/dreamweaver_development?view=discussions
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb -
Recordset paging without refresh
Hi i have some recordset paging halfway down my page and when
i click next prev the page refreshs and it goes to the top of the
page which is annoying as you have to scroll down again to see the
next set of records.
I tried using anchors to get the page to stay where the
paging is but i get a undynamic looking flash as it corrects
itself.
Is there a way to solve this?Hi i have some recordset paging halfway down my page and when
i click next prev the page refreshs and it goes to the top of the
page which is annoying as you have to scroll down again to see the
next set of records.
I tried using anchors to get the page to stay where the
paging is but i get a undynamic looking flash as it corrects
itself.
Is there a way to solve this? -
I am trying to use the recordset paging button in dreamweaver it seems to load right
but when I hit next it says 0-0 zero and is empty even though the first page says there is
517 items to look at . I am not getting to the second page and beyond for some reason I cant figure out. Is this an issue with cs3 I have cs4 as well but use cs3 on my laptop. I can post the code if need be ...Thanks for the helpful info.
Brandon
"danilocelic AdobeCommunityExpert"
<[email protected]> wrote in
message news:f7ll5h$1u9$[email protected]..
> Nancy - Adobe Comm. Expert wrote:
>> The code for
>>> the recordsets created with CS3 appears to be
different. Why would the
>>> new code "break" my setup (it's not recognizing
any sorts)?
>>
>>
>> Recordset code was not updated in CS3, but rather in
8.02 to deter SQL
>> injection attacks. Quickly remake the recordset with
the new version and
>> you should be good to go.
>
> Nancy,
>
> Unfortunately, what the OP is asking for isn't possible
with the "new
> version" of recordset, as it assumes that all parameters
within the SQL
> are column value parameters, and dynamic SQL generation
is no longer
> supported. This has caused a number of folks )including
Tom Muck quite
> vociferously) to complain about the lack of versatility
of the new
> recordset code.
>
>
>
> Brandon, What you'll need to do is to hand edit the
recordset after you've
> applied it to the page. I've not tried this particular
use case recently,
> but it is possible that after editing that DW will no
longer recognize
> that the recordset is on the page.
>
> FWIW: You should never directly use a querystring
parameter in your code,
> you should always "clean" it first. IIRC The old style
of recordsets did a
> replace on the value replacing all single quotes with
doubled single
> quotes. A better way may be to have some code that
checks for the value of
> the querystring parameter and if it matches one of your
column you can
> sort on, then use a string of your own making to use
within the SQL.
>
>
> --
> Danilo Celic
> | Extending Knowledge Daily :
http://CommunityMX.com/
> | Adobe Community Expert -
I need to display many records, and I will acheive this by using the recordset paging features, but I have content above my list that I only want visible on the first page. Is there a way to remove the surplus content on subsequent pages? If so, how?
Thanks.Test the recordset paging value in the querystring. If it's above the range of the first page, branch around the code you don't want to execute. Include a sample of your page code if you need more specific details.
-
Recordset paging with two db in a single page
I have two table to be show in a page, I can create a
recordset paging for a table(A), but when i try create another
recordset paging for other table(B) it changes all my other
behaviors for my table(A). so is there any help for this?Create the rs for table A on one page, then create the rs for
table B on another page, then go to the code for table B and copy
it from the second page and paste it into the first page with table
A.
Have you got a connection string for both db's? If you have
two db's, then you should have two connection strings at the top of
the page after the first line of code.
I have a site with three db's on a couple of pages!
Mat -
Minefield just would not open pages, whatever I tries to type in the addressbar the URL just stayed there and nothing happened. Even if I opened a new tab and put a new url again it did not even start loading the page. This is happening since the last updates from today or yesterday. I already removed minefield and installed it again
== This happened ==
Every time Firefox opened
== today ==
== User Agent ==
Mozilla/5.0 (Windows; Windows NT 5.2; Win64; x64; rv:2.0b3pre) Gecko/20100728 Minefield/4.0b3pre ( .NET CLR 3.5.30729; .NET4.0E)Create a new profile as a test to check if your current profile is causing the problems
See [[Basic Troubleshooting|#Make_a_new_profile|Basic Troubleshooting: Make a new profile]]
There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"
If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
See also http://kb.mozillazine.org/Browser_will_not_start_up
You can discuss issues with Namoroka 3.6 and Minefield 4.0 nightly and alpha/beta builds at the MozillaZine Firefox Builds forum.
That forum is better suited to discuss such issues.
You need to register on the MozillaZine forum site in order to post at that forum.
See http://forums.mozillazine.org/viewforum.php?f=23 -
We are developing a Plugin with the specific purpose to display the URL to which any link redirect to on any website.
This URL should appear in the pop up when the user right clicks and selects the "show URL" option in the context menu.
Can some one please help us either to find such plugin (except firebug) or guide us how to develop such a plugin.Look for related articles here: <br />
http://developer.mozilla.org/en/ -
How can I read the bootstrap files of any HDS Live stream and extract the fragment-URLs and fragment-numbers in plain text?
Could it be that it is some kind of compressed format in the bootstrap? Can I uncompress it wirh f4fpackager.exe? Could not find any download for f4fpackager.exe. I would prefere less code to do so. Is there something in Java of JavaScript, that can extract the fragment-numbers?
Thank you!Doesn't sound too hard to me. Your class User (the convention says to capitalize class names) will have an ArrayList or Vector in it to represent the queue, and a method to store a Packet object into the List. An array or ArrayList or Vector will hold the 10 user objects. You will find the right user object from packet.user_id and call the method.
Please try to write some code yourself. You won't learn anything from having someone else write it for you. Look at sample code using ArrayList and Vector, there's plenty out there. Post in the forum again if your code turns out not to behave. -
Digital signatures and view document througt URL
Hello together,
We use status document and digital signatures workflow and we canu2019t use URL link to documents which have been approved. In browseru2019s window I see digital signatures information and error :u201DHTTP 404 the web page cannot be foundu201D.
In transaction SOLAR01, SOLAR02 when, I display approved document, at first I see the windows with digital signatures information and then, after push enter - required document.
If document in status u201Cin progressu201D we donu2019t have problem.
Could you help me to resolve this problem or disable windows with signatures information?Hello Francesco,
I want to generate a digital signature (PKCS#7,XML) using SAP SSF API as explained in
http://help.sap.com/saphelp_nw04/helpdata/en/4f/65c3b32107964996a56e4165077e24/content.htm and in Amol Joshi's reply in
Digital Signatures and Document Encryption api
so my question is From which PI/XI version and its SPS this SAP SSF LIBRARY is supported ?
Kind Regards,
Kubra fatima. -
Hi,
I have a procedure doing paging and returning the count of rows:
As you see I used 2 select, one for paging and one for getting total row counts.
Is there a way to get rid of "SELECT count(*) into PO_TOTAL FROM TABLE1;"?
CREATE OR REPLACE PACKAGE BODY MYPACKAGE AS
TYPE T_CURSOR IS REF CURSOR;
PROCEDURE SP_PAGING
PI_STARTID IN NUMBER,
PI_ENDID IN NUMBER,
PO_TOTAL OUT NUMBER,
CUR_OUT OUT T_CURSOR
IS
BEGIN
OPEN CUR_OUT FOR
SELECT *
FROM (SELECT row_.*, ROWNUM rownum_
FROM (
SELECT column1, column2, column3 FROM TABLE1
) row_
WHERE ROWNUM <= PI_ENDID)
WHERE rownum_ >= PI_STARTID;
SELECT count(*) into PO_TOTAL FROM TABLE1;
END SP_PAGING;
END MYPACKAGE;Yes, I can reproduce that:
SQL> create table emp1 as select * from emp
2 /
Table created.
SQL> exec dbms_stats.gather_table_stats('SCOTT','EMP1');
PL/SQL procedure successfully completed.
SQL> EXPLAIN PLAN FOR
2 SELECT ename,
3 job,
4 sal,
5 cnt
6 FROM (
7 SELECT ename,
8 job,
9 sal,
10 count(*) over() cnt,
11 row_number() over(order by 1) rn
12 FROM emp1
13 )
14 WHERE rn BETWEEN 4 AND 9;
Explained.
SQL> @?\rdbms\admin\utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 1444408506
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 14 | 728 | 4 (25)| 00:00:01 |
|* 1 | VIEW | | 14 | 728 | 4 (25)| 00:00:01 |
| 2 | WINDOW BUFFER | | 14 | 252 | 4 (25)| 00:00:01 |
| 3 | TABLE ACCESS FULL| EMP1 | 14 | 252 | 3 (0)| 00:00:01 |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
1 - filter("RN">=4 AND "RN"<=9)
15 rows selected.
SQL> EXPLAIN PLAN FOR
2 SELECT *
3 FROM (SELECT row_.*, ROWNUM rownum_
4 FROM (
5 SELECT ename,job,sal, count(*) over() FROM emp1
6 ) row_
7 WHERE ROWNUM <= 9)
8 WHERE rownum_ >= 4;
Explained.
SQL> @?\rdbms\admin\utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 519025698
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 9 | 468 | 2 (0)| 00:00:01 |
|* 1 | VIEW | | 9 | 468 | 2 (0)| 00:00:01 |
|* 2 | COUNT STOPKEY | | | | | |
| 3 | VIEW | | 9 | 351 | 2 (0)| 00:00:01 |
| 4 | WINDOW BUFFER | | 9 | 162 | 2 (0)| 00:00:01 |
| 5 | TABLE ACCESS FULL| EMP1 | 9 | 162 | 2 (0)| 00:00:01 |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
1 - filter("ROWNUM_">=4)
2 - filter(ROWNUM<=9)
18 rows selected.
SQL> However, you interpreted it incorrectly. Your query will still fetch all rows in TABLE1. Optimizer is smart enough to stop creating window buffer after 9 rows and that is what you see 9 in explain plan, while my query builds 14 row window buffer and then filters. So your query will be a bit faster.
SY.
Edited by: Solomon Yakobson on Jan 25, 2009 2:51 PM
Maybe you are looking for
-
HT1918 how can i setup my account without a credit card
how can i setup my account without a credit card
-
Photoshop cs6 keeps crashing!! ntdll
Hi, I am running photoshop cs6 on Win 7 64 and it crashes all the time. Sometime after a few seconds or minutes, and sometimes it can't even open. The falt module is always Windows\SYSTEM32\ntdll.dll I have installed Photoshop countless times, system
-
When we would create genric extractor on a infoset query
hi All, we have infoset queries inour R/3 But very confused whether i should i go for generic with querry or genric with views. Actually the scenario is I have the insfoset query on logical data base I can create a generic extractor with view from t
-
Is it possible to save and sort document files in a single Cocoa document?
That heading probably makes no sense whatsoever. Here is what I would like to be able to do. Let's say that I want to create a text journal on my car hobby. I would like to be able to open this document, pick the Ford category (from many auto makes)
-
CATS selection + Structural Authorization Check
Hi, guys! Please, check if you can help me with this doubt. The seleciton of CATS are according to the Cost Center. And we need to change the employee selection of CATS according to the new Structural Authorization (recorded in OOSB). So the