Query :: Access $Link From The Httprequest Result?
May 25, 2011
I'm trying to run a php query via ajax httprequest. In my php script I have query result. I am also creating a txt file and link to the file. The query result then becomes the link to the file like so:
[Code]...
where $counter[0] is the result of the query. How do I access $Link from the httprequest result so I end up with something like this:
[Code]...
View 2 Replies
ADVERTISEMENT
Apr 7, 2009
If I want to show the result of a database query, every second or so, is the best method using javascript/ajax with a set interval of a second to call a PHP script and update the DOM, or is there some other method better suited to this that would not have the cpu overhead if there were many users on the site.
View 3 Replies
View Related
Apr 15, 2008
Does anyone know how to set a javascript variable as a query result from a MySQL database.
As an example, like this:
Set this query:
I just can't do it. I've tried doing it like this:
But the thing stops my <body onLoad=""> function from working. I'm no expert in Javascript.
View 9 Replies
View Related
Feb 25, 2009
i having problem on passing the database query result to the javascritpt for calculation.i doing a program that need to calculate the total_price for the purchase items. i use getString to get the foodID, f_item and the unit_price from database, then i need to use the unit_price for doing the calculation in javascript. after get the data from database, the unit_price is used to multiple with the qty that user input to calculate the total_price.since there are several row of data get from database, so user need to enter the qty for each item and then press [Calculate_db] button to perform the calculated result. hence, the total_price for each item is calculated and the sum of all the total_price also being calculated and display in the page.now, i having problem on pass the unit_price to the javascript for calculation.
<form name="formCalc2">
<table>
<tr>
[code]....
View 1 Replies
View Related
May 4, 2010
inserting a result of a SQL query into a html template.I've got a function which sends a query to a client side database und should afterwards show the result on the html side. Here is my function:
function refreshEntries() {
db.transaction
(
function(transaction)
[code]....
View 1 Replies
View Related
Mar 31, 2011
My problem is that users have the ability to manipulate querystrings to the point of being able to access data to which they should not have access to. The user logs in with their details and is redirected to their own data. The URL in the status bar is displayed without the &id=xxxx but in the source the &id=xxxx is present as a HREF. If the user adds &id=xxxx (Where x is any integer) they can access the data of other users. how to prevent this? To my mind, the best course of action would be to include id=xxxx in the session data and not to have it as a querystring but I would not know how to approach this.
View 14 Replies
View Related
Aug 5, 2011
I am currently working on an website which consists of 2 sites. Both have the same design (expect for the colors) and both sites have different navigation items (some are the same). I started the page in PHP with classes. Every site is a Site class which has an array of Content classes.Site->showNavi($section); prints out the navigation of the current site, with a navigation item for each Content class in the array. The active ($section) item is highlighted.Site->showContent($section,$subsection); prints out the content.
First i just wanted to use AJAX for the content section but then I realised that I could use it also on getting thenavigation and the content without reloading the page. So i searched the web and decided to use jQuery.
I started with the change site/design links and with the help of an tutorial i quickly managed to get these links work with following code:
$("#site_navi a").click(function(){ var site = $(this).attr('rel');
var cssfile = "/css/"+ site +".css";
var headerimg = "/img/"+ site +"/logo.png";
$("#site_css").attr("href",cssfile);
[Code]....
But it didn't work and after some testing i realised that i can't access the elements (e.g. a.navigationitem) which Igot from the request from "ajax_get_navi.php", because if i write down the navigation in the html code it works.
So, is there a way to get access to these elements? If not what do i have to change in the ajax_get_navi request to get access?
View 1 Replies
View Related
Apr 14, 2011
I'm working on a search engine that is just like google but customized for me and my friends. I have everything working well from the scripts supplied by google however they don't allow image searches. In order to combat this I added a link that links to google images. Is there a way to make the link go to google images and display my search keyword without having to retype it? The site is [URL] if you need to look at it.
View 1 Replies
View Related
Sep 3, 2009
I have autocomplete working for a list of colors(red, green, blue, etc). I created an array of $id's to match each color. For example if someone types and selects "red", I want it to go to a page like mypage.php?id=1. How can I (1) parse the ids in the array and (2) implement the result()
function so that it links to a page and posts the proper $id? I have a live example with source code here: [URL].. and if you would be kind enough to be as explicit as you can with examples on how to make an autocomplete result link to a page and pass an $id.[URL]..
View 1 Replies
View Related
Dec 20, 2005
I use an HttpRequest in my web application to launch an heavy
computation server side. The result is then send back to the browser.
The problem I got is that when the computation took too much time, then
I never get the result. I have to reload the page to get it.
I assume it's because my socket connection has time out, but my event
listener does not seems to get any event. Maybe I miss something:
function xmlhttpChange()
{
// looking fo a xmlhttp "loaded"
for (var i in nodeId2xmlHttp) {
if ((nodeId2xmlHttp[i] != null) && nodeId2xmlHttp[i].readyState ==
4) {
if (nodeId2xmlHttp[i].status==200) {
nodeId2xmlHttp[i] = null;
} else {
alert("Problem retrieving XML data (nodeId: " + i + ")");
nodeId2xmlHttp[i] = null;
}
}
}
}
My question is : how to handle XMLHttpRequest timeout. Any pointers?
View 3 Replies
View Related
Oct 28, 2005
I've created a page that uses HTTPRequest to include some
XML data and allow the user to update that data. The
problem is that the new data doesn't show up, even though
the XML file is changed.
I can call the XML file up in a separate browser window,
where I get the old data, refresh to get the new data, then
when I refresh the first browser, the new data appears on
the page.
I'm thinking this might be some sort of server caching
issue. Has anyone else run into this? Does anyone have a
solution?
View 3 Replies
View Related
Dec 1, 2011
When I click on a field, I put the object position in a variableEnviro["lastfocus"] = $(event.target);I call the action and a block of HTML arrived on the page, I place this text and then after, i want the focus to return to the field and I do this:
$(Enviro["lastfocus"][0]).focus();
But nothing append
View 2 Replies
View Related
Nov 23, 2005
I am finding some unusual behavior with techniques I am using to
show/hide/update data without having to refresh the page. I'm quite
sure it's developer ignorance on my part and would be grateful for any
suggestions.
My page has 10 tables with their visibility controlled by the user
making a menu selection. For example, selecting menu_1 calls a
function which displays table_1 by setting table_1's style display:
block and hides tables 2-10 by setting their respective styles to
display: none. Everything in this simple navigational approach works
as expected.
I am also using the HTTPRequest object to update relevant objects on
the page based on user input. The problem I am seeing is when the
HTTPRequest object is used to update DOM objects contained within the
"invisible" tables -- or more accurately within those tables having
their style display:none. I have tried using both the HTTPRequest
object's synchronous and asynchronous approach and am seeing the same
results.
I've tested when all of the tables are "visible" by setting their style
settings to display:block and HTTPRequest calls work as expected.
The other twist in my example is that these HTTPRequest calls are each
making a SQL query and updating a chart object within the table, which
may take about 500ms each to return. My initial impression is that it
looks as if the page is being rendered too fast because any more than
three charts on a page is when the charts start getting misplaced on
the page. Again, everything works fine when all tables are visible.
Is this a known problem with HTTPRequest, or do I need to migrate my
coding techniques to the 21th century?
View 1 Replies
View Related
Dec 1, 2011
first, i put the object on a variableEnviro["lastfocus"] = $(event.target);after that i do an action and the data come back from the httpRequestthen I do that$(Enviro["lastfocus"][0]).focus();But nothhing append, no error bot no result.
View 1 Replies
View Related
Dec 4, 2006
I am using the Microsoft.XMLHTTP object to make server requests ie;
ajax. This is working 99% of the time but occasionally it will freeze
at the server for 5 minutes and then raise a javascript exception
"Unknown name".
After the exception I can run the same request ok, and keep doing so
until the next time it freezes for 5 minutes.
What does the "Unknown name" javascript exception mean?
Why does it freeze for 5 minutes?
I can't replicate this on my dev pc, it's only happening in a live
environment with IE6 and 2 load balanced IIS6 servers.
View 2 Replies
View Related
Feb 16, 2009
I need a counter that will display beside a link, with the number of times the same link has been clicked. I do not have FTP access to the site, since it is based on a CMS.
View 1 Replies
View Related
Jul 23, 2005
I was wondering if you can get the info from the query string in a server-side javascript tag?
Here's what I'm trying to do...
View 8 Replies
View Related
Nov 13, 2007
I need a script that will get a query string and return it's value.
View 1 Replies
View Related
Aug 20, 2003
I have a page of rows of dynamic data... the user can click on a link for each entry... that allows them to open a popup window... add / edit or delete some sub-entries for each entry.
When they close the popup window, how can I get the background page to refresh and show the updated data... without pressing the refresh button...
a) could I get the page to refresh automatically every 30 seconds ?
b) could I get the popup to switch focus to the window that opened the popup and then refresh that page?
View 1 Replies
View Related
Mar 24, 2005
i have javascript menu form my site that has two js file:
"data1.js"
PHP Code:
var isHorizontal=0;
var blankImage="images/blank.gif";
var fontStyle="normal 8pt Verdana";
var fontColor=["#000000","#000000"];
var fontDecoration=["none","none"];
etc....
var menuItems =
[
["Page 1","page1.php","img/new1-05.gif","img/new1-05.gif","Page1"],
["Page 2","page2.php","img/new1-05.gif","img/new1-05.gif","Page2"],
etc...
];
// Do not remove this line!
apy_init();
and "apymenu.js"
I want to link "page1.php" pick up id from url (http://www.mysite.com/anypagewithid.php?id=34) and when i click at menu it has to be url page.php?id=<id_from_url>
I have try menu at site, it works fine ;-)
Also, how can include some php in menu, like list of mysql rows and etc.
View 9 Replies
View Related
Jun 21, 2006
I have created an array and store 3 functions in it. Eg.
this.validateCols = new Array();
this.validateCols[this.COST] = function(obj, index)
{
return 0;
};
this.validateCols[this.LOCKED] = function(obj, index)
{
return 0;
};
this.validateCols[this.COMPLETION] = function(obj, index)
{
return 0;
};
Calling validateCols[0](0, 0) works in IE, but in Firefox I get:
validateCols[0] is not a function
Is this the correct way to define functions in an array? Or is there a better way?
Or is this not supported at all in Firefox?
Q(2)
Also .swapNode() is not in Firefox? Any alternatives?
Q(3)
I implemented drag 'n' drop and it works in IE but not in Firefox.
Each droppable HTML TD element has:
ondragenter="this.parentNode.style.backgroundColor = 'gray' window.event.returnValue = false;"
ondragover="window.event.returnValue = false;"
ondragleave="this.parentNode.style.backgroundColor = 'white' window.event.returnValue = false;"
ondrop="OnDrop(this);"
Each draggable URL element has attributes:
id='draggable'
onmousemove='window.event.srcElement.dragDrop();'
ondragstart='window.event.dataTransfer.setData("text", "data");'
View 4 Replies
View Related
Nov 28, 2006
I have a ul I want to access via the DOM that is here:
<div id="options>
<form>
<div>
<div>
<span>Some text</span>
<ul>
...
</ul>
</div>
</div>
</form>
</div>
Each child of #options has text nodes besides the HTML elements. Short of doing
document.getElementById('options').childNodes[1].childNodes[1].childNodes[1].childNodes[3]
or giving the UL an ID, is there any other way I could access that UL? I'm imagining something like an array containing every single child (even grandchildren, etc.) of #options but I don't know if it exists. I know the most sensible thing to do is to give the UL an ID, but I'm curious.
View 3 Replies
View Related
Jul 23, 2005
I need to look at the url, if a variable is present in the query string.
so, if my address bar looks like:
View 10 Replies
View Related
Jul 23, 2005
Below is a stock script I found which controls a framed environment.
My problem is that if a URL has a query string attached, that string
does not pass through. Can someone please let me know if and
hopefully how, it will be possible to carry a query string through?
This first part here is in the default.asp framed page. Code:
View 4 Replies
View Related
Jul 23, 2005
i want to pass XML data in querystring from one to another asp page.
it is about 10000 characters long, i cannot use FORM because it is
already nested in one.
What i do is i have IFRAME and im passing some xml data
in QUERYSTRING. It doesnt work somehow, im using javascript escape
method to substitute escape characters, but most of characters are
being truncated (about 300-500 left).
Are there limits in querystring length?
what else should i try?
View 3 Replies
View Related
Jul 23, 2005
Just wrote a basic java script to show a phrase on the client's browser
status bar as follows:
window.status = "Hello World";
It worked properly under IE but not under Mozilla FireFox. The latter
is still showing "Done" when I open the webpage.
View 2 Replies
View Related